Tiny-WS2812
1.0.0
A tiny cross-platform WS2812 LED Strip driver
|
Definitions required by all platform specific headers. More...
Go to the source code of this file.
Classes | |
struct | ws2812_rgb |
Data structure to hold RGB color values. More... | |
Typedefs | |
typedef struct ws2812_rgb | ws2812_rgb |
Data structure to hold RGB color values. More... | |
Enumerations | |
enum | ws2812_order { rgb , rbg , brg , bgr , grb , gbr } |
Enum to specify the WS2812 device's color order. More... | |
Functions | |
void | _ws2812_get_rgbmap (uint8_t(*rgbmap)[3], ws2812_order order) |
Initializes a rgb map for a given color order. More... | |
Definitions required by all platform specific headers.
The following header features platform independent definitions, such as typedefs, enums and structs, that are used across all platorm specific headers.
Definition in file ws2812_common.h.
typedef struct ws2812_rgb ws2812_rgb |
Data structure to hold RGB color values.
The RGB struct holds the red, green and blue values to define colors. It is used by the ws2812_tx() function to set the color of one or more WS2812 LEDs.
enum ws2812_order |
Enum to specify the WS2812 device's color order.
Unfortunately there is no clear standard on sequential color order of WS2812 LEDs, some are intuitively programmed in RGB order, however, many, if not the majority, are programmed in GRB oder. As there is automatic way to identify the correct color order, it must be manually provided in the device configuration with this enum.
Definition at line 44 of file ws2812_common.h.
void _ws2812_get_rgbmap | ( | uint8_t(*) | rgbmap[3], |
ws2812_order | order | ||
) |
Initializes a rgb map for a given color order.
The following function is intended only to be used for internal library code, hence the _ prefix. It fills a 3 element byte array with the necessary offsets to map/convert RGB values to a different color order. For example, setting the order to rgb
fills the rgb map with 0, 1, 2
and bgr
fill the rgb map with 2, 1, 0
, etc.
Definition at line 43 of file ws2812_common.c.