aboutsummaryrefslogtreecommitdiff
path: root/include/drv/ws2812B
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2020-11-28 23:21:22 -0700
committerJosh Rahm <joshuarahm@gmail.com>2020-11-28 23:21:22 -0700
commitfd674424d19cf12c1186394606729cff236d5bdf (patch)
tree5ecd05faa96a32dbf86a94cec191954c14f1cb0f /include/drv/ws2812B
parent654511788e24794c03ecb810a3b5907e95b8b55c (diff)
downloadstm32l4-fd674424d19cf12c1186394606729cff236d5bdf.tar.gz
stm32l4-fd674424d19cf12c1186394606729cff236d5bdf.tar.bz2
stm32l4-fd674424d19cf12c1186394606729cff236d5bdf.zip
Some LED lights working. Not great. WIP
Diffstat (limited to 'include/drv/ws2812B')
-rw-r--r--include/drv/ws2812B/ws2812b.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/drv/ws2812B/ws2812b.h b/include/drv/ws2812B/ws2812b.h
new file mode 100644
index 0000000..cdbb41a
--- /dev/null
+++ b/include/drv/ws2812B/ws2812b.h
@@ -0,0 +1,18 @@
+#ifndef WS2812B_H_
+#define WS2812B_H_
+
+#include "kern/common.h"
+
+typedef struct {
+ /* why is it out of order? Don't know! That's the way the hardware was
+ * designed! */
+ uint8_t g;
+ uint8_t r;
+ uint8_t b;
+} PACKED rgb_t;
+
+static_assert(sizeof(rgb_t) == 3, "Sizeof rgb_t should be 3.");
+
+uint8_t* ws2812b_compile_rgb(rgb_t* out, size_t arr_len);
+
+#endif /* WS2812B_H_ */