WS2812/SK6812 RGB LED Driver. More...
WS2812/SK6812 RGB LED Driver.
Definition in file ws281x.h.
#include <stdint.h>
#include "color.h"
#include "periph/gpio.h"
#include "ws281x_backend.h"
#include "ws281x_constants.h"
#include "xtimer.h"
Go to the source code of this file.
Data Structures | |
struct | ws281x_params_t |
Struct to hold initialization parameters for a WS281x RGB LED. More... | |
struct | ws281x_t |
Device descriptor of a WS281x RGB LED chain. More... | |
Macros | |
#define | WS281X_BYTES_PER_DEVICE (3U) |
The number of bytes to allocate in the data buffer per LED. | |
Functions | |
int | ws281x_init (ws281x_t *dev, const ws281x_params_t *params) |
Initialize an WS281x RGB LED chain. More... | |
void | ws281x_write_buffer (ws281x_t *dev, const void *buf, size_t size) |
Writes the color data of the user supplied buffer. More... | |
void | ws281x_prepare_transmission (ws281x_t *dev) |
Sets up everything needed to write data to the WS281X LED chain. More... | |
void | ws281x_end_transmission (ws281x_t *dev) |
Ends the transmission to the WS2812/SK6812 LED chain. More... | |
void | ws281x_set_buffer (void *dest, uint16_t index, color_rgb_t color) |
Sets the color of an LED in the given data buffer. More... | |
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. More... | |
static void | ws281x_write (ws281x_t *dev) |
Writes the internal buffer to the LED chain. More... | |