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

◆ lpd6803EncodeRGB()

u16 fl::lpd6803EncodeRGB ( u8 r,
u8 g,
u8 b )
inline

Convert RGB to LPD6803 16-bit format (1bbbbbgggggrrrrr)

Parameters
rRed component (0-255)
gGreen component (0-255)
bBlue component (0-255)
Returns
16-bit LPD6803 command word
Note
Bit 15: marker (1), Bits 14-0: 5-5-5 RGB

Definition at line 102 of file encoder_utils.h.

102 {
103 u16 command = 0x8000; // Start marker
104 command |= (r & 0xF8) << 7; // Red: high 5 bits
105 command |= (g & 0xF8) << 2; // Green: high 5 bits
106 command |= (b >> 3); // Blue: high 5 bits
107 return command;
108}

References FL_NOEXCEPT.

Referenced by encodeLPD6803().

+ Here is the caller graph for this function: