shuichan_new/STM32F103_App1/HardWare/LED/led.h

36 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __LED_H
#define __LED_H
#include "main.h"
/* LED1: 结构保留为无操作; V1.7.0 新板 PA8 为 HR_IN 缺料检测(见 feed_scale.h) */
#define LED1_Pin GPIO_PIN_8
#define LED1_Port GPIOA
#define LED1_ON ((void)0)
#define LED1_OFF ((void)0)
#define LED1_TOGGLE ((void)0)
/* LED2 - PC13: 运行闪烁灯 */
#define LED2_Pin GPIO_PIN_13
#define LED2_Port GPIOC
#define LED2_ON HAL_GPIO_WritePin(LED2_Port, LED2_Pin, GPIO_PIN_SET)
#define LED2_OFF HAL_GPIO_WritePin(LED2_Port, LED2_Pin, GPIO_PIN_RESET)
#define LED2_TOGGLE HAL_GPIO_TogglePin(LED2_Port, LED2_Pin)
/* 联网指示灯 - PB13: 低电平有效,联网中闪烁,联网成功后常亮 */
#define NET_LED_Pin GPIO_PIN_13
#define NET_LED_Port GPIOB
#define NET_LED_ON HAL_GPIO_WritePin(NET_LED_Port, NET_LED_Pin, GPIO_PIN_RESET) /* 低电平点亮 */
#define NET_LED_OFF HAL_GPIO_WritePin(NET_LED_Port, NET_LED_Pin, GPIO_PIN_SET) /* 高电平熄灭 */
#define NET_LED_TOGGLE HAL_GPIO_TogglePin(NET_LED_Port, NET_LED_Pin)
/* 联网状态标志0=未联网1=联网成功 */
extern volatile uint8_t g_net_led_connected;
/* SmartConfig 配网中标志1=NET_LED 100ms 快闪提示配网模式 */
extern volatile uint8_t g_net_led_smartconfig;
void ledInit(void);
void activeEvents(void);
#endif