hal_led.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_CONNECT, //连接完成灯
  50. LED_CONFIG, //匹配完成灯
  51. LED_SELF_CHECK, //自检灯
  52. LED_OVERTURN, //翻转显示电量
  53. LED_CHARGE, //充电显示电量
  54. LED_PAIR, //配对灯
  55. LED_EXCEPT, //故障灯
  56. LED_NUM_OF_LED, //LED成员变量
  57. };
  58. void LED_Init(void);
  59. void LED_Stop(uint8_t n);
  60. void LED_Start(uint8_t n,uint32_t color);
  61. void LED_Close_Enforce(void);
  62. void LED_SetColor(uint8_t n,uint32_t color);
  63. #endif