123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #ifndef __hal_led_h__
- #define __hal_led_h__
- #include <stdbool.h>
- #include <stdint.h>
- #include <string.h>
- #include "sdk_common.h"
- #include "SEGGER_RTT.h"
- #include "usr_config.h"
- //ARGB
- //#define COLOR_BLACK 0xFF000000
- //#define COLOR_WHITE 0xFF070707
- //#define COLOR_RED 0xFF070000
- //#define COLOR_GREEN 0xFF000700
- //#define COLOR_BLUE 0xFF000007
- //#define COLOR_ORANGE 0xFF070300
- //#define COLOR_PURPLE 0xFF070007
- //#define COLOR_YELLOW 0xFF070700
- //#define COLOR_CYAN 0xFF000707
- //#define COLOR_BLACK 0xFF000000
- //#define COLOR_WHITE 0xFFFFFFFF
- //#define COLOR_RED 0xFFFF0000
- //#define COLOR_GREEN 0xFF00FF00
- //#define COLOR_BLUE 0xFF0000FF
- //#define COLOR_ORANGE 0xFFFF6000
- //#define COLOR_PURPLE 0xFFFF00FF
- //#define COLOR_YELLOW 0xFFFFFF00
- //#define COLOR_CYAN 0xFF00FFFF
- //#define COLOR_BLACK 0xFF000000
- //#define COLOR_LOWWHITE 0x0F0F0F0F
- //#define COLOR_WHITE 0x2F2F2F2F
- //#define COLOR_RED 0xFFFF0000
- //#define COLOR_LIGHRED 0xFF070000
- //#define COLOR_GREEN 0xFF007F00
- //#define COLOR_BLUE 0xFF0000FF
- //#define COLOR_ORANGE 0xFF6F1000
- //#define COLOR_PURPLE 0xFFFF00FF
- //#define COLOR_YELLOW 0xFFFFFF00
- //#define COLOR_CYAN 0xFF000707
- //#define COLOR_BLACK 0xFF000000
- //#define COLOR_LOWWHITE 0x0F0F0F0F
- //#define COLOR_WHITE 0xFF0E0E0E
- //#define COLOR_RED 0xFF2F0000
- //#define COLOR_GREEN 0xFF002F00
- //#define COLOR_BLUE 0xFF00002F
- //#define COLOR_ORANGE 0xFF1F1000
- //#define COLOR_PURPLE 0xFF2F002F
- //#define COLOR_YELLOW 0xFF5F5F00
- //#define COLOR_CYAN 0xFF005F5F
- #define COLOR_BLACK 0xFF000000
- #define COLOR_LOWWHITE 0x0F0F0F0F
- #define COLOR_WHITE 0xFF1F1F1F
- #define COLOR_RED 0xFF6F0000
- #define COLOR_GREEN 0xFF009F00
- #define COLOR_BLUE 0xFF0000AF
- #define COLOR_ORANGE 0xFF3F1000
- #define COLOR_PURPLE 0xFF9F009F
- #define COLOR_YELLOW 0xFF7F7F00
- #define COLOR_CYAN 0xFF005F5F
- #define LED_ENABLE 0
- #define LED_DISABLE 1
- ////显示优先级 0~250
- //enum {
- // LED_PRIO_NONE = 0, //保留
- // LED_PRIO_OVERTURN, //翻转显示电量
- // LED_PRIO_CHARGE, //充电显示电量
- //
- //};
- //显示优先级 0~250
- enum {
- LED_NONE = 0, //保留
- LED_RUN, //测试灯
- LED_CONNECT, //连接完成灯
- LED_SELF_CHECK, //自检灯
- LED_OVERTURN, //翻转显示电量
- LED_CHARGE, //充电显示电量
- // LED_SCAN, //扫描连接灯
- LED_LRCHECK, //左右鞋区分灯
- LED_PAIR, //匹配完成灯
- LED_ONPURPLE, //常亮紫色灯
- LED_EXCEPT, //故障灯
- LED_NUM_OF_LED, //LED成员变量
- };
- void LED_Init(void);
- void LED_Stop(uint8_t n);
- void LED_Start(uint8_t n,uint32_t color);
- void LED_Close_Enforce(void);
- void LED_SetColor(uint8_t n,uint32_t color);
- void WS2812_DisplayDot(uint32_t col);
- void WS2812_Pwm_Play(void);
- #endif
|