Led.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 LED1_PIN GPIO_Pin_13
  12. #define LED2_PIN GPIO_Pin_8
  13. #define LED3_PIN GPIO_Pin_9
  14. #define LED4_PIN GPIO_Pin_14
  15. #define MODEM_LED1_PORT GPIOC
  16. #define MODEM_LED2_PORT GPIOB
  17. #define MODEM_LED3_PORT GPIOB
  18. #define MODEM_LED4_PORT GPIOC
  19. #define MODEM_LED1_HIGH (MODEM_LED1_PORT->BSRR = LED1_PIN)
  20. #define MODEM_LED1_LOW (MODEM_LED1_PORT->BRR = LED1_PIN)
  21. #define MODEM_LED2_HIGH (MODEM_LED2_PORT->BSRR = LED2_PIN)
  22. #define MODEM_LED2_LOW (MODEM_LED2_PORT->BRR = LED2_PIN)
  23. #define MODEM_LED3_HIGH (MODEM_LED3_PORT->BSRR = LED3_PIN)
  24. #define MODEM_LED3_LOW (MODEM_LED3_PORT->BRR = LED3_PIN)
  25. #define MODEM_LED4_HIGH (MODEM_LED4_PORT->BSRR = LED4_PIN)
  26. #define MODEM_LED4_LOW (MODEM_LED4_PORT->BRR = LED4_PIN)
  27. typedef enum {
  28. NotBright=0, //不亮
  29. Bright, //常亮
  30. Flash, //均衡闪烁
  31. OneFlashSlow, //每周期闪烁1次,慢周期约9.2S
  32. TowFlashSlow, //每周期闪烁2次,慢周期约9.2S
  33. ThreeFlashSlow, //每周期闪烁3次,慢周期约9.2S
  34. OneFlashFast, //每周期闪烁1次,快周期约3.2S
  35. TowFlashFast, //每周期闪烁2次,快周期约3.2S
  36. ThreeFlashFast, //每周期闪烁3次,快周期约3.2S
  37. }LED_STATUS;
  38. void LedInit(void);
  39. void LedProcess(unsigned char reset);
  40. void SetLedStatus(unsigned char LED,LED_STATUS LedStatus);
  41. void SetLedIndicator(void);
  42. #endif
  43. /***********************************************************************************/