py32f0-template/Libraries/BSP/Inc/py32f0xx_bsp_led.h
2022-12-12 02:41:49 +08:00

51 lines
1.3 KiB
C

/**
******************************************************************************
* @file py32f0xx_bsp_led.h
* @author MCU Application Team
* @brief
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef PY32F003_BSP_LED_H
#define PY32F003_BSP_LED_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "py32f0xx_hal.h"
typedef enum
{
LED3 = 0,
LED_GREEN = LED3
} Led_TypeDef;
#define LEDn 1
#define LED3_PIN GPIO_PIN_5
#define LED3_GPIO_PORT GPIOB
#define LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
#define LEDx_GPIO_CLK_ENABLE(__INDEX__) do {LED3_GPIO_CLK_ENABLE(); } while(0U)
#define LEDx_GPIO_CLK_DISABLE(__INDEX__) LED3_GPIO_CLK_DISABLE()
void BSP_LED_Init(Led_TypeDef Led);
void BSP_LED_DeInit(Led_TypeDef Led);
void BSP_LED_On(Led_TypeDef Led);
void BSP_LED_Off(Led_TypeDef Led);
void BSP_LED_Toggle(Led_TypeDef Led);
#ifdef __cplusplus
}
#endif
#endif /* PY32F003_BSP_LED_H */