63 lines
2.4 KiB
C
63 lines
2.4 KiB
C
![]() |
/**
|
|||
|
****************************************************************************************************
|
|||
|
* @file led.h
|
|||
|
* @author <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD>(ALIENTEK)
|
|||
|
* @version V1.0
|
|||
|
* @date 2021-10-14
|
|||
|
* @brief LED <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @license Copyright (c) 2020-2032, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿƼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
|
|||
|
****************************************************************************************************
|
|||
|
* @attention
|
|||
|
*
|
|||
|
* ʵ<EFBFBD><EFBFBD>ƽ̨:<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD> ̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD> F407<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ:www.yuanzige.com
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳:www.openedv.com
|
|||
|
* <EFBFBD><EFBFBD>˾<EFBFBD><EFBFBD>ַ:www.alientek.com
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ:openedv.taobao.com
|
|||
|
*
|
|||
|
* <EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD>
|
|||
|
* V1.0 20211014
|
|||
|
* <EFBFBD><EFBFBD>һ<EFBFBD>η<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*
|
|||
|
****************************************************************************************************
|
|||
|
*/
|
|||
|
#ifndef __LED_H
|
|||
|
#define __LED_H
|
|||
|
|
|||
|
#include "./SYSTEM/sys/sys.h"
|
|||
|
|
|||
|
|
|||
|
/******************************************************************************************/
|
|||
|
/* <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> */
|
|||
|
|
|||
|
#define LED0_GPIO_PORT GPIOF
|
|||
|
#define LED0_GPIO_PIN GPIO_PIN_9
|
|||
|
#define LED0_GPIO_CLK_ENABLE() do{ __HAL_RCC_GPIOF_CLK_ENABLE(); }while(0) /* PF<50><46>ʱ<EFBFBD><CAB1>ʹ<EFBFBD><CAB9> */
|
|||
|
|
|||
|
#define LED1_GPIO_PORT GPIOF
|
|||
|
#define LED1_GPIO_PIN GPIO_PIN_10
|
|||
|
#define LED1_GPIO_CLK_ENABLE() do{ __HAL_RCC_GPIOF_CLK_ENABLE(); }while(0) /* PF<50><46>ʱ<EFBFBD><CAB1>ʹ<EFBFBD><CAB9> */
|
|||
|
|
|||
|
/******************************************************************************************/
|
|||
|
|
|||
|
/* LED<45>˿ڶ<CBBF><DAB6><EFBFBD> */
|
|||
|
#define LED0(x) do{ x ? \
|
|||
|
HAL_GPIO_WritePin(LED0_GPIO_PORT, LED0_GPIO_PIN, GPIO_PIN_SET) : \
|
|||
|
HAL_GPIO_WritePin(LED0_GPIO_PORT, LED0_GPIO_PIN, GPIO_PIN_RESET); \
|
|||
|
}while(0) /* LED0 = RED */
|
|||
|
|
|||
|
#define LED1(x) do{ x ? \
|
|||
|
HAL_GPIO_WritePin(LED1_GPIO_PORT, LED1_GPIO_PIN, GPIO_PIN_SET) : \
|
|||
|
HAL_GPIO_WritePin(LED1_GPIO_PORT, LED1_GPIO_PIN, GPIO_PIN_RESET); \
|
|||
|
}while(0) /* LED1 = GREEN */
|
|||
|
|
|||
|
/* LEDȡ<44><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
#define LED0_TOGGLE() do{ HAL_GPIO_TogglePin(LED0_GPIO_PORT, LED0_GPIO_PIN); }while(0) /* LED0 = !LED0 */
|
|||
|
#define LED1_TOGGLE() do{ HAL_GPIO_TogglePin(LED1_GPIO_PORT, LED1_GPIO_PIN); }while(0) /* LED1 = !LED1 */
|
|||
|
|
|||
|
/******************************************************************************************/
|
|||
|
/* <20>ⲿ<EFBFBD>ӿں<D3BF><DABA><EFBFBD>*/
|
|||
|
void led_init(void); /* <20><>ʼ<EFBFBD><CABC> */
|
|||
|
|
|||
|
#endif
|