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

◆ wave3_convert_byte_to_wave3byte()

FASTLED_FORCE_INLINE FL_IRAM FL_OPTIMIZE_FUNCTION void fl::detail::wave3_convert_byte_to_wave3byte ( u8 byte_value,
const Wave3BitExpansionLut & lut,
Wave3Byte * output )

Helper: Convert byte to Wave3Byte using nibble LUT (internal use only)

Note
Inline implementation for ISR performance

Definition at line 27 of file wave3.hpp.

29 {
30 // High nibble → 12 bits, low nibble → 12 bits, total 24 bits = 3 bytes
31 u16 high_pattern = lut.lut[(byte_value >> 4) & 0xF];
32 u16 low_pattern = lut.lut[byte_value & 0xF];
33
34 // Pack 24 bits into 3 bytes (MSB first):
35 // Byte 0: bits [23..16] = high_pattern[11..4]
36 // Byte 1: bits [15..8] = high_pattern[3..0] | low_pattern[11..8]
37 // Byte 2: bits [7..0] = low_pattern[7..0]
38 output->data[0] = (u8)(high_pattern >> 4);
39 output->data[1] = (u8)(((high_pattern & 0xF) << 4) | ((low_pattern >> 8) & 0xF));
40 output->data[2] = (u8)(low_pattern & 0xFF);
41}
unsigned char u8
Definition stdint.h:131

Referenced by fl::wave3(), fl::wave3Transpose_16(), fl::wave3Transpose_2(), fl::wave3Transpose_4(), and fl::wave3Transpose_8().

+ Here is the caller graph for this function: