hal_led.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef __hal_led_h__
  2. #define __hal_led_h__
  3. #include <stdbool.h>
  4. #include <stdint.h>
  5. #include <string.h>
  6. #include "sdk_common.h"
  7. #include "SEGGER_RTT.h"
  8. #include "usr_config.h"
  9. //ARGB
  10. #define COLOR_BLACK 0xFF000000
  11. #define COLOR_WHITE 0xFF070707
  12. #define COLOR_RED 0xFF070000
  13. #define COLOR_GREEN 0xFF000700
  14. #define COLOR_BLUE 0xFF000007
  15. #define COLOR_ORANGE 0xFF070300
  16. #define COLOR_PURPLE 0xFF070007
  17. #define COLOR_YELLOW 0xFF070700
  18. #define COLOR_CYAN 0xFF000707
  19. //#define COLOR_BLACK 0xFF000000
  20. //#define COLOR_WHITE 0xFFFFFFFF
  21. //#define COLOR_RED 0xFFFF0000
  22. //#define COLOR_GREEN 0xFF00FF00
  23. //#define COLOR_BLUE 0xFF0000FF
  24. //#define COLOR_ORANGE 0xFFFF6000
  25. //#define COLOR_PURPLE 0xFFFF00FF
  26. //#define COLOR_YELLOW 0xFFFFFF00
  27. //#define COLOR_CYAN 0xFF00FFFF
  28. ////显示优先级 0~250
  29. //enum {
  30. // LED_PRIO_NONE = 0, //保留
  31. // LED_PRIO_OVERTURN, //翻转显示电量
  32. // LED_PRIO_CHARGE, //充电显示电量
  33. //
  34. //};
  35. //显示优先级 0~250
  36. enum {
  37. LED_NONE = 0, //保留
  38. LED_RUN, //测试灯
  39. LED_CHARGE, //充电显示电量
  40. LED_OVERTURN, //翻转显示电量
  41. LED_CONNECT, //连接完成灯
  42. LED_CONFIG, //匹配完成灯
  43. LED_EXCEPT, //故障灯
  44. LED_SELF_CHECK, //自检灯
  45. MEMBER_NUM_OF_LED, //LED成员变量
  46. };
  47. void LED_Init(void);
  48. void LED_Stop(uint8_t n);
  49. void LED_Start(uint8_t n,uint32_t color);
  50. void LED_Close_Enforce(void);
  51. #endif