ws2812.h 657 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * LEDDriver.h
  3. *
  4. * Created on: Aug 26, 2013
  5. * Author: Omri Iluz
  6. */
  7. #ifndef WS2812_H_
  8. #define WS2812_H_
  9. #include "hal.h"
  10. #include "rgblight_types.h"
  11. #define sign(x) (( x > 0 ) - ( x < 0 ))
  12. typedef struct Color Color;
  13. struct Color {
  14. uint8_t R;
  15. uint8_t G;
  16. uint8_t B;
  17. };
  18. void ledDriverInit(int leds, stm32_gpio_t *port, uint32_t mask, uint8_t **o_fb);
  19. void setColorRGB(Color c, uint8_t *buf, uint32_t mask);
  20. void testPatternFB(uint8_t *fb);
  21. void ledDriverWaitCycle(void);
  22. void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
  23. void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
  24. #endif /* LEDDRIVER_H_ */