qmk_firmware/drivers/arm/ws2812.h

32 lines
657 B
C
Raw Normal View History

2018-05-23 05:54:43 +00:00
/*
* LEDDriver.h
2018-05-18 05:32:24 +00:00
*
2018-05-23 05:54:43 +00:00
* Created on: Aug 26, 2013
* Author: Omri Iluz
2018-05-18 05:32:24 +00:00
*/
#ifndef WS2812_H_
#define WS2812_H_
2018-05-23 05:54:43 +00:00
#include "hal.h"
2018-05-18 05:32:24 +00:00
#include "rgblight_types.h"
2018-05-23 05:54:43 +00:00
#define sign(x) (( x > 0 ) - ( x < 0 ))
2018-05-18 05:32:24 +00:00
2018-05-23 05:54:43 +00:00
typedef struct Color Color;
struct Color {
uint8_t R;
uint8_t G;
uint8_t B;
};
2018-05-18 05:32:24 +00:00
2018-05-23 05:54:43 +00:00
void ledDriverInit(int leds, stm32_gpio_t *port, uint32_t mask, uint8_t **o_fb);
void setColorRGB(Color c, uint8_t *buf, uint32_t mask);
void testPatternFB(uint8_t *fb);
void ledDriverWaitCycle(void);
2018-05-18 05:32:24 +00:00
void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
2018-05-23 05:54:43 +00:00
#endif /* LEDDRIVER_H_ */