From fd674424d19cf12c1186394606729cff236d5bdf Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 28 Nov 2020 23:21:22 -0700 Subject: Some LED lights working. Not great. WIP --- include/drv/ws2812B/ws2812b.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/drv/ws2812B/ws2812b.h (limited to 'include/drv') 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_ */ -- cgit