123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #ifndef __LED_H_
- #define __LED_H_
- #define LED_SEL_RED 0
- #define LED_SEL_BLUE 1
- #define MODEM_LED1_PIN GPIO_Pin_6
- #define MODEM_LED1_PORT GPIOB
- #define MODEM_LED2_PIN GPIO_Pin_7
- #define MODEM_LED2_PORT GPIOB
- #define FLASH_LIGHT_PIN GPIO_Pin_8
- #define FLASH_LIGHT_PORT GPIOA
- #define MODEM_LED1_HIGH (MODEM_LED1_PORT->BSRR = MODEM_LED1_PIN)
- #define MODEM_LED1_LOW (MODEM_LED1_PORT->BRR = MODEM_LED1_PIN)
- #define MODEM_LED2_HIGH (MODEM_LED2_PORT->BSRR = MODEM_LED2_PIN)
- #define MODEM_LED2_LOW (MODEM_LED2_PORT->BRR = MODEM_LED2_PIN)
- #define FLASH_LIGHT_HIGH (FLASH_LIGHT_PORT->BSRR = FLASH_LIGHT_PIN)
- #define FLASH_LIGHT_LOW (FLASH_LIGHT_PORT->BRR = FLASH_LIGHT_PIN)
- typedef enum {
- NotBright=0, //均不亮
- RedBright, //红灯常亮
- RedFastFlash, //红灯快闪
- RedSlowFlash, //红灯慢闪
- BlueBright, //蓝灯常亮
- BlueFastFlash, //蓝灯快闪
- BlueSlowFlash, //蓝灯慢闪
- RedBlueBright, //红蓝常亮
- RedBlueFastFlash, //红蓝快闪
- RedBlueSlowFlash //红蓝慢闪
- }LED_STATUS;
- typedef enum{
- IndModemErr=0, //模块错误
- IndNoNet, //无网络
- IndStandby, //待机
- IndRX, //接收
- IndTX //发送
- }LED_INDICATOR;
- extern LED_INDICATOR g_LedInd;
- extern unsigned char sucRedLedFlash;
- extern unsigned char sucRedLedSleep;
- void LedInit(void);
- void LedProcess(unsigned char reset);
- void SetLedIndicator(LED_INDICATOR LedInd);
- void SetLedStatus(LED_STATUS LedStatus);
- #endif
|