ws2812.h 796 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef APP_MODULES_WS2812_H_
  2. #define APP_MODULES_WS2812_H_
  3. #include "module.h"
  4. #include "lauxlib.h"
  5. #include "lmem.h"
  6. #include "platform.h"
  7. #include "c_stdlib.h"
  8. #include "c_math.h"
  9. #include "c_string.h"
  10. #include "user_interface.h"
  11. #include "driver/uart.h"
  12. #include "osapi.h"
  13. #define FADE_IN 1
  14. #define FADE_OUT 0
  15. #define SHIFT_LOGICAL 0
  16. #define SHIFT_CIRCULAR 1
  17. typedef struct {
  18. int size;
  19. uint8_t colorsPerLed;
  20. uint8_t values[0];
  21. } ws2812_buffer;
  22. void ICACHE_RAM_ATTR ws2812_write_data(const uint8_t *pixels, uint32_t length, const uint8_t *pixels2, uint32_t length2);
  23. int ws2812_buffer_shift(ws2812_buffer * buffer, int shiftValue, unsigned shift_type, int pos_start, int pos_end);
  24. int ws2812_buffer_fill(ws2812_buffer * buffer, int * colors);
  25. #endif /* APP_MODULES_WS2812_H_ */