zhyinch
2020-04-04 1560ba22c98a3ddb13710d3592e20eeea8af7616
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
#ifndef __LED_H__
#define __LED_H__
 
#include "main.h"
#include "dw_app.h"
 
 
 
#define LED0_PIN                    LED2_G_Pin
#define LED0_GPIO                    GPIOA
 
#define LED_BLINK(...)                GPIO_Toggle(__VA_ARGS__)
#define LED0_BLINK                    LED_BLINK(LED0_GPIO, LED0_PIN)
#define LED0_OFF                        GPIO_WriteBit(LED0_GPIO, LED0_PIN, Bit_RESET)
#define LED0_ON                    GPIO_WriteBit(LED0_GPIO, LED0_PIN, Bit_SET)
 
#define LED_LR_ON    HAL_GPIO_WritePin(LED2_R_GPIO_Port, LED2_R_Pin, GPIO_PIN_SET)
#define LED_LR_OFF   HAL_GPIO_WritePin(LED2_R_GPIO_Port, LED2_R_Pin, GPIO_PIN_RESET)
void Led_Init(void);
void GPIO_Toggle(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
 
#endif