FastLED 3.9.12
Loading...
Searching...
No Matches
chipsets.h
Go to the documentation of this file.
1#ifndef __INC_CHIPSETS_H
2#define __INC_CHIPSETS_H
3
4#include "pixeltypes.h"
5#include "five_bit_hd_gamma.h"
6#include "fl/force_inline.h"
7#include "pixel_iterator.h"
8#include "crgb.h"
9#include "eorder.h"
10
11
12
13#ifndef FASTLED_CLOCKLESS_USES_NANOSECONDS
14 #if defined(FASTLED_TEENSY4)
15 #define FASTLED_CLOCKLESS_USES_NANOSECONDS 1
16 #elif defined(ESP32)
17 #include "third_party/espressif/led_strip/src/enabled.h"
18 // RMT 5.1 driver converts from nanoseconds to RMT ticks.
19 #if FASTLED_RMT5
20 #define FASTLED_CLOCKLESS_USES_NANOSECONDS 1
21 #else
22 #define FASTLED_CLOCKLESS_USES_NANOSECONDS 0
23 #endif
24 #else
25 #define FASTLED_CLOCKLESS_USES_NANOSECONDS 0
26 #endif // FASTLED_TEENSY4
27#endif // FASTLED_CLOCKLESS_USES_NANOSECONDS
28
29
30#ifdef __IMXRT1062__
31#include "platforms/arm/k20/clockless_objectfled.h"
32#endif
33
36
37
38
43
44#if defined(ARDUINO) //&& defined(SoftwareSerial_h)
45
46
47#if defined(SoftwareSerial_h) || defined(__SoftwareSerial_h)
48#include <SoftwareSerial.h>
49
50#define HAS_PIXIE
51
53
57template<uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
58class PixieController : public CPixelLEDController<RGB_ORDER> {
59 SoftwareSerial Serial;
60 CMinWait<2000> mWait;
61
62public:
63 PixieController() : Serial(-1, DATA_PIN) {}
64
65protected:
67 virtual void init() {
68 Serial.begin(115200);
69 mWait.mark();
70 }
71
73 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
74 mWait.wait();
75 while(pixels.has(1)) {
76 uint8_t r = pixels.loadAndScale0();
77 Serial.write(r);
78 uint8_t g = pixels.loadAndScale1();
79 Serial.write(g);
80 uint8_t b = pixels.loadAndScale2();
81 Serial.write(b);
82 pixels.advanceData();
83 pixels.stepDithering();
84 }
85 mWait.mark();
86 }
87
88};
89
90// template<SoftwareSerial & STREAM, EOrder RGB_ORDER = RGB>
91// class PixieController : public PixieBaseController<STREAM, RGB_ORDER> {
92// public:
93// virtual void init() {
94// STREAM.begin(115200);
95// }
96// };
97
99#endif
100#endif
101
102// Emulution layer to support RGBW leds on RGB controllers. This works by creating
103// a side buffer dedicated for the RGBW data. The RGB data is then converted to RGBW
104// and sent to the delegate controller for rendering as if it were RGB data.
106template <
107 typename CONTROLLER,
108 EOrder RGB_ORDER = GRB> // Default on WS2812>
110 : public CPixelLEDController<RGB_ORDER, CONTROLLER::LANES_VALUE,
111 CONTROLLER::MASK_VALUE> {
112 public:
113 static const int LANES = CONTROLLER::LANES_VALUE;
114 static const uint32_t MASK = CONTROLLER::MASK_VALUE;
115
116 // The delegated controller must do no reordering.
117 static_assert(RGB == CONTROLLER::RGB_ORDER_VALUE, "The delegated controller MUST NOT do reordering");
118
119 RGBWEmulatedController(const Rgbw& rgbw = RgbwDefault()) {
120 this->setRgbw(rgbw);
121 };
122 ~RGBWEmulatedController() { delete[] mRGBWPixels; }
123
125 // Ensure buffer is large enough
126 ensureBuffer(pixels.size());
127 Rgbw rgbw = this->getRgbw();
128 uint8_t *data = reinterpret_cast<uint8_t *>(mRGBWPixels);
129 while (pixels.has(1)) {
130 pixels.stepDithering();
131 pixels.loadAndScaleRGBW(rgbw, data, data + 1, data + 2, data + 3);
132 data += 4;
133 pixels.advanceData();
134 }
135
136 // Force the device controller to a state where it passes data through
137 // unmodified: color correction, color temperature, dither, and brightness
138 // (passed as an argument to show()). Temporarily enable the controller,
139 // show the LEDs, and disable it again.
140 //
141 // The device controller is in the global controller list, so if we
142 // don't keep it disabled, it will refresh again with unknown brightness,
143 // temperature, etc.
144
145 mController.setCorrection(CRGB(255, 255, 255));
146 mController.setTemperature(CRGB(255, 255, 255));
147 mController.setDither(DISABLE_DITHER);
148
149 mController.setEnabled(true);
150 mController.showLeds(255);
151 mController.setEnabled(false);
152 }
153
154 private:
155 // Needed by the interface.
156 void init() override {
157 mController.init();
158 mController.setEnabled(false);
159 }
160
161 void ensureBuffer(int32_t num_leds) {
162 if (num_leds != mNumRGBLeds) {
163 mNumRGBLeds = num_leds;
164 // The delegate controller expects the raw pixel byte data in multiples of 3.
165 // In the case of src data not a multiple of 3, then we need to
166 // add pad bytes so that the delegate controller doesn't walk off the end
167 // of the array and invoke a buffer overflow panic.
168 uint32_t new_size = Rgbw::size_as_rgb(num_leds);
169 delete[] mRGBWPixels;
170 mRGBWPixels = new CRGB[new_size];
171 // showPixels may never clear the last pixel.
172 mRGBWPixels[new_size - 1] = CRGB(0, 0, 0);
173 mController.setLeds(mRGBWPixels, new_size);
174 }
175 }
176
177 CRGB *mRGBWPixels = nullptr;
178 int32_t mNumRGBLeds = 0;
179 int32_t mNumRGBWLeds = 0;
180 CONTROLLER mController; // Real controller.
181};
182
186
188//
189// LPD8806 controller class - takes data/clock/select pin values (N.B. should take an SPI definition?)
190//
192
198template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(12) >
199class LPD8806Controller : public CPixelLEDController<RGB_ORDER> {
201
202 class LPD8806_ADJUST {
203 public:
204 // LPD8806 spec wants the high bit of every rgb data byte sent out to be set.
205 FASTLED_FORCE_INLINE static uint8_t adjust(FASTLED_REGISTER uint8_t data) { return ((data>>1) | 0x80) + ((data && (data<254)) & 0x01); }
206 FASTLED_FORCE_INLINE static void postBlock(int len, void* context = NULL) {
207 SPI* pSPI = static_cast<SPI*>(context);
208 pSPI->writeBytesValueRaw(0, ((len*3+63)>>6));
209 }
210
211 };
212
213 SPI mSPI;
214
215public:
217 virtual void init() {
218 mSPI.init();
219 }
220
221protected:
222
224 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
225 mSPI.template writePixels<0, LPD8806_ADJUST, RGB_ORDER>(pixels, &mSPI);
226 }
227};
228
229
231//
232// WS2801 definition - takes data/clock/select pin values (N.B. should take an SPI definition?)
233//
235
241template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(1)>
242class WS2801Controller : public CPixelLEDController<RGB_ORDER> {
244 SPI mSPI;
245 CMinWait<1000> mWaitDelay;
246
247public:
249
251 virtual void init() {
252 mSPI.init();
253 mWaitDelay.mark();
254 }
255
256protected:
257
259 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
260 mWaitDelay.wait();
261 mSPI.template writePixels<0, DATA_NOP, RGB_ORDER>(pixels, NULL);
262 mWaitDelay.mark();
263 }
264};
265
268template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(25)>
269class WS2803Controller : public WS2801Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED> {};
270
279template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(12)>
280class LPD6803Controller : public CPixelLEDController<RGB_ORDER> {
282 SPI mSPI;
283
284 void startBoundary() { mSPI.writeByte(0); mSPI.writeByte(0); mSPI.writeByte(0); mSPI.writeByte(0); }
285 void endBoundary(int nLeds) { int nDWords = (nLeds/32); do { mSPI.writeByte(0xFF); mSPI.writeByte(0x00); mSPI.writeByte(0x00); mSPI.writeByte(0x00); } while(nDWords--); }
286
287public:
289
290 virtual void init() {
291 mSPI.init();
292 }
293
294protected:
296 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
297 mSPI.select();
298
299 startBoundary();
300 while(pixels.has(1)) {
301 FASTLED_REGISTER uint16_t command;
302 command = 0x8000;
303 command |= (pixels.loadAndScale0() & 0xF8) << 7; // red is the high 5 bits
304 command |= (pixels.loadAndScale1() & 0xF8) << 2; // green is the middle 5 bits
305 mSPI.writeByte((command >> 8) & 0xFF);
306 command |= pixels.loadAndScale2() >> 3 ; // blue is the low 5 bits
307 mSPI.writeByte(command & 0xFF);
308
309 pixels.stepDithering();
310 pixels.advanceData();
311 }
312 endBoundary(pixels.size());
313 mSPI.waitFully();
314 mSPI.release();
315 }
316
317};
318
320//
321// APA102 definition - takes data/clock/select pin values (N.B. should take an SPI definition?)
322//
324
330template <
331 uint8_t DATA_PIN, uint8_t CLOCK_PIN,
332 EOrder RGB_ORDER = RGB,
333 // APA102 has a bug where long strip can't handle full speed due to clock degredation.
334 // This only affects long strips, but then again if you have a short strip does 6 mhz actually slow
335 // you down? Probably not. And you can always bump it up for speed. Therefore we are prioritizing
336 // "just works" over "fastest possible" here.
337 // https://www.pjrc.com/why-apa102-leds-have-trouble-at-24-mhz/
338 uint32_t SPI_SPEED = DATA_RATE_MHZ(6),
339 FiveBitGammaCorrectionMode GAMMA_CORRECTION_MODE = kFiveBitGammaCorrectionMode_Null,
340 uint32_t START_FRAME = 0x00000000,
341 uint32_t END_FRAME = 0xFF000000
342>
343class APA102Controller : public CPixelLEDController<RGB_ORDER> {
345 SPI mSPI;
346
347 void startBoundary() {
348 mSPI.writeWord(START_FRAME >> 16);
349 mSPI.writeWord(START_FRAME & 0xFFFF);
350 }
351 void endBoundary(int nLeds) {
352 int nDWords = (nLeds/32);
353 const uint8_t b0 = uint8_t(END_FRAME >> 24 & 0x000000ff);
354 const uint8_t b1 = uint8_t(END_FRAME >> 16 & 0x000000ff);
355 const uint8_t b2 = uint8_t(END_FRAME >> 8 & 0x000000ff);
356 const uint8_t b3 = uint8_t(END_FRAME >> 0 & 0x000000ff);
357 do {
358 mSPI.writeByte(b0);
359 mSPI.writeByte(b1);
360 mSPI.writeByte(b2);
361 mSPI.writeByte(b3);
362 } while(nDWords--);
363 }
364
365 FASTLED_FORCE_INLINE void writeLed(uint8_t brightness, uint8_t b0, uint8_t b1, uint8_t b2) {
366#ifdef FASTLED_SPI_BYTE_ONLY
367 mSPI.writeByte(0xE0 | brightness);
368 mSPI.writeByte(b0);
369 mSPI.writeByte(b1);
370 mSPI.writeByte(b2);
371#else
372 uint16_t b = 0xE000 | (brightness << 8) | (uint16_t)b0;
373 mSPI.writeWord(b);
374 uint16_t w = b1 << 8;
375 w |= b2;
376 mSPI.writeWord(w);
377#endif
378 }
379
380 FASTLED_FORCE_INLINE void write2Bytes(uint8_t b1, uint8_t b2) {
381#ifdef FASTLED_SPI_BYTE_ONLY
382 mSPI.writeByte(b1);
383 mSPI.writeByte(b2);
384#else
385 mSPI.writeWord(uint16_t(b1) << 8 | b2);
386#endif
387 }
388
389public:
391
392 virtual void init() override {
393 mSPI.init();
394 }
395
396protected:
398 virtual void showPixels(PixelController<RGB_ORDER> & pixels) override {
399 switch (GAMMA_CORRECTION_MODE) {
400 case kFiveBitGammaCorrectionMode_Null: {
401 showPixelsDefault(pixels);
402 break;
403 }
404 case kFiveBitGammaCorrectionMode_BitShift: {
405 showPixelsGammaBitShift(pixels);
406 break;
407 }
408 }
409 }
410
411private:
412
413 static inline void getGlobalBrightnessAndScalingFactors(
415 uint8_t* out_s0, uint8_t* out_s1, uint8_t* out_s2, uint8_t* out_brightness) {
416#if FASTLED_HD_COLOR_MIXING
417 uint8_t brightness;
418 pixels.getHdScale(out_s0, out_s1, out_s2, &brightness);
419 struct Math {
420 static uint16_t map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max) {
421 const uint16_t run = in_max - in_min;
422 const uint16_t rise = out_max - out_min;
423 const uint16_t delta = x - in_min;
424 return (delta * rise) / run + out_min;
425 }
426 };
427 *out_brightness = Math::map(brightness, 0, 255, 0, 31);
428 return;
429#else
430 uint8_t s0, s1, s2;
431 pixels.loadAndScaleRGB(&s0, &s1, &s2);
432#if FASTLED_USE_GLOBAL_BRIGHTNESS == 1
433 // This function is pure magic.
434 const uint16_t maxBrightness = 0x1F;
435 uint16_t brightness = ((((uint16_t)max(max(s0, s1), s2) + 1) * maxBrightness - 1) >> 8) + 1;
436 s0 = (maxBrightness * s0 + (brightness >> 1)) / brightness;
437 s1 = (maxBrightness * s1 + (brightness >> 1)) / brightness;
438 s2 = (maxBrightness * s2 + (brightness >> 1)) / brightness;
439#else
440 const uint8_t brightness = 0x1F;
441#endif // FASTLED_USE_GLOBAL_BRIGHTNESS
442 *out_s0 = s0;
443 *out_s1 = s1;
444 *out_s2 = s2;
445 *out_brightness = static_cast<uint8_t>(brightness);
446#endif // FASTLED_HD_COLOR_MIXING
447 }
448
449 // Legacy showPixels implementation.
450 inline void showPixelsDefault(PixelController<RGB_ORDER> & pixels) {
451 mSPI.select();
452 uint8_t s0, s1, s2, global_brightness;
453 getGlobalBrightnessAndScalingFactors(pixels, &s0, &s1, &s2, &global_brightness);
454 startBoundary();
455 while (pixels.has(1)) {
456 uint8_t c0, c1, c2;
457 pixels.loadAndScaleRGB(&c0, &c1, &c2);
458 writeLed(global_brightness, c0, c1, c2);
459 pixels.stepDithering();
460 pixels.advanceData();
461 }
462 endBoundary(pixels.size());
463
464 mSPI.waitFully();
465 mSPI.release();
466 }
467
468 inline void showPixelsGammaBitShift(PixelController<RGB_ORDER> & pixels) {
469 mSPI.select();
470 startBoundary();
471 while (pixels.has(1)) {
472 // Load raw uncorrected r,g,b values.
473 uint8_t brightness, c0, c1, c2; // c0-c2 is the RGB data re-ordered for pixel
474 pixels.loadAndScale_APA102_HD(&c0, &c1, &c2, &brightness);
475 writeLed(brightness, c0, c1, c2);
476 pixels.stepDithering();
477 pixels.advanceData();
478 }
479 endBoundary(pixels.size());
480 mSPI.waitFully();
481 mSPI.release();
482 }
483};
484
490template <
491 uint8_t DATA_PIN,
492 uint8_t CLOCK_PIN,
493 EOrder RGB_ORDER = RGB,
494 // APA102 has a bug where long strip can't handle full speed due to clock degredation.
495 // This only affects long strips, but then again if you have a short strip does 6 mhz actually slow
496 // you down? Probably not. And you can always bump it up for speed. Therefore we are prioritizing
497 // "just works" over "fastest possible" here.
498 // https://www.pjrc.com/why-apa102-leds-have-trouble-at-24-mhz/
499 uint32_t SPI_SPEED = DATA_RATE_MHZ(6)
500>
502 DATA_PIN,
503 CLOCK_PIN,
504 RGB_ORDER,
505 SPI_SPEED,
506 kFiveBitGammaCorrectionMode_BitShift,
507 uint32_t(0x00000000),
508 uint32_t(0x00000000)> {
509public:
510 APA102ControllerHD() = default;
511 APA102ControllerHD(const APA102ControllerHD&) = delete;
512};
513
519template <
520 uint8_t DATA_PIN,
521 uint8_t CLOCK_PIN,
522 EOrder RGB_ORDER = RGB,
523 uint32_t SPI_SPEED = DATA_RATE_MHZ(12)
524>
526 DATA_PIN,
527 CLOCK_PIN,
528 RGB_ORDER,
529 SPI_SPEED,
530 kFiveBitGammaCorrectionMode_Null,
531 0x00000000,
532 0x00000000
533> {
534};
535
541template <
542 uint8_t DATA_PIN,
543 uint8_t CLOCK_PIN,
544 EOrder RGB_ORDER = RGB,
545 uint32_t SPI_SPEED = DATA_RATE_MHZ(12)
546>
548 DATA_PIN,
549 CLOCK_PIN,
550 RGB_ORDER,
551 SPI_SPEED,
552 kFiveBitGammaCorrectionMode_BitShift,
553 0x00000000,
554 0x00000000
555> {
556};
557
558
559
561//
562// P9813 definition - takes data/clock/select pin values (N.B. should take an SPI definition?)
563//
565
571template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(10)>
572class P9813Controller : public CPixelLEDController<RGB_ORDER> {
574 SPI mSPI;
575
576 void writeBoundary() { mSPI.writeWord(0); mSPI.writeWord(0); }
577
578 FASTLED_FORCE_INLINE void writeLed(uint8_t r, uint8_t g, uint8_t b) {
579 FASTLED_REGISTER uint8_t top = 0xC0 | ((~b & 0xC0) >> 2) | ((~g & 0xC0) >> 4) | ((~r & 0xC0) >> 6);
580 mSPI.writeByte(top); mSPI.writeByte(b); mSPI.writeByte(g); mSPI.writeByte(r);
581 }
582
583public:
584 P9813Controller() {}
585
586 virtual void init() {
587 mSPI.init();
588 }
589
590protected:
592 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
593 mSPI.select();
594
595 writeBoundary();
596 while(pixels.has(1)) {
597 writeLed(pixels.loadAndScale0(), pixels.loadAndScale1(), pixels.loadAndScale2());
598 pixels.advanceData();
599 pixels.stepDithering();
600 }
601 writeBoundary();
602 mSPI.waitFully();
603
604 mSPI.release();
605 }
606
607};
608
609
611//
612// SM16716 definition - takes data/clock/select pin values (N.B. should take an SPI definition?)
613//
615
621template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(16)>
622class SM16716Controller : public CPixelLEDController<RGB_ORDER> {
624 SPI mSPI;
625
626 void writeHeader() {
627 // Write out 50 zeros to the spi line (6 blocks of 8 followed by two single bit writes)
628 mSPI.select();
629 mSPI.template writeBit<0>(0);
630 mSPI.writeByte(0);
631 mSPI.writeByte(0);
632 mSPI.writeByte(0);
633 mSPI.template writeBit<0>(0);
634 mSPI.writeByte(0);
635 mSPI.writeByte(0);
636 mSPI.writeByte(0);
637 mSPI.waitFully();
638 mSPI.release();
639 }
640
641public:
643
644 virtual void init() {
645 mSPI.init();
646 }
647
648protected:
650 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
651 // Make sure the FLAG_START_BIT flag is set to ensure that an extra 1 bit is sent at the start
652 // of each triplet of bytes for rgb data
653 // writeHeader();
654 mSPI.template writePixels<FLAG_START_BIT, DATA_NOP, RGB_ORDER>(pixels, NULL);
655 writeHeader();
656 }
657
658};
659
661
662
664//
665// Clockless template instantiations - see clockless.h for how the timing values are used
666//
667
668#ifdef FASTLED_HAS_CLOCKLESS
690
691// Allow clock that clockless controller is based on to have different
692// frequency than the CPU.
693#if !defined(CLOCKLESS_FREQUENCY)
694 #define CLOCKLESS_FREQUENCY F_CPU
695#endif
696
697// We want to force all avr's to use the Trinket controller when running at 8Mhz, because even the 328's at 8Mhz
698// need the more tightly defined timeframes.
699#if defined(__LGT8F__) || (CLOCKLESS_FREQUENCY == 8000000 || CLOCKLESS_FREQUENCY == 16000000 || CLOCKLESS_FREQUENCY == 24000000) || defined(FASTLED_DOXYGEN) // || CLOCKLESS_FREQUENCY == 48000000 || CLOCKLESS_FREQUENCY == 96000000) // 125ns/clock
700
703#define FMUL (CLOCKLESS_FREQUENCY/8000000)
704
707template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
708class GE8822Controller800Khz : public ClocklessController<DATA_PIN, 3 * FMUL, 5 * FMUL, 3 * FMUL, RGB_ORDER, 4> {};
709
712template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
713class LPD1886Controller1250Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 3 * FMUL, 2 * FMUL, RGB_ORDER, 4> {};
714
717template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
718class LPD1886Controller1250Khz_8bit : public ClocklessController<DATA_PIN, 2 * FMUL, 3 * FMUL, 2 * FMUL, RGB_ORDER> {};
719
723template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
724class WS2812Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 5 * FMUL, 3 * FMUL, RGB_ORDER> {};
725
728template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
729class WS2815Controller : public ClocklessController<DATA_PIN, 2 * FMUL, 9 * FMUL, 4 * FMUL, RGB_ORDER> {};
730
733template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
734class WS2811Controller800Khz : public ClocklessController<DATA_PIN, 3 * FMUL, 4 * FMUL, 3 * FMUL, RGB_ORDER> {};
735
738template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
739class DP1903Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 8 * FMUL, 2 * FMUL, RGB_ORDER> {};
740
743template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
744class DP1903Controller400Khz : public ClocklessController<DATA_PIN, 4 * FMUL, 16 * FMUL, 4 * FMUL, RGB_ORDER> {};
745
748template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB> //not tested
749class WS2813Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 4 * FMUL, 3 * FMUL, RGB_ORDER> {};
750
753template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
754class WS2811Controller400Khz : public ClocklessController<DATA_PIN, 4 * FMUL, 10 * FMUL, 6 * FMUL, RGB_ORDER> {};
755
758template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
759class SK6822Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 8 * FMUL, 3 * FMUL, RGB_ORDER> {};
760
763template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
764class SM16703Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 4 * FMUL, 3 * FMUL, RGB_ORDER> {};
765
768template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
769class SK6812Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 3 * FMUL, 4 * FMUL, RGB_ORDER> {};
770
773template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
774class UCS1903Controller400Khz : public ClocklessController<DATA_PIN, 4 * FMUL, 12 * FMUL, 4 * FMUL, RGB_ORDER> {};
775
778template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
779class UCS1903BController800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 4 * FMUL, 4 * FMUL, RGB_ORDER> {};
780
783template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
784class UCS1904Controller800Khz : public ClocklessController<DATA_PIN, 3 * FMUL, 3 * FMUL, 4 * FMUL, RGB_ORDER> {};
785
788template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
789class UCS2903Controller : public ClocklessController<DATA_PIN, 2 * FMUL, 6 * FMUL, 2 * FMUL, RGB_ORDER> {};
790
793template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
794class TM1809Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 5 * FMUL, 3 * FMUL, RGB_ORDER> {};
795
798template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
799class TM1803Controller400Khz : public ClocklessController<DATA_PIN, 6 * FMUL, 9 * FMUL, 6 * FMUL, RGB_ORDER> {};
800
803template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
804class TM1829Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 5 * FMUL, 3 * FMUL, RGB_ORDER, 0, true, 500> {};
805
808template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
809class GW6205Controller400Khz : public ClocklessController<DATA_PIN, 6 * FMUL, 7 * FMUL, 6 * FMUL, RGB_ORDER, 4> {};
810
813template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
814class GW6205Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 4 * FMUL, 4 * FMUL, RGB_ORDER, 4> {};
815
818template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
819class PL9823Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 8 * FMUL, 3 * FMUL, RGB_ORDER> {};
820
821// UCS1912 - Note, never been tested, this is according to the datasheet
822template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
823class UCS1912Controller : public ClocklessController<DATA_PIN, 2 * FMUL, 8 * FMUL, 3 * FMUL, RGB_ORDER> {};
824
825
826#else
827
828// Allow overclocking of the clockless family of leds. 1.2 would be
829// 20% overclocking. In tests WS2812 can be overclocked at 20%, but
830// various manufacturers may be different. This is a global value
831// which is overridable by each supported chipset.
832#ifdef FASTLED_LED_OVERCLOCK
833#warning "FASTLED_LED_OVERCLOCK has been changed to FASTLED_OVERCLOCK. Please update your code."
834#define FASTLED_OVERCLOCK FASTLED_LED_OVERCLOCK
835#endif
836
837#ifndef FASTLED_OVERCLOCK
838#define FASTLED_OVERCLOCK 1.0
839#else
840#ifndef FASTLED_OVERCLOCK_SUPPRESS_WARNING
841#warning "FASTLED_OVERCLOCK is now active, #define FASTLED_OVERCLOCK_SUPPRESS_WARNING to disable this warning"
842#endif
843#endif
844
845// WS2812 can be overclocked pretty aggressively, however, there are
846// some excellent articles that you should read about WS2812 overclocking
847// and corruption for a large number of LEDs.
848// https://wp.josh.com/2014/05/16/why-you-should-give-your-neopixel-bits-room-to-breathe/
849// https://wp.josh.com/2014/05/13/ws2812-neopixels-are-not-so-finicky-once-you-get-to-know-them/
850#ifndef FASTLED_OVERCLOCK_WS2812
851#define FASTLED_OVERCLOCK_WS2812 FASTLED_OVERCLOCK
852#endif
853
854#ifndef FASTLED_OVERCLOCK_WS2811
855#define FASTLED_OVERCLOCK_WS2811 FASTLED_OVERCLOCK
856#endif
857
858#ifndef FASTLED_OVERCLOCK_WS2813
859#define FASTLED_OVERCLOCK_WS2813 FASTLED_OVERCLOCK
860#endif
861
862#ifndef FASTLED_OVERCLOCK_WS2815
863#define FASTLED_OVERCLOCK_WS2815 FASTLED_OVERCLOCK
864#endif
865
866#ifndef FASTLED_OVERCLOCK_SK6822
867#define FASTLED_OVERCLOCK_SK6822 FASTLED_OVERCLOCK
868#endif
869
870#ifndef FASTLED_OVERCLOCK_SK6812
871#define FASTLED_OVERCLOCK_SK6812 FASTLED_OVERCLOCK
872#endif
873
876#if FASTLED_CLOCKLESS_USES_NANOSECONDS
877// just use raw nanosecond values for the teensy4
878#define C_NS(_NS) _NS
879#else
880#define C_NS(_NS) (((_NS * ((CLOCKLESS_FREQUENCY / 1000000L)) + 999)) / 1000)
881#endif
882
883// Allow overclocking various LED chipsets in the clockless family.
884// Clocked chips like the APA102 don't need this because they allow
885// you to control the clock speed directly.
886#define C_NS_WS2812(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_WS2812)))
887#define C_NS_WS2811(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_WS2811)))
888#define C_NS_WS2813(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_WS2813)))
889#define C_NS_WS2815(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_WS2815)))
890#define C_NS_SK6822(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_SK6822)))
891#define C_NS_SK6812(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_SK6812)))
892
893
894
895// At T=0 : the line is raised hi to start a bit
896// At T=T1 : the line is dropped low to transmit a zero bit
897// At T=T1+T2 : the line is dropped low to transmit a one bit
898// At T=T1+T2+T3 : the cycle is concluded (next bit can be sent)
899//
900// Python script to calculate the values for T1, T2, and T3 for FastLED:
901// Note: there is a discussion on whether this python script is correct or not:
902// https://github.com/FastLED/FastLED/issues/1806
903//
904// print("Enter the values of T0H, T0L, T1H, T1L, in nanoseconds: ")
905// T0H = int(input(" T0H: "))
906// T0L = int(input(" T0L: "))
907// T1H = int(input(" T1H: "))
908// T1L = int(input(" T1L: "))
909//
910// duration = max(T0H + T0L, T1H + T1L)
911//
912// print("The max duration of the signal is: ", duration)
913//
914// T1 = T0H
915// T2 = T1H
916// T3 = duration - T0H - T0L
917//
918// print("T1: ", T1)
919// print("T2: ", T2)
920// print("T3: ", T3)
921
922
923// GE8822 - 350ns 660ns 350ns
924template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
925class GE8822Controller800Khz : public ClocklessController<DATA_PIN, C_NS(350), C_NS(660), C_NS(350), RGB_ORDER, 4> {};
926
927// GW6205@400khz - 800ns, 800ns, 800ns
928template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
929class GW6205Controller400Khz : public ClocklessController<DATA_PIN, C_NS(800), C_NS(800), C_NS(800), RGB_ORDER, 4> {};
930
931// GW6205@400khz - 400ns, 400ns, 400ns
932template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
933class GW6205Controller800Khz : public ClocklessController<DATA_PIN, C_NS(400), C_NS(400), C_NS(400), RGB_ORDER, 4> {};
934
935// UCS1903 - 500ns, 1500ns, 500ns
936template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
937class UCS1903Controller400Khz : public ClocklessController<DATA_PIN, C_NS(500), C_NS(1500), C_NS(500), RGB_ORDER> {};
938
939// UCS1903B - 400ns, 450ns, 450ns
940template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
941class UCS1903BController800Khz : public ClocklessController<DATA_PIN, C_NS(400), C_NS(450), C_NS(450), RGB_ORDER> {};
942
943// UCS1904 - 400ns, 400ns, 450ns
944template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
945class UCS1904Controller800Khz : public ClocklessController<DATA_PIN, C_NS(400), C_NS(400), C_NS(450), RGB_ORDER> {};
946
947// UCS2903 - 250ns, 750ns, 250ns
948template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
949class UCS2903Controller : public ClocklessController<DATA_PIN, C_NS(250), C_NS(750), C_NS(250), RGB_ORDER> {};
950
951// TM1809 - 350ns, 350ns, 550ns
952template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
953class TM1809Controller800Khz : public ClocklessController<DATA_PIN, C_NS(350), C_NS(350), C_NS(450), RGB_ORDER> {};
954
955// WS2811 - 320ns, 320ns, 640ns
956template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
957class WS2811Controller800Khz : public ClocklessController<DATA_PIN, C_NS_WS2811(320), C_NS_WS2811(320), C_NS_WS2811(640), RGB_ORDER> {};
958
959// WS2813 - 320ns, 320ns, 640ns
960template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
961class WS2813Controller : public ClocklessController<DATA_PIN, C_NS_WS2813(320), C_NS_WS2813(320), C_NS_WS2813(640), RGB_ORDER> {};
962
963#ifndef FASTLED_WS2812_T1
964#define FASTLED_WS2812_T1 250
965#endif
966
967#ifndef FASTLED_WS2812_T2
968#define FASTLED_WS2812_T2 625
969#endif
970
971#ifndef FASTLED_WS2812_T3
972#define FASTLED_WS2812_T3 375
973#endif
974
975
976#if defined(__IMXRT1062__) && !defined(FASTLED_NOT_USES_OBJECTFLED)
977#if defined(FASTLED_USES_OBJECTFLED)
978#warning "FASTLED_USES_OBJECTFLED is now implicit for Teensy 4.0/4.1 for WS2812 and is no longer needed."
979#endif
980template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
982 public fl::ClocklessController_ObjectFLED_WS2812<
983 DATA_PIN,
984 RGB_ORDER> {
985 public:
986 typedef fl::ClocklessController_ObjectFLED_WS2812<DATA_PIN, RGB_ORDER> Base;
987 WS2812Controller800Khz(): Base(FASTLED_OVERCLOCK) {}
988};
989#elif defined(FASTLED_USES_ESP32S3_I2S)
990#include "platforms/esp/32/clockless_i2s_esp32s3.h"
991template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
993 public fl::ClocklessController_I2S_Esp32_WS2812<
994 DATA_PIN,
995 RGB_ORDER
996 > {};
997#else
998// WS2812 - 250ns, 625ns, 375ns
999template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1000class WS2812Controller800Khz : public ClocklessController<
1001 DATA_PIN,
1002 C_NS_WS2812(FASTLED_WS2812_T1),
1003 C_NS_WS2812(FASTLED_WS2812_T2),
1004 C_NS_WS2812(FASTLED_WS2812_T3),
1005 RGB_ORDER> {};
1006#endif // defined(FASTLED_USES_OBJECTFLED)
1007
1008
1009// WS2811@400khz - 800ns, 800ns, 900ns
1010template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1011class WS2811Controller400Khz : public ClocklessController<DATA_PIN, C_NS_WS2811(800), C_NS_WS2811(800), C_NS_WS2811(900), RGB_ORDER> {};
1012
1013template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1014class WS2815Controller : public ClocklessController<DATA_PIN, C_NS_WS2815(250), C_NS_WS2815(1090), C_NS_WS2815(550), RGB_ORDER> {};
1015
1016// 750NS, 750NS, 750NS
1017template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1018class TM1803Controller400Khz : public ClocklessController<DATA_PIN, C_NS(700), C_NS(1100), C_NS(700), RGB_ORDER> {};
1019
1020template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1021class TM1829Controller800Khz : public ClocklessController<DATA_PIN, C_NS(340), C_NS(340), C_NS(550), RGB_ORDER, 0, true, 500> {};
1022
1023template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1024class TM1829Controller1600Khz : public ClocklessController<DATA_PIN, C_NS(100), C_NS(300), C_NS(200), RGB_ORDER, 0, true, 500> {};
1025
1026template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1027class LPD1886Controller1250Khz : public ClocklessController<DATA_PIN, C_NS(200), C_NS(400), C_NS(200), RGB_ORDER, 4> {};
1028
1029template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1030class LPD1886Controller1250Khz_8bit : public ClocklessController<DATA_PIN, C_NS(200), C_NS(400), C_NS(200), RGB_ORDER> {};
1031
1032
1033template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1034class SK6822Controller : public ClocklessController<DATA_PIN, C_NS_SK6822(375), C_NS_SK6822(1000), C_NS_SK6822(375), RGB_ORDER> {};
1035
1036template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1037class SK6812Controller : public ClocklessController<DATA_PIN, C_NS_SK6812(300), C_NS_SK6812(300), C_NS_SK6812(600), RGB_ORDER> {};
1038
1039template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1040class SM16703Controller : public ClocklessController<DATA_PIN, C_NS(300), C_NS(600), C_NS(300), RGB_ORDER> {};
1041
1042template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1043class PL9823Controller : public ClocklessController<DATA_PIN, C_NS(350), C_NS(1010), C_NS(350), RGB_ORDER> {};
1044
1045// UCS1912 - Note, never been tested, this is according to the datasheet
1046template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1047class UCS1912Controller : public ClocklessController<DATA_PIN, C_NS(250), C_NS(1000), C_NS(350), RGB_ORDER> {};
1048#endif
1050
1051
1052// WS2816 - is an emulated controller that emits 48 bit pixels by forwarding
1053// them to a platform specific WS2812 controller. The WS2812 controller
1054// has to output twice as many 24 bit pixels.
1055template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1056class WS2816Controller // : public ClocklessController<DATA_PIN, C_NS_WS2816(250), C_NS_WS2816(625), C_NS_WS2816(375)> {
1057 : public CPixelLEDController<RGB_ORDER,
1058 WS2812Controller800Khz<DATA_PIN, RGB>::LANES_VALUE,
1059 WS2812Controller800Khz<DATA_PIN, RGB>::MASK_VALUE> {
1060
1061public:
1063 static const int LANES = ControllerT::LANES_VALUE;
1064 static const uint32_t MASK = ControllerT::MASK_VALUE;
1065
1066 WS2816Controller() {}
1068 mController.setLeds(nullptr, 0);
1069 delete [] mData;
1070 }
1071
1073 // Ensure buffer is large enough
1074 ensureBuffer(pixels.size());
1075
1076 // expand and copy all the pixels
1077 size_t out_index = 0;
1078 while (pixels.has(1)) {
1079 pixels.stepDithering();
1080
1081 uint16_t s0, s1, s2;
1082 pixels.loadAndScale_WS2816_HD(&s0, &s1, &s2);
1083 uint8_t b0_hi = s0 >> 8;
1084 uint8_t b0_lo = s0 & 0xFF;
1085 uint8_t b1_hi = s1 >> 8;
1086 uint8_t b1_lo = s1 & 0xFF;
1087 uint8_t b2_hi = s2 >> 8;
1088 uint8_t b2_lo = s2 & 0xFF;
1089
1090 mData[out_index] = CRGB(b0_hi, b0_lo, b1_hi);
1091 mData[out_index + 1] = CRGB(b1_lo, b2_hi, b2_lo);
1092
1093 pixels.advanceData();
1094 out_index += 2;
1095 }
1096
1097 // ensure device controller won't modify color values
1098 mController.setCorrection(CRGB(255, 255, 255));
1099 mController.setTemperature(CRGB(255, 255, 255));
1100 mController.setDither(DISABLE_DITHER);
1101
1102 // output the data stream
1103 mController.setEnabled(true);
1104 mController.showLeds(255);
1105 mController.setEnabled(false);
1106 }
1107
1108private:
1109 void init() override {
1110 mController.init();
1111 mController.setEnabled(false);
1112 }
1113
1114 void ensureBuffer(int size_8bit) {
1115 int size_16bit = 2 * size_8bit;
1116 if (mController.size() != size_16bit) {
1117 delete [] mData;
1118 CRGB *new_leds = new CRGB[size_16bit];
1119 mData = new_leds;
1120 mController.setLeds(new_leds, size_16bit);
1121 }
1122 }
1123
1124 CRGB *mData = 0;
1125 ControllerT mController;
1126};
1127
1128
1129#endif
1131
1133
1134#endif
APA102 high definition controller class.
Definition chipsets.h:508
APA102 controller class.
Definition chipsets.h:343
virtual void init() override
Initialize the LED controller.
Definition chipsets.h:392
virtual void showPixels(PixelController< RGB_ORDER > &pixels) override
Send the LED data to the strip.
Definition chipsets.h:398
void select()
Select the SPI output (chip select)
static void writeWord(uint16_t w)
Write a word (two bytes) over SPI.
static void writeByte(uint8_t b)
Write a single byte over SPI.
void release()
Release the SPI chip select line.
static void writeBytesValueRaw(uint8_t value, int len)
Write multiple bytes of the given value over SPI, without selecting the interface.
static void waitFully()
Wait until the SPI subsystem is ready for more data to write.
void init()
Set the clock/data pins to output and make sure the chip select is released.
virtual void init()=0
Initialize the LED controller.
Class to ensure that a minimum amount of time has kicked since the last time run - and delay if not e...
void mark()
Reset the timestamp that marks the start of the wait period.
void wait()
Blocking delay until WAIT time since mark() has passed.
Template extension of the CLEDController class.
virtual void showPixels(PixelController< RGB_ORDER, LANES, MASK > &pixels)=0
Send the LED data to the strip.
DP1903 controller class @ 400 KHz.
Definition chipsets.h:744
DP1903 controller class @ 800 KHz.
Definition chipsets.h:739
GE8822 controller class.
Definition chipsets.h:708
GW6205 controller class @ 400 KHz.
Definition chipsets.h:809
UCS1904 controller class @ 800 KHz.
Definition chipsets.h:814
LPD1886 controller class.
Definition chipsets.h:718
LPD1886 controller class.
Definition chipsets.h:713
LPD6803 controller class (LPD1101).
Definition chipsets.h:280
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:296
virtual void init()
Initialize the LED controller.
Definition chipsets.h:290
LPD8806 controller class.
Definition chipsets.h:199
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:224
virtual void init()
Initialize the LED controller.
Definition chipsets.h:217
P9813 controller class.
Definition chipsets.h:572
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:592
virtual void init()
Initialize the LED controller.
Definition chipsets.h:586
PL9823 controller class.
Definition chipsets.h:819
virtual void showPixels(PixelController< RGB_ORDER, LANES, MASK > &pixels)
Send the LED data to the strip.
Definition chipsets.h:124
SK6812 controller class.
Definition chipsets.h:769
SK6822 controller class.
Definition chipsets.h:759
SK9822 controller class.
Definition chipsets.h:555
SK9822 controller class.
Definition chipsets.h:533
SM16703 controller class.
Definition chipsets.h:764
SM16716 controller class.
Definition chipsets.h:622
virtual void init()
Initialize the LED controller.
Definition chipsets.h:644
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:650
Hardware SPI output.
Definition fastspi.h:51
TM1803 controller class.
Definition chipsets.h:799
TM1809 controller class.
Definition chipsets.h:794
TM1829 controller class.
Definition chipsets.h:804
UCS1903B controller class.
Definition chipsets.h:779
UCS1903 controller class @ 400 KHz.
Definition chipsets.h:774
UCS1904 controller class.
Definition chipsets.h:784
UCS2903 controller class.
Definition chipsets.h:789
WS2801 controller class.
Definition chipsets.h:242
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:259
virtual void init()
Initialize the controller.
Definition chipsets.h:251
WS2803 controller class.
Definition chipsets.h:269
WS2811 controller class @ 400 KHz.
Definition chipsets.h:754
WS2811 controller class @ 800 KHz.
Definition chipsets.h:734
WS2812 controller class @ 800 KHz.
Definition chipsets.h:724
WS2812 controller class.
Definition FastLED.h:190
WS2813 controller class.
Definition chipsets.h:749
WS2815 controller class @ 400 KHz.
Definition chipsets.h:729
virtual void showPixels(PixelController< RGB_ORDER, LANES, MASK > &pixels)
Send the LED data to the strip.
Definition chipsets.h:1072
Defines the red, green, and blue (RGB) pixel struct.
#define DISABLE_DITHER
Disable dithering.
Definition dither_mode.h:11
Defines color channel ordering enumerations.
EOrder
RGB color channel orderings, used when instantiating controllers to determine what order the controll...
Definition eorder.h:14
@ RGB
Red, Green, Blue (0012)
Definition eorder.h:15
@ GRB
Green, Red, Blue (0102)
Definition eorder.h:17
#define DATA_RATE_MHZ(X)
Convert data rate from megahertz (MHz) to clock cycles per bit.
Definition fastspi.h:25
Declares functions for five-bit gamma correction.
#define FASTLED_NAMESPACE_END
End of the FastLED namespace.
Definition namespace.h:16
#define FASTLED_NAMESPACE_BEGIN
Start of the FastLED namespace.
Definition namespace.h:14
Non-templated low level pixel data writing class.
Includes defintions for RGB and HSV pixels.
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54
Pixel controller class.
FASTLED_FORCE_INLINE uint8_t loadAndScale1(int lane, uint8_t scale)
non-template alias of loadAndScale<1>()
FASTLED_FORCE_INLINE uint8_t loadAndScale2(int lane, uint8_t scale)
non-template alias of loadAndScale<2>()
FASTLED_FORCE_INLINE uint8_t loadAndScale0(int lane, uint8_t scale)
non-template alias of loadAndScale<0>()
FASTLED_FORCE_INLINE int size()
Get the length of the LED strip.
FASTLED_FORCE_INLINE void advanceData()
Advance the data pointer forward, adjust position counter.
FASTLED_FORCE_INLINE bool has(int n)
Do we have n pixels left to process?
FASTLED_FORCE_INLINE void stepDithering()
Step the dithering forward.
Definition rgbw.h:28