hal_led.h.bak 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 0x0F0F0F0F
  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. #define LED_ENABLE 0
  39. #define LED_DISABLE 1
  40. ////显示优先级 0~250
  41. //enum {
  42. // LED_PRIO_NONE = 0, //保留
  43. // LED_PRIO_OVERTURN, //翻转显示电量
  44. // LED_PRIO_CHARGE, //充电显示电量
  45. //
  46. //};
  47. //显示优先级 0~250
  48. enum {
  49. LED_NONE = 0, //保留
  50. LED_RUN, //测试灯
  51. LED_CONNECT, //连接完成灯
  52. LED_SELF_CHECK, //自检灯
  53. LED_OVERTURN, //翻转显示电量
  54. LED_CHARGE, //充电显示电量
  55. LED_PAIR, //匹配完成灯
  56. LED_EXCEPT, //故障灯
  57. LED_RESTART, //重启亮灯
  58. LED_NUM_OF_LED, //LED成员变量
  59. };
  60. void LED_Init(void);
  61. void LED_Stop(uint8_t n);
  62. void LED_Start(uint8_t n,uint32_t color);
  63. void LED_Close_Enforce(void);
  64. void LED_SetColor(uint8_t n,uint32_t color);
  65. void WS2812_DisplayDot(uint32_t col);
  66. void WS2812_Pwm_Play(void);
  67. #endif