FastLED 3.9.15
Loading...
Searching...
No Matches
ws2801.h
Go to the documentation of this file.
1#pragma once
2
17
18#include "fl/stl/stdint.h"
19#include "fl/stl/array.h"
21#include "fl/stl/noexcept.h"
22
23namespace fl {
24
40template <typename InputIterator, typename OutputIterator>
41void encodeWS2801(InputIterator first, InputIterator last, OutputIterator out) FL_NOEXCEPT {
42 while (first != last) {
43 const array<u8, BYTES_PER_PIXEL_RGB>& pixel = *first;
44 *out++ = pixel[0]; // Index 0 (RGB order: Red)
45 *out++ = pixel[1]; // Index 1 (RGB order: Green)
46 *out++ = pixel[2]; // Index 2 (RGB order: Blue)
47 ++first;
48 }
49 // No end frame needed - WS2801 latches via timing (clock pause)
50}
51
52} // namespace fl
A fixed-size array implementation similar to std::array.
Definition array.h:27
Constants for SPI chipset encoders.
void encodeWS2801(InputIterator first, InputIterator last, OutputIterator out) FL_NOEXCEPT
Encode pixel data in WS2801/WS2803 format.
Definition ws2801.h:41
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT