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

Function sendPixelData

src/platforms/shared/clockless_blocking.h:137–153  ·  view source on GitHub ↗

Send raw pixel data with precise timing

Source from the content-addressed store, hash-verified

135private:
136 /// Send raw pixel data with precise timing
137 FASTLED_FORCE_INLINE static void sendPixelData(PixelController<RGB_ORDER> & pixels)
138 {
139 // Get color component order
140 u16 pixel_count = pixels.mLen;
141 u8 *data = (u8 *)pixels.mData;
142
143 // Iterate through all bytes in all pixels
144 for (u16 i = 0; i < pixel_count * 3; ++i) {
145 u8 byte = data[i];
146 sendByte(byte);
147 }
148
149 // Send reset code: line low for at least 50µs
150 // (WS2812/SK6812 datasheet requirement)
151 fl::FastPin<DATA_PIN>::lo();
152 fl::delayNanoseconds<280000>(); // 280 microseconds
153 }
154
155 /// Send a single byte with bit-by-bit timing
156 FASTLED_FORCE_INLINE static void sendByte(u8 byte)

Callers 1

Calls 2

sendByteFunction · 0.85
loFunction · 0.50

Tested by

no test coverage detected