FastLED 3.10.6
Loading...
Searching...
No Matches
tm1908.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "fl/stl/noexcept.h"
7#include "fl/stl/stdint.h"
8
9namespace fl {
10
17template <typename InputIterator, typename OutputIterator>
18void encodeTM1908(InputIterator first, InputIterator last,
19 OutputIterator out) FL_NO_EXCEPT {
20 const u8 prefix[] = {
21 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, // normal-mode command
22 0x7f, 0x7f, 0x7f, // 25 mA R/G/B current
23 };
24 for (u8 byte : prefix) {
25 *out++ = byte;
26 }
27
28 while (first != last) {
29 const auto& pixel = *first;
30 *out++ = pixel[0];
31 *out++ = pixel[1];
32 *out++ = pixel[2];
33 ++first;
34 }
35}
36
37} // namespace fl
uint8_t byte
Definition midi_Defs.h:36
unsigned char u8
Definition stdint.h:131
void encodeTM1908(InputIterator first, InputIterator last, OutputIterator out) FL_NO_EXCEPT
Encode one complete TM1908 frame.
Definition tm1908.h:18
InputGamut g FL_NO_EXCEPT
Definition rgbw.h:121
Base definition for an LED controller.
Definition crgb.hpp:179