Led.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #define WARN_LED1_PIN GPIO_Pin_13 //警示灯1
  12. #define WARN_LED2_PIN GPIO_Pin_14 //警示灯2
  13. #define WARN_LED3_PIN GPIO_Pin_15 //警示灯3
  14. #define WARN_BEEP_PIN GPIO_Pin_0 //蜂鸣器
  15. #define MODEM_LED4_PIN GPIO_Pin_1
  16. #define WARN_LED1_PORT GPIOC
  17. #define WARN_LED2_PORT GPIOC
  18. #define WARN_LED3_PORT GPIOC
  19. #define WARN_BEEP_PORT GPIOB
  20. #define MODEM_LED4_PORT GPIOB
  21. #define WARN_LED1_HIGH (WARN_LED1_PORT->BSRR = WARN_LED1_PIN)
  22. #define WARN_LED1_LOW (WARN_LED1_PORT->BRR = WARN_LED1_PIN)
  23. #define WARN_LED2_HIGH (WARN_LED2_PORT->BSRR = WARN_LED2_PIN)
  24. #define WARN_LED2_LOW (WARN_LED2_PORT->BRR = WARN_LED2_PIN)
  25. #define WARN_LED3_HIGH (WARN_LED3_PORT->BSRR = WARN_LED3_PIN)
  26. #define WARN_LED3_LOW (WARN_LED3_PORT->BRR = WARN_LED3_PIN)
  27. #define WARN_BEEP_HIGH (WARN_BEEP_PORT->BSRR = WARN_BEEP_PIN)
  28. #define WARN_BEEP_LOW (WARN_BEEP_PORT->BRR = WARN_BEEP_PIN)
  29. #define MODEM_LED4_HIGH (MODEM_LED4_PORT->BSRR = MODEM_LED4_PIN)
  30. #define MODEM_LED4_LOW (MODEM_LED4_PORT->BRR = MODEM_LED4_PIN)
  31. typedef enum {
  32. NotBright=0, //不亮
  33. Bright, //常亮
  34. Flash, //均衡闪烁
  35. OneFlashSlow, //每周期闪烁1次,慢周期约9.2S
  36. TowFlashSlow, //每周期闪烁2次,慢周期约9.2S
  37. ThreeFlashSlow, //每周期闪烁3次,慢周期约9.2S
  38. OneFlashFast, //每周期闪烁1次,快周期约3.2S
  39. TowFlashFast, //每周期闪烁2次,快周期约3.2S
  40. ThreeFlashFast, //每周期闪烁3次,快周期约3.2S
  41. }LED_STATUS;
  42. void LedInit(void);
  43. void LedProcess(unsigned char reset);
  44. void SetLedStatus(unsigned char LED,LED_STATUS LedStatus);
  45. void SetLedIndicator(void);
  46. #endif
  47. /***********************************************************************************/