MCPcopy Create free account
hub / github.com/FastLED/FastLED / p9813FlagByte

Function p9813FlagByte

src/fl/chipsets/encoders/encoder_utils.h:52–54  ·  view source on GitHub ↗

@brief Generate P9813 flag byte from RGB components @param r Red component (0-255) @param g Green component (0-255) @param b Blue component (0-255) @return P9813 flag byte (0xC0 | checksum) @note Checksum uses top 2 bits of each color channel

Source from the content-addressed store, hash-verified

50/// @return P9813 flag byte (0xC0 | checksum)
51/// @note Checksum uses top 2 bits of each color channel
52inline u8 p9813FlagByte(u8 r, u8 g, u8 b) FL_NOEXCEPT {
53 return 0xC0 | ((~b & 0xC0) >> 2) | ((~g & 0xC0) >> 4) | ((~r & 0xC0) >> 6);
54}
55
56/// @brief Apply LPD8806 encoding to a single color byte
57/// @param value 8-bit color value (0-255)

Callers 2

encodeP9813Function · 0.85
p9813.hppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected