FastLED 3.9.15
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 ~20µs "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 69 of file ucs7604.h.

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

Referenced by encodeUCS7604().

+ Here is the caller graph for this function: