Files
2024-02-29 00:45:47 +08:00

39 lines
593 B
C

/*
* 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;
void led_init(void);
void led_config(leddef *e,char *name,GPIO_TypeDef *GPIOx,uint16_t GPIO_Pin,uint8_t State);
void led_setOn(uint16_t channel);
void led_setOff(uint16_t channel);
void led_setToggle(uint16_t channel);
#endif /* BSP_DRV_LED_H_ */