Firmware SDK
twr_ws2812b.h
1 #ifndef _TWR_WS2812B_H
2 #define _TWR_WS2812B_H
3 
4 #include <twr_led_strip.h>
5 
9 
11 
12 typedef enum
13 {
14  TWR_WS2812B_SEND_DONE = 0,
15 
16 } twr_ws2812b_event_t;
17 
18 bool twr_ws2812b_init(const twr_led_strip_buffer_t *led_strip);
19 
20 void twr_ws2812b_set_event_handler(void (*event_handler)(twr_ws2812b_event_t, void *), void *event_param);
21 
22 void twr_ws2812b_set_pixel_from_rgb(int position, uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
23 
24 void twr_ws2812b_set_pixel_from_uint32(int position, uint32_t color);
25 
26 void twr_ws2812b_set_pixel_from_rgb_swap_rg(int position, uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
27 
28 void twr_ws2812b_set_pixel_from_uint32_swap_rg(int position, uint32_t color);
29 
30 bool twr_ws2812b_write(void);
31 
32 bool twr_ws2812b_is_ready(void);
33 
35 
36 #endif // _TWR_WS2812B_H