2023-06-11 18:46:26 +08:00
|
|
|
/*
|
|
|
|
|
* drv_led.h
|
|
|
|
|
*
|
|
|
|
|
* Created on: Mar 31, 2023
|
|
|
|
|
* Author: gxms0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef BSP_DRV_LED_H_
|
|
|
|
|
#define BSP_DRV_LED_H_
|
|
|
|
|
|
|
|
|
|
#include "ch32v20x.h"
|
|
|
|
|
|
|
|
|
|
typedef struct _leddef{
|
|
|
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
uint16_t channel;
|
|
|
|
|
GPIO_TypeDef *GPIOx;
|
|
|
|
|
uint16_t GPIO_Pin;
|
|
|
|
|
uint8_t State;
|
|
|
|
|
|
|
|
|
|
uint32_t timeout;
|
|
|
|
|
|
|
|
|
|
struct _leddef *next_ptr;
|
|
|
|
|
|
|
|
|
|
}leddef;
|
|
|
|
|
|
2023-07-01 19:53:45 +08:00
|
|
|
void led_init(void);
|
2023-06-11 18:46:26 +08:00
|
|
|
|
2024-02-29 00:45:47 +08:00
|
|
|
void led_config(leddef *e,char *name,GPIO_TypeDef *GPIOx,uint16_t GPIO_Pin,uint8_t State);
|
2023-06-11 18:46:26 +08:00
|
|
|
|
2024-02-29 00:45:47 +08:00
|
|
|
void led_setOn(uint16_t channel);
|
2023-06-11 18:46:26 +08:00
|
|
|
|
2024-02-29 00:45:47 +08:00
|
|
|
void led_setOff(uint16_t channel);
|
2023-06-11 18:46:26 +08:00
|
|
|
|
2024-02-29 00:45:47 +08:00
|
|
|
void led_setToggle(uint16_t channel);
|
2023-06-11 18:46:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* BSP_DRV_LED_H_ */
|