Tiny-WS2812  1.0.0
A tiny cross-platform WS2812 LED Strip driver
ws2812_cpp.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 
29 #ifdef __cplusplus
30 
31 extern "C" {
32 
33 #include <ws2812.h>
34 
35 }
36 
45 class ws2812_cpp {
46 public:
47 
56  ws2812_cpp(ws2812_cfg *cfg, uint8_t *ret);
57 
58 private:
59  ws2812 _ws2812;
60 
61 public:
66  void prep_tx();
67 
72  void tx(ws2812_rgb *leds, size_t n_leds);
73 
74 
79  void wait_rst();
80 
81 
86  void close_tx();
87 };
88 
89 #endif // __cplusplus
ALL PLATFORMS: Data structure to configure a WS2812 device struct.
Definition: ws2812_avr.h:64
Data structure to hold RGB color values.
Definition: ws2812_common.h:67
ALL PLATFORMS: WS2812 device struct to drive one or more WS2812 devices.
Definition: ws2812_avr.h:107
Exposes the Tiny-WS2812 library interface.