11.6:完善多任务和消息队列机制。
This commit is contained in:
24
STM32/Environment_Node/Drivers/Relay.c
Normal file
24
STM32/Environment_Node/Drivers/Relay.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "Relay.h"
|
||||
|
||||
void vPa0RelayInit(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
RCC_APB2PeriphClockCmd(PA0_RELAY_CLK, ENABLE); //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
|
||||
GPIO_InitStructure.GPIO_Pin = PA0_RELAY_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||
GPIO_Init(PA0_RELAY_GPIO_PORT,&GPIO_InitStructure);
|
||||
|
||||
vPa0RelayOff();
|
||||
}
|
||||
|
||||
void vPa0RelayOn(void)
|
||||
{
|
||||
GPIO_SetBits(PA0_RELAY_GPIO_PORT,PA0_RELAY_GPIO_PIN);
|
||||
}
|
||||
|
||||
void vPa0RelayOff()
|
||||
{
|
||||
GPIO_ResetBits(PA0_RELAY_GPIO_PORT,PA0_RELAY_GPIO_PIN);
|
||||
}
|
||||
Reference in New Issue
Block a user