Led.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. typedef enum {
  16. NotBright=0, //均不亮
  17. RedBright, //红灯常亮
  18. RedFastFlash, //红灯快闪
  19. RedSlowFlash, //红灯慢闪
  20. BlueBright, //蓝灯常亮
  21. BlueFastFlash, //蓝灯快闪
  22. BlueSlowFlash, //蓝灯慢闪
  23. RedBlueBright, //红蓝常亮
  24. RedBlueFastFlash, //红蓝快闪
  25. RedBlueSlowFlash //红蓝慢闪
  26. }LED_STATUS;
  27. typedef enum{
  28. IndModemErr=0, //模块错误
  29. IndNoNet, //无网络
  30. IndStandby, //待机
  31. IndRX, //接收
  32. IndTX //发送
  33. }LED_INDICATOR;
  34. extern LED_INDICATOR g_LedInd;
  35. extern unsigned char sucRedLedFlash;
  36. extern unsigned char sucRedLedSleep;
  37. void LedInit(void);
  38. void LedProcess(unsigned char reset);
  39. void SetLedIndicator(LED_INDICATOR LedInd);
  40. void SetLedStatus(LED_STATUS LedStatus);
  41. #endif