Tiny-WS2812  1.0.0
A tiny cross-platform WS2812 LED Strip driver
ws2812_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Patrick Pedersen
3 
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13 
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  *
17  */
18 
32 #pragma once
33 
44 typedef enum {
45  rgb,
46  rbg,
47  brg,
48  bgr,
49  grb,
50  gbr
51 } ws2812_order;
52 
53 #pragma pack(1)
67 typedef struct ws2812_rgb {
68  uint8_t r,g,b;
70 
71 void _ws2812_get_rgbmap(uint8_t (*rgbmap)[3], ws2812_order order);
Data structure to hold RGB color values.
Definition: ws2812_common.h:67
ws2812_order
Enum to specify the WS2812 device's color order.
Definition: ws2812_common.h:44
struct ws2812_rgb ws2812_rgb
Data structure to hold RGB color values.
void _ws2812_get_rgbmap(uint8_t(*rgbmap)[3], ws2812_order order)
Initializes a rgb map for a given color order.
Definition: ws2812_common.c:43