39 lines
594 B
C
39 lines
594 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_install(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_ */
|