#ifndef __hal_led_h__ #define __hal_led_h__ #include #include #include #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_PAIR, //匹配完成灯 LED_EXCEPT, //故障灯 LED_RESTART, //重启亮灯 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