30 lines
638 B
C
30 lines
638 B
C
#ifndef __BSP_LED_H
|
|
#define __BSP_LED_H
|
|
|
|
#include "ch32v30x.h"
|
|
#include <stdbool.h>
|
|
|
|
#define BSP_LED_R_PORT GPIOA
|
|
#define BSP_LED_R_PIN GPIO_Pin_8
|
|
#define BSP_LED_R_PORT_RCC RCC_APB2Periph_GPIOA
|
|
|
|
#define BSP_LED_G_PORT GPIOA
|
|
#define BSP_LED_G_PIN GPIO_Pin_7
|
|
#define BSP_LED_G_PORT_RCC RCC_APB2Periph_GPIOA
|
|
|
|
#define BSP_LED_B_PORT GPIOA
|
|
#define BSP_LED_B_PIN GPIO_Pin_10
|
|
#define BSP_LED_B_PORT_RCC RCC_APB2Periph_GPIOA
|
|
|
|
typedef enum {
|
|
bsp_led_red,
|
|
bsp_led_green,
|
|
bsp_led_blue
|
|
} bsp_led_color_e;
|
|
|
|
void bsp_led_init(void);
|
|
void bsp_led_set(bsp_led_color_e color, bool status);
|
|
void bsp_led_toggle(bsp_led_color_e color);
|
|
|
|
#endif
|