blob: 5ae41aafc4273e720633993dde8909f056d9acbb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#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);
/* Returns round(sin(2πn / 256) * 127.5 + 127.5). */
uint8_t byte_sin(uint8_t n);
#endif /* WS2812B_H_ */
|