LedTask.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /********************************************************************************
  2. * File Name: LedTask.h
  3. * Function Describe: Header file for LedTask.c
  4. * Explain:
  5. * Writer: ShiLiangWen
  6. * Date: 2015-1-30
  7. *******************************************************************************/
  8. #ifndef __LEDTEST_H
  9. #define __LEDTEST_H
  10. /***********************************************************************************/
  11. #include <rtl.h>
  12. extern OS_TID idLedTask;
  13. #define LED_SEL_RED 0
  14. #define LED_SEL_BLUE 1
  15. #define MODEM_LED1_PIN GPIO_Pin_12
  16. #define MODEM_LED1_PORT GPIOC
  17. #define MODEM_LED2_PIN GPIO_Pin_2
  18. #define MODEM_LED2_PORT GPIOD
  19. #define KEYBOARD_BACKLIGHT_PIN GPIO_Pin_8
  20. #define KEYBOARD_BACKLIGHT_PORT GPIOB
  21. #define MODEM_LED1_HIGH (MODEM_LED1_PORT->BRR = MODEM_LED1_PIN) //S
  22. #define MODEM_LED1_LOW (MODEM_LED1_PORT->BSRR = MODEM_LED1_PIN)
  23. #define MODEM_LED2_HIGH (MODEM_LED2_PORT->BRR = MODEM_LED2_PIN)
  24. #define MODEM_LED2_LOW (MODEM_LED2_PORT->BSRR = MODEM_LED2_PIN)
  25. #define KEYBOARD_BACKLIGHT_HIGH (KEYBOARD_BACKLIGHT_PORT->BSRR = KEYBOARD_BACKLIGHT_PIN)
  26. #define KEYBOARD_BACKLIGHT_LOW (KEYBOARD_BACKLIGHT_PORT->BRR = KEYBOARD_BACKLIGHT_PIN)
  27. typedef enum {
  28. NotBright=0, //均不亮
  29. RedBright, //红灯常亮
  30. RedFastFlash, //红灯快闪
  31. RedSlowFlash, //红灯慢闪
  32. BlueBright, //蓝灯常亮
  33. BlueFastFlash, //蓝灯快闪
  34. BlueSlowFlash, //蓝灯慢闪
  35. RedBlueBright, //红蓝常亮
  36. RedBlueFastFlash, //红蓝快闪
  37. RedBlueSlowFlash //红蓝慢闪
  38. }LED_STATUS;
  39. typedef enum{
  40. IndModemErr=0, //模块错误
  41. IndNoNet, //无网络 1S 一次搜网中 绿
  42. InPowerOff, //关机ing 红 常亮
  43. InStart, //刚开机 常亮
  44. IndStandby, //待机 //正常5S
  45. IndRX, //接收
  46. IndTX, //发送
  47. InVbatLow //电量低
  48. }LED_INDICATOR;
  49. extern unsigned char sucRedLedFlash;
  50. extern unsigned char sucRedLedSleep;
  51. extern unsigned char sucBlueLedFlash;
  52. extern unsigned char sucBlueLedSleep;
  53. void SetLedStatus(LED_STATUS LedStatus);
  54. extern LED_INDICATOR g_LedInd;
  55. void SetLedIndicator(LED_INDICATOR);
  56. void LedInit(void);
  57. __task void LedTask(void);
  58. void LedProcess(unsigned char reset);
  59. void EnterGTProcess();
  60. #endif
  61. /***********************************************************************************/