|
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Go to the documentation of this file.
19 #if defined(__cplusplus)
24 #define TYPE_GRB 1 // for WS2812 and WS2812B
26 #define COLOR(r, g, b) (((r) << 16) | ((g) << 8) | (b))
27 #define SCALE(x, l) ((x) * (l) / 255)
28 #define COLORX(r, g, b, l) ((SCALE(r, l) << 16) | (SCALE(g, l) << 8) | SCALE(b, l))
31 #define COLOR_BLACK 0x000000
32 #define COLOR_RED 0xFF0000
33 #define COLOR_GREEN 0x00FF00
34 #define COLOR_BLUE 0x0000FF
35 #define COLOR_WHITE 0xFFFFFF
36 #define COLOR_CYAN 0x00FFFF
37 #define COLOR_MAGENTA 0xFF00FF
38 #define COLOR_YELLOW 0xFFFF00
39 #define COLOR_CHARTREUSE 0x7FFF00
40 #define COLOR_ORANGE 0xFF6000
41 #define COLOR_AQUAMARINE 0x7FFFD4
42 #define COLOR_PINK 0xFF5F5F
43 #define COLOR_TURQUOISE 0x3FE0C0
44 #define COLOR_REALWHITE 0xC8FFFF
45 #define COLOR_INDIGO 0x3F007F
46 #define COLOR_VIOLET 0xBF7FBF
47 #define COLOR_MAROON 0x320010
48 #define COLOR_BROWN 0x0E0600
49 #define COLOR_CRIMSON 0xDC283C
50 #define COLOR_PURPLE 0x8C00FF
54 volatile uint32_t command;
149 #if defined(__cplusplus)
uint32_t ws2812_wheel_dim(int pos, int brightness)
Create color from a 0 to 255 position input.
int ws2812b_start(ws2812_t *driver)
Start a driver for WS2812B chips.
uint32_t ws2812_wheel(int pos)
Create color from a 0 to 255 position input.
void ws2812_stop(ws2812_t *driver)
Shut down the COG running a driver.
int ws2812_start(ws2812_t *driver)
Start a driver for WS2812 chips.
ws2812_t * ws2812_open(void)
Open a driver for WS2812 chips.
void ws2812_set(ws2812_t *driver, int pin, uint32_t *colors, int count)
Set color pattern on a chain of LEDs.
int ws_start(ws2812_t *driver, int usreset, int ns0h, int ns0l, int ns1h, int ns1l, int type)
Load a COG with a driver using custom parameters.
void ws2812_close(ws2812_t *driver)
Close a WS2812 or WS2812B driver.
ws2812_t * ws2812b_open(void)
Open a driver for WS2812B chips.