wch-code/ch32v307_mp3_dac/User/bsp/bsp_led.h

30 lines
637 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_6
#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_8
#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