aboutsummaryrefslogtreecommitdiff
path: root/include/drv/ws2812B/ws2812b.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/drv/ws2812B/ws2812b.h')
-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_ */