FastLED 3.10.8
Loading...
Searching...
No Matches

◆ buildUCS7604Preamble()

template<typename OutputIterator>
void fl::buildUCS7604Preamble ( OutputIterator out,
UCS7604Mode mode,
u8 r_current,
u8 g_current,
u8 b_current,
u8 w_current )

Build UCS7604 preamble (15 bytes)

Template Parameters
OutputIteratorOutput iterator accepting uint8_t
Parameters
outOutput iterator for preamble bytes
modeUCS7604 protocol mode (8-bit/16-bit)
r_currentRed channel current control (0x0-0xF, wire order)
g_currentGreen channel current control (0x0-0xF, wire order)
b_currentBlue channel current control (0x0-0xF, wire order)
w_currentWhite channel current control (0x0-0xF, wire order)
Note
Current control values should already be reordered to match wire protocol (RGB)
KNOWN LIMITATION: The UCS7604 protocol spec requires a ~20us "W-code low" delay between the 8-byte verification code and the 7-byte configuration block. Our clockless controller sends all 15 bytes as a continuous bit-encoded stream without this gap. If this causes issues on some hardware, the transmission would need to be split into two separate clockless sends with a manual low-hold between them. See: https://github.com/clinder/Arduino-Teensy-UCS7604

Definition at line 71 of file ucs7604.h.

73 {
74 // Sync pattern (6 bytes)
75 *out++ = 0xFF;
76 *out++ = 0xFF;
77 *out++ = 0xFF;
78 *out++ = 0xFF;
79 *out++ = 0xFF;
80 *out++ = 0xFF;
81
82 // Header (2 bytes)
83 *out++ = 0x00;
84 *out++ = 0x03;
85
86 // Mode byte
87 *out++ = static_cast<u8>(mode);
88
89 // Current control (4 bytes, 4-bit each, wire order RGBW)
90 *out++ = r_current & 0x0F;
91 *out++ = g_current & 0x0F;
92 *out++ = b_current & 0x0F;
93 *out++ = w_current & 0x0F;
94
95 // Reserved (2 bytes)
96 *out++ = 0x00;
97 *out++ = 0x00;
98}
unsigned char u8
Definition stdint.h:131

References FL_NO_EXCEPT.

Referenced by encodeUCS7604().

+ Here is the caller graph for this function: