hal_led.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. #define COLOR_BLACK 0xFF000000
  29. #define COLOR_WHITE 0xFFFFFFFF
  30. #define COLOR_RED 0xFFFF0000
  31. #define COLOR_LIGHRED 0xFF070000
  32. #define COLOR_GREEN 0xFF007F00
  33. #define COLOR_BLUE 0xFF0000FF
  34. #define COLOR_ORANGE 0xFF6F1000
  35. #define COLOR_PURPLE 0xFFFF00FF
  36. #define COLOR_YELLOW 0xFFFFFF00
  37. #define COLOR_CYAN 0xFF000707
  38. ////显示优先级 0~250
  39. //enum {
  40. // LED_PRIO_NONE = 0, //保留
  41. // LED_PRIO_OVERTURN, //翻转显示电量
  42. // LED_PRIO_CHARGE, //充电显示电量
  43. //
  44. //};
  45. //显示优先级 0~250
  46. enum {
  47. LED_NONE = 0, //保留
  48. LED_RUN, //测试灯
  49. LED_CHARGE, //充电显示电量
  50. LED_OVERTURN, //翻转显示电量
  51. LED_CONNECT, //连接完成灯
  52. LED_CONFIG, //匹配完成灯
  53. LED_SELF_CHECK, //自检灯
  54. LED_EXCEPT, //故障灯
  55. LED_NUM_OF_LED, //LED成员变量
  56. };
  57. void LED_Init(void);
  58. void LED_Stop(uint8_t n);
  59. void LED_Start(uint8_t n,uint32_t color);
  60. void LED_Close_Enforce(void);
  61. void LED_SetColor(uint8_t n,uint32_t color);
  62. #endif