FastLED 3.9.15
Loading...
Searching...
No Matches

◆ encodeSM16716()

template<typename InputIterator, typename OutputIterator>
void fl::encodeSM16716 ( InputIterator first,
InputIterator last,
OutputIterator out )

Encode pixel data in SM16716 format.

Template Parameters
InputIteratorIterator yielding fl::array<u8, 3> (3 bytes in wire order)
OutputIteratorOutput iterator accepting uint8_t
Parameters
firstIterator to first pixel
lastIterator past last pixel
outOutput iterator for encoded bytes
Note
Start bit handling is assumed to be done by SPI hardware
SM16716 uses RGB wire order: pixel[0]=Red, pixel[1]=Green, pixel[2]=Blue

Definition at line 32 of file sm16716.h.

32 {
33 // LED data: RGB bytes
34 // (Start bit for each triplet is handled by SPI hardware layer)
35 while (first != last) {
36 const fl::array<u8, BYTES_PER_PIXEL_RGB>& pixel = *first;
37 *out++ = pixel[0]; // Index 0 (RGB order: Red)
38 *out++ = pixel[1]; // Index 1 (RGB order: Green)
39 *out++ = pixel[2]; // Index 2 (RGB order: Blue)
40 ++first;
41 }
42
43 // Header: 50 zero bits (7 bytes of 0x00)
44 for (int i = 0; i < 7; i++) {
45 *out++ = 0x00;
46 }
47}
A fixed-size array implementation similar to std::array.
Definition array.h:27

References FL_NOEXCEPT.

Referenced by fl::PixelIterator::writeSM16716().

+ Here is the caller graph for this function: