diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2025-09-30 13:06:16 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2025-09-30 13:06:16 -0600 |
| commit | 290d784950b6248782b049cd9831bd6e034fd538 (patch) | |
| tree | c231c02e92ed83a02b234a85b3c07bcc5e44b168 /include/ws2812b.h | |
| parent | f89f75b5616de99865448f41b068a2783cd3648e (diff) | |
| download | ch573-main.tar.gz ch573-main.tar.bz2 ch573-main.zip | |
Add many different patterns, and organize it.
Add a voltage discovery subsystem to allow the ch573 to detect if it's
on 12v or 5v lights.
Diffstat (limited to 'include/ws2812b.h')
| -rw-r--r-- | include/ws2812b.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/ws2812b.h b/include/ws2812b.h index 2061379..6f8aff0 100644 --- a/include/ws2812b.h +++ b/include/ws2812b.h @@ -45,11 +45,23 @@ typedef struct { uint8_t r; uint8_t g; uint8_t b; + + /* Color alpha. 0 is perfectly opaque, 255 is perfectly transparent). */ + uint8_t a; }; uint32_t color; }; } rgb_t; +typedef struct { + uint8_t mat[4][4]; +} rgb_mat_t; + +/** Returns the new RGB as if rgb1 was overlayed on top of rgb2. */ +rgb_t blend(rgb_t rgb1, rgb_t rgb2); + +rgb_t mat_mul(rgb_t rgb, const rgb_mat_t* mat); + int write_rgb(struct ws2812b_buf* out, rgb_t color); void start_dma(struct ws2812b_buf* buf); |