Go to the documentation of this file.
104 #define WS281X_BYTES_PER_DEVICE (3U)
127 #if defined(WS281X_HAVE_INIT) || defined(DOXYGEN)
176 #if defined(WS281X_HAVE_PREPARE_TRANSMISSION) || defined(DOXYGEN)
190 #if defined(WS281X_HAVE_END_TRANSMISSION) || defined(DOXYGEN)
int ws281x_init(ws281x_t *dev, const ws281x_params_t *params)
Initialize an WS281x RGB LED chain.
void ws281x_prepare_transmission(ws281x_t *dev)
Sets up everything needed to write data to the WS281X LED chain.
Device descriptor of a WS281x RGB LED chain.
ws281x_params_t params
Parameters of the LED chain.
uint8_t * buf
A statically allocated data buffer storing the state of the LEDs.
static void ws281x_write(ws281x_t *dev)
Writes the internal buffer to the LED chain.
Constants for WS2812/SK6812 RGB LEDs.
void ws281x_write_buffer(ws281x_t *dev, const void *buf, size_t size)
Writes the color data of the user supplied buffer.
uint16_t numof
Number of chained RGB LEDs.
Struct to hold initialization parameters for a WS281x RGB LED.
static void xtimer_usleep(uint32_t microseconds)
Pause the execution of a thread for some microseconds.
static void ws281x_set(ws281x_t *dev, uint16_t index, color_rgb_t color)
Sets the color of an LED in the chain in the internal buffer.
void ws281x_set_buffer(void *dest, uint16_t index, color_rgb_t color)
Sets the color of an LED in the given data buffer.
#define WS281X_BYTES_PER_DEVICE
The number of bytes to allocate in the data buffer per LED.
Low-level GPIO peripheral driver interface definitions.
gpio_t pin
GPIO connected to the data pin of the first LED.
Backend configuration for WS2812/SK6812 RGB LEDs.
Headers for the color handling module.
Data-structure describing a RGB color.
#define WS281X_T_END_US
Time in microseconds to pull the data line low to signal end of data.
xtimer interface definitions
void ws281x_end_transmission(ws281x_t *dev)
Ends the transmission to the WS2812/SK6812 LED chain.