FastLED 3.10.6
Loading...
Searching...
No Matches

◆ showPixels()

template<int DATA_PIN, fl::u8 CLOCK_PIN, EOrder RGB_ORDER = RGB, fl::u32 SPI_SPEED = DATA_RATE_MHZ(1)>
virtual void MY9221Controller< DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED >::showPixels ( PixelController< RGB_ORDER > & pixels)
inlineprotectedvirtual

Send the LED data to the strip.

Parameters
pixelsthe PixelController object for the LED data

Definition at line 105 of file my9221.h.

105 {
106 // Ensure known idle levels before the first edge.
107 DataPin::lo();
108 ClockPin::lo();
109
110 while (pixels.has(1)) {
111 fl::u8 ch[4][3] = {
112 {0, 0, 0},
113 {0, 0, 0},
114 {0, 0, 0},
115 {0, 0, 0}
116 };
117
118 // Map up to 4 CRGB pixels onto one chip: LED0->OUT0 .. LED3->OUT3.
119 for (int led = 0; led < 4 && pixels.has(1); ++led) {
120 ch[led][0] = pixels.loadAndScale0();
121 ch[led][1] = pixels.loadAndScale1();
122 ch[led][2] = pixels.loadAndScale2();
123 pixels.advanceData();
124 pixels.stepDithering();
125 }
126
128
129 // Hardware shift order is OUT3, OUT2, OUT1, OUT0.
130 for (int out = 3; out >= 0; --out) {
131 sendLed(ch[out][0], ch[out][1], ch[out][2]);
132 }
133 }
134
135 latch();
136 }
void sendWord(fl::u16 data)
Shift out one 16-bit word MSB-first, one clock edge per bit.
Definition my9221.h:67
static constexpr fl::u16 kCommandWord
Command word: 8-bit grayscale (CMD[9:8]=00), APDM waveform (CMD[4]=1).
Definition my9221.h:51
void sendLed(fl::u8 c0, fl::u8 c1, fl::u8 c2)
Definition my9221.h:74
void latch()
Definition my9221.h:80
MY9221 controller class.
Definition my9221.h:46

References PixelController< RGB_ORDER, LANES, MASK >::advanceData(), PixelController< RGB_ORDER, LANES, MASK >::has(), kCommandWord, latch(), PixelController< RGB_ORDER, LANES, MASK >::loadAndScale0(), PixelController< RGB_ORDER, LANES, MASK >::loadAndScale1(), PixelController< RGB_ORDER, LANES, MASK >::loadAndScale2(), sendLed(), sendWord(), and PixelController< RGB_ORDER, LANES, MASK >::stepDithering().

+ Here is the call graph for this function: