添加串口读写

This commit is contained in:
2024-02-29 00:45:47 +08:00
parent 5b87198936
commit deafcfed1a
62 changed files with 20818 additions and 22162 deletions
+11 -11
View File
@@ -20,17 +20,17 @@ leddef led_m4;
void led_init(void)
{
LED_install(&red,"red",GPIOA,GPIO_Pin_7,0);
LED_install(&green,"green",GPIOC,GPIO_Pin_4,0);
LED_install(&blue,"blue",GPIOC,GPIO_Pin_5,0);
led_config(&red,"red",GPIOA,GPIO_Pin_7,0);
led_config(&green,"green",GPIOC,GPIO_Pin_4,0);
led_config(&blue,"blue",GPIOC,GPIO_Pin_5,0);
LED_install(&led_m1,"led_m1",GPIOA,GPIO_Pin_5,0);
LED_install(&led_m2,"led_m2",GPIOA,GPIO_Pin_15,0);
LED_install(&led_m3,"led_m3",GPIOD,GPIO_Pin_3,0);
LED_install(&led_m4,"led_m4",GPIOA,GPIO_Pin_4,0);
led_config(&led_m1,"led_m1",GPIOA,GPIO_Pin_5,0);
led_config(&led_m2,"led_m2",GPIOA,GPIO_Pin_15,0);
led_config(&led_m3,"led_m3",GPIOD,GPIO_Pin_3,0);
led_config(&led_m4,"led_m4",GPIOA,GPIO_Pin_4,0);
}
void LED_install(leddef *e,char *name,GPIO_TypeDef *GPIOx,uint16_t GPIO_Pin,uint8_t State)
void led_config(leddef *e,char *name,GPIO_TypeDef *GPIOx,uint16_t GPIO_Pin,uint8_t State)
{
GPIO_InitTypeDef GPIO_InitStructure = {0};
uint32_t RCC_Periph;
@@ -83,7 +83,7 @@ void LED_install(leddef *e,char *name,GPIO_TypeDef *GPIOx,uint16_t GPIO_Pin,uint
}
}
void LED_setOn(uint16_t channel)
void led_setOn(uint16_t channel)
{
if (root)
{
@@ -104,7 +104,7 @@ void LED_setOn(uint16_t channel)
}
}
void LED_setOff(uint16_t channel)
void led_setOff(uint16_t channel)
{
if (root)
{
@@ -125,7 +125,7 @@ void LED_setOff(uint16_t channel)
}
}
void LED_setToggle(uint16_t channel)
void led_setToggle(uint16_t channel)
{
if (root)
{