FastLED 3.9.15
Loading...
Searching...
No Matches
ws2816.h File Reference

Detailed Description

WS2816 encoder - converts 16-bit RGB pixels to dual 8-bit RGB format.

The WS2816 is a high-definition LED chipset that uses 16-bit color depth. This encoder converts each 16-bit RGB pixel into two 8-bit RGB pixels for transmission via standard WS2812-compatible controllers.

Protocol:

  • Input: 16-bit RGB (3x 16-bit values = 48 bits per LED)
  • Output: Dual 8-bit RGB (2x 24-bit CRGB = 48 bits per LED)
  • Each 16-bit channel is split: high byte → first CRGB, low byte → second CRGB
  • Channel layout: R_hi, R_lo, G_hi → first CRGB; G_lo, B_hi, B_lo → second CRGB
Note
This encoder produces 2x CRGB output for each input pixel

Definition in file ws2816.h.

#include "fl/stl/stdint.h"
#include "fl/stl/array.h"
#include "fl/stl/pair.h"
+ Include dependency graph for ws2816.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  fl
 Base definition for an LED controller.
 

Functions

template<typename InputIterator, typename OutputIterator>
void fl::encodeWS2816 (InputIterator first, InputIterator last, OutputIterator out)
 Encode 16-bit RGB pixel data into dual 8-bit RGB format for WS2816.
 
pair< CRGB, CRGBfl::packWS2816Pixel (u16 s0, u16 s1, u16 s2)
 Pack a single 16-bit RGB pixel into two 8-bit CRGB pixels for WS2816.