Led.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __LED_H_
  2. #define __LED_H_
  3. #define LED_SEL_RED 0
  4. #define LED_SEL_BLUE 1
  5. #define MODEM_LED1_PIN GPIO_Pin_6
  6. #define MODEM_LED1_PORT GPIOB
  7. #define MODEM_LED2_PIN GPIO_Pin_7
  8. #define MODEM_LED2_PORT GPIOB
  9. #define FLASH_LIGHT_PIN GPIO_Pin_8
  10. #define FLASH_LIGHT_PORT GPIOA
  11. #define MODEM_LED1_HIGH (MODEM_LED1_PORT->BSRR = MODEM_LED1_PIN)
  12. #define MODEM_LED1_LOW (MODEM_LED1_PORT->BRR = MODEM_LED1_PIN)
  13. #define MODEM_LED2_HIGH (MODEM_LED2_PORT->BSRR = MODEM_LED2_PIN)
  14. #define MODEM_LED2_LOW (MODEM_LED2_PORT->BRR = MODEM_LED2_PIN)
  15. #define FLASH_LIGHT_HIGH (FLASH_LIGHT_PORT->BSRR = FLASH_LIGHT_PIN)
  16. #define FLASH_LIGHT_LOW (FLASH_LIGHT_PORT->BRR = FLASH_LIGHT_PIN)
  17. typedef enum {
  18. NotBright=0, //均不亮
  19. RedBright, //红灯常亮
  20. RedFastFlash, //红灯快闪
  21. RedSlowFlash, //红灯慢闪
  22. BlueBright, //蓝灯常亮
  23. BlueFastFlash, //蓝灯快闪
  24. BlueSlowFlash, //蓝灯慢闪
  25. RedBlueBright, //红蓝常亮
  26. RedBlueFastFlash, //红蓝快闪
  27. RedBlueSlowFlash //红蓝慢闪
  28. }LED_STATUS;
  29. typedef enum{
  30. IndModemErr=0, //模块错误
  31. IndNoNet, //无网络
  32. IndStandby, //待机
  33. IndRX, //接收
  34. IndTX //发送
  35. }LED_INDICATOR;
  36. extern LED_INDICATOR g_LedInd;
  37. extern unsigned char sucRedLedFlash;
  38. extern unsigned char sucRedLedSleep;
  39. void LedInit(void);
  40. void LedProcess(unsigned char reset);
  41. void SetLedIndicator(LED_INDICATOR LedInd);
  42. void SetLedStatus(LED_STATUS LedStatus);
  43. #endif