You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
604 B

3 weeks ago
#include "bsp_relay.h"
void RELAY_GPIO_Config(void){
//
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RELAY1_GPIO_CLK, ENABLE ); //配置时钟
3 weeks ago
GPIO_InitStructure.GPIO_Pin = RELAY1_GPIO_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(RELAY1_GPIO_PORT,&GPIO_InitStructure);
3 weeks ago
RELAY1_OFF();
3 weeks ago
}
/**
* @brief
* @param
* @retval 1-, 0-
*/
uint8_t RELAY1_GetState(void)
{
return GPIO_ReadOutputDataBit(RELAY1_GPIO_PORT, RELAY1_GPIO_PIN);
}