FastLED 3.9.15
Loading...
Searching...
No Matches
sm16716.h
Go to the documentation of this file.
1#pragma once
2
15
16#include "fl/stl/stdint.h"
17#include "fl/stl/array.h"
19#include "fl/stl/noexcept.h"
20
21namespace fl {
22
31template <typename InputIterator, typename OutputIterator>
32void encodeSM16716(InputIterator first, InputIterator last, OutputIterator out) FL_NOEXCEPT {
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}
48
49} // namespace fl
A fixed-size array implementation similar to std::array.
Definition array.h:27
Constants for SPI chipset encoders.
void encodeSM16716(InputIterator first, InputIterator last, OutputIterator out) FL_NOEXCEPT
Encode pixel data in SM16716 format.
Definition sm16716.h:32
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT