LedTask.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_4
  16. #define MODEM_LED2_PIN GPIO_Pin_6
  17. #define MODEM_LED1_PORT GPIOB
  18. #define MODEM_LED2_PORT GPIOB
  19. #define MODEM_LED1_HIGH (MODEM_LED1_PORT->BSRR = MODEM_LED1_PIN)
  20. #define MODEM_LED1_LOW (MODEM_LED1_PORT->BRR = MODEM_LED1_PIN)
  21. #define MODEM_LED2_HIGH (MODEM_LED2_PORT->BSRR = MODEM_LED2_PIN)
  22. #define MODEM_LED2_LOW (MODEM_LED2_PORT->BRR = MODEM_LED2_PIN)
  23. typedef enum {
  24. NotBright=0, //均不亮
  25. RedBright, //红灯常亮
  26. RedFastFlash, //红灯快闪
  27. RedSlowFlash, //红灯慢闪
  28. BlueBright, //蓝灯常亮
  29. BlueFastFlash, //蓝灯快闪
  30. BlueSlowFlash, //蓝灯慢闪
  31. RedBlueBright, //红蓝常亮
  32. RedBlueFastFlash, //红蓝快闪
  33. RedBlueSlowFlash //红蓝慢闪
  34. }LED_STATUS;
  35. typedef enum{
  36. IndModemErr=0, //模块错误
  37. IndNoNet, //无网络
  38. IndStandby, //待机
  39. IndRX, //接收
  40. IndTX, //发送
  41. IndReboot //提示重启
  42. }LED_INDICATOR;
  43. void SetLedStatus(LED_STATUS LedStatus);
  44. extern LED_INDICATOR g_LedInd;
  45. void SetLedIndicator(LED_INDICATOR);
  46. void LedInit(void);
  47. __task void LedTask(void);
  48. void LedProcess(unsigned char reset);
  49. #endif
  50. /***********************************************************************************/