aboutsummaryrefslogtreecommitdiff
path: root/include/ws2812b_writer.h
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2021-12-01 00:34:18 -0700
committerJosh Rahm <joshuarahm@gmail.com>2021-12-01 00:34:18 -0700
commitb1ca00800f34ab86c0a99c46796c73a8028157ff (patch)
tree60b90da71bf12c034ecec08eced9f07d825ad92a /include/ws2812b_writer.h
parentd89195e2144df51ca02a860f4b46fd38b4dfeb29 (diff)
downloadesp32-ws2812b-b1ca00800f34ab86c0a99c46796c73a8028157ff.tar.gz
esp32-ws2812b-b1ca00800f34ab86c0a99c46796c73a8028157ff.tar.bz2
esp32-ws2812b-b1ca00800f34ab86c0a99c46796c73a8028157ff.zip
Port the code from my STM project over to ESP32.
There is still definitely some jenk to it. For one I still need to figure out how to protect critical sections to prevent stutter. I do need to set up a timer to control the time incrementer rather than depending on the speed of the spi bus.
Diffstat (limited to 'include/ws2812b_writer.h')
-rw-r--r--include/ws2812b_writer.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/ws2812b_writer.h b/include/ws2812b_writer.h
index 0679059..2252230 100644
--- a/include/ws2812b_writer.h
+++ b/include/ws2812b_writer.h
@@ -7,10 +7,24 @@
#include "freertos/task.h"
typedef struct {
- char color[32];
ws2812b_t* drv;
+
+ struct {
+ uint32_t time;
+ int32_t timetick;
+ uint8_t brightness;
+ uint8_t off;
+ uint8_t n_snow;
+ uint8_t n_red;
+
+ bool sleep;
+ bool power;
+ bool cool;
+ } state;
} ws_params_t;
+void reset_parameters(ws_params_t* params);
+
portTASK_FUNCTION_PROTO(ws2812b_write_task, params);
#endif /* WS2812B_WRITER_H_ */