25 lines
584 B
C
25 lines
584 B
C
#include "bsp_pa_ctrl.h"
|
|
|
|
void bsp_pa_ctrl_init(void)
|
|
{
|
|
RCC_APB2PeriphClockCmd(PA_CTRL_GPIO_CLK, ENABLE);
|
|
|
|
GPIO_InitTypeDef GPIO_InitStructure;
|
|
GPIO_InitStructure.GPIO_Pin = PA_CTRL_PIN;
|
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;
|
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
|
GPIO_Init(PA_CTRL_GPIO_PORT, &GPIO_InitStructure);
|
|
|
|
bsp_pa_ctrl_disable();
|
|
}
|
|
|
|
void bsp_pa_ctrl_enable(void)
|
|
{
|
|
GPIO_WriteBit(PA_CTRL_GPIO_PORT, PA_CTRL_PIN, Bit_RESET);
|
|
}
|
|
|
|
void bsp_pa_ctrl_disable(void)
|
|
{
|
|
GPIO_WriteBit(PA_CTRL_GPIO_PORT, PA_CTRL_PIN, Bit_SET);
|
|
}
|