FastLED 3.10.6
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 105 of file encoder_utils.h.

105 {
106 u16 command = 0x8000; // Start marker
107 command |= (r & 0xF8) << 7; // Red: high 5 bits
108 command |= (g & 0xF8) << 2; // Green: high 5 bits
109 command |= (b >> 3); // Blue: high 5 bits
110 return command;
111}
InputGamut g
Definition rgbw.h:124

References FL_NO_EXCEPT, and g.

Referenced by encodeLPD6803().

+ Here is the caller graph for this function: