1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef __hal_ws2812_h__
- #define __hal_ws2812_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 WS2812_COLOR_BLACK 0xFF000000
- #define WS2812_COLOR_WHITE 0xFFFFFFFF
- #define WS2812_COLOR_RED 0xFFFF0000
- #define WS2812_COLOR_GREEN 0xFF00FF00
- #define WS2812_COLOR_BLUE 0xFF0000FF
- #define WS2812_COLOR_ORANGE 0xFFff3f00
- #define WS2812_COLOR_PURPLE 0xFFFF00FF
- #define WS2812_COLOR_YELLOW 0xFFFFFF00
- #define WS2812_COLOR_CYAN 0xFF00FFFF
- ////显示优先级 0~250
- //enum {
- // LED_PRIO_NONE = 0, //保留
- // LED_PRIO_OVERTURN, //翻转显示电量
- // LED_PRIO_CHARGE, //充电显示电量
- //
- //};
- //显示优先级 0~250
- enum {
- WS2812_NONE = 0, //保留
- #if DEBUG_LEDRUN
- WS2812_TEST, //测试灯
- #endif
- MEMBER_NUM_OF_WS2812, //LED成员数量
- };
- void WS2812_Initialize(void);
- void WS2812_Start(uint8_t n,uint32_t color);
- void WS2812_Resum(uint8_t n);
- void WS2812_Stop(uint8_t n);
- void WS2812_SetColor(uint8_t n,uint32_t color);
- #endif
|