FastLED 3.9.13
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 // ControllerT is a helper class. It subclasses the device controller class
114 // and has three methods to call the three protected methods we use.
115 // This is janky, but redeclaring public methods protected in a derived class
116 // is janky, too.
117
118 // N.B., byte order must be RGB.
119 typedef CONTROLLER ControllerBaseT;
120 class ControllerT : public CONTROLLER {
121 friend class RGBWEmulatedController<CONTROLLER, RGB_ORDER>;
122 void *callBeginShowLeds(int size) { return ControllerBaseT::beginShowLeds(size); }
123 void callShow(CRGB *data, int nLeds, uint8_t brightness) {
124 ControllerBaseT::show(data, nLeds, brightness);
125 }
126 void callEndShowLeds(void *data) { ControllerBaseT::endShowLeds(data); }
127 };
128
129
130 static const int LANES = CONTROLLER::LANES_VALUE;
131 static const uint32_t MASK = CONTROLLER::MASK_VALUE;
132
133 // The delegated controller must do no reordering.
134 static_assert(RGB == CONTROLLER::RGB_ORDER_VALUE, "The delegated controller MUST NOT do reordering");
135
136 RGBWEmulatedController(const Rgbw& rgbw = RgbwDefault()) {
137 this->setRgbw(rgbw);
138 };
139 ~RGBWEmulatedController() { delete[] mRGBWPixels; }
140
141 virtual void *beginShowLeds(int size) override {
142 return mController.callBeginShowLeds(Rgbw::size_as_rgb(size));
143 }
144
145 virtual void endShowLeds(void *data) override {
146 return mController.callEndShowLeds(data);
147 }
148
150 // Ensure buffer is large enough
151 ensureBuffer(pixels.size());
152 Rgbw rgbw = this->getRgbw();
153 uint8_t *data = reinterpret_cast<uint8_t *>(mRGBWPixels);
154 while (pixels.has(1)) {
155 pixels.stepDithering();
156 pixels.loadAndScaleRGBW(rgbw, data, data + 1, data + 2, data + 3);
157 data += 4;
158 pixels.advanceData();
159 }
160
161 // Force the device controller to a state where it passes data through
162 // unmodified: color correction, color temperature, dither, and brightness
163 // (passed as an argument to show()). Temporarily enable the controller,
164 // show the LEDs, and disable it again.
165 //
166 // The device controller is in the global controller list, so if we
167 // don't keep it disabled, it will refresh again with unknown brightness,
168 // temperature, etc.
169
170 mController.setCorrection(CRGB(255, 255, 255));
171 mController.setTemperature(CRGB(255, 255, 255));
172 mController.setDither(DISABLE_DITHER);
173
174 mController.setEnabled(true);
175 mController.callShow(mRGBWPixels, Rgbw::size_as_rgb(pixels.size()), 255);
176 mController.setEnabled(false);
177 }
178
179 private:
180 // Needed by the interface.
181 void init() override {
182 mController.init();
183 mController.setEnabled(false);
184 }
185
186 void ensureBuffer(int32_t num_leds) {
187 if (num_leds != mNumRGBLeds) {
188 mNumRGBLeds = num_leds;
189 // The delegate controller expects the raw pixel byte data in multiples of 3.
190 // In the case of src data not a multiple of 3, then we need to
191 // add pad bytes so that the delegate controller doesn't walk off the end
192 // of the array and invoke a buffer overflow panic.
193 uint32_t new_size = Rgbw::size_as_rgb(num_leds);
194 delete[] mRGBWPixels;
195 mRGBWPixels = new CRGB[new_size];
196 // showPixels may never clear the last two pixels.
197 for (uint32_t i = 0; i < new_size; i++) {
198 mRGBWPixels[i] = CRGB(0, 0, 0);
199 }
200
201 mController.setLeds(mRGBWPixels, new_size);
202 }
203 }
204
205 CRGB *mRGBWPixels = nullptr;
206 int32_t mNumRGBLeds = 0;
207 int32_t mNumRGBWLeds = 0;
208 ControllerT mController; // Real controller.
209};
210
214
216//
217// LPD8806 controller class - takes data/clock/select pin values (N.B. should take an SPI definition?)
218//
220
226template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(12) >
227class LPD8806Controller : public CPixelLEDController<RGB_ORDER> {
229
230 class LPD8806_ADJUST {
231 public:
232 // LPD8806 spec wants the high bit of every rgb data byte sent out to be set.
233 FASTLED_FORCE_INLINE static uint8_t adjust(FASTLED_REGISTER uint8_t data) { return ((data>>1) | 0x80) + ((data && (data<254)) & 0x01); }
234 FASTLED_FORCE_INLINE static void postBlock(int len, void* context = NULL) {
235 SPI* pSPI = static_cast<SPI*>(context);
236 pSPI->writeBytesValueRaw(0, ((len*3+63)>>6));
237 }
238
239 };
240
241 SPI mSPI;
242
243public:
245 virtual void init() {
246 mSPI.init();
247 }
248
249protected:
250
252 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
253 mSPI.template writePixels<0, LPD8806_ADJUST, RGB_ORDER>(pixels, &mSPI);
254 }
255};
256
257
259//
260// WS2801 definition - takes data/clock/select pin values (N.B. should take an SPI definition?)
261//
263
269template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(1)>
270class WS2801Controller : public CPixelLEDController<RGB_ORDER> {
272 SPI mSPI;
273 CMinWait<1000> mWaitDelay;
274
275public:
277
279 virtual void init() {
280 mSPI.init();
281 mWaitDelay.mark();
282 }
283
284protected:
285
287 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
288 mWaitDelay.wait();
289 mSPI.template writePixels<0, DATA_NOP, RGB_ORDER>(pixels, NULL);
290 mWaitDelay.mark();
291 }
292};
293
296template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(25)>
297class WS2803Controller : public WS2801Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED> {};
298
307template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(12)>
308class LPD6803Controller : public CPixelLEDController<RGB_ORDER> {
310 SPI mSPI;
311
312 void startBoundary() { mSPI.writeByte(0); mSPI.writeByte(0); mSPI.writeByte(0); mSPI.writeByte(0); }
313 void endBoundary(int nLeds) { int nDWords = (nLeds/32); do { mSPI.writeByte(0xFF); mSPI.writeByte(0x00); mSPI.writeByte(0x00); mSPI.writeByte(0x00); } while(nDWords--); }
314
315public:
317
318 virtual void init() {
319 mSPI.init();
320 }
321
322protected:
324 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
325 mSPI.select();
326
327 startBoundary();
328 while(pixels.has(1)) {
329 FASTLED_REGISTER uint16_t command;
330 command = 0x8000;
331 command |= (pixels.loadAndScale0() & 0xF8) << 7; // red is the high 5 bits
332 command |= (pixels.loadAndScale1() & 0xF8) << 2; // green is the middle 5 bits
333 mSPI.writeByte((command >> 8) & 0xFF);
334 command |= pixels.loadAndScale2() >> 3 ; // blue is the low 5 bits
335 mSPI.writeByte(command & 0xFF);
336
337 pixels.stepDithering();
338 pixels.advanceData();
339 }
340 endBoundary(pixels.size());
341 mSPI.waitFully();
342 mSPI.release();
343 }
344
345};
346
348//
349// APA102 definition - takes data/clock/select pin values (N.B. should take an SPI definition?)
350//
352
358template <
359 uint8_t DATA_PIN, uint8_t CLOCK_PIN,
360 EOrder RGB_ORDER = RGB,
361 // APA102 has a bug where long strip can't handle full speed due to clock degredation.
362 // This only affects long strips, but then again if you have a short strip does 6 mhz actually slow
363 // you down? Probably not. And you can always bump it up for speed. Therefore we are prioritizing
364 // "just works" over "fastest possible" here.
365 // https://www.pjrc.com/why-apa102-leds-have-trouble-at-24-mhz/
366 uint32_t SPI_SPEED = DATA_RATE_MHZ(6),
367 FiveBitGammaCorrectionMode GAMMA_CORRECTION_MODE = kFiveBitGammaCorrectionMode_Null,
368 uint32_t START_FRAME = 0x00000000,
369 uint32_t END_FRAME = 0xFF000000
370>
371class APA102Controller : public CPixelLEDController<RGB_ORDER> {
373 SPI mSPI;
374
375 void startBoundary() {
376 mSPI.writeWord(START_FRAME >> 16);
377 mSPI.writeWord(START_FRAME & 0xFFFF);
378 }
379 void endBoundary(int nLeds) {
380 int nDWords = (nLeds/32);
381 const uint8_t b0 = uint8_t(END_FRAME >> 24 & 0x000000ff);
382 const uint8_t b1 = uint8_t(END_FRAME >> 16 & 0x000000ff);
383 const uint8_t b2 = uint8_t(END_FRAME >> 8 & 0x000000ff);
384 const uint8_t b3 = uint8_t(END_FRAME >> 0 & 0x000000ff);
385 do {
386 mSPI.writeByte(b0);
387 mSPI.writeByte(b1);
388 mSPI.writeByte(b2);
389 mSPI.writeByte(b3);
390 } while(nDWords--);
391 }
392
393 FASTLED_FORCE_INLINE void writeLed(uint8_t brightness, uint8_t b0, uint8_t b1, uint8_t b2) {
394#ifdef FASTLED_SPI_BYTE_ONLY
395 mSPI.writeByte(0xE0 | brightness);
396 mSPI.writeByte(b0);
397 mSPI.writeByte(b1);
398 mSPI.writeByte(b2);
399#else
400 uint16_t b = 0xE000 | (brightness << 8) | (uint16_t)b0;
401 mSPI.writeWord(b);
402 uint16_t w = b1 << 8;
403 w |= b2;
404 mSPI.writeWord(w);
405#endif
406 }
407
408 FASTLED_FORCE_INLINE void write2Bytes(uint8_t b1, uint8_t b2) {
409#ifdef FASTLED_SPI_BYTE_ONLY
410 mSPI.writeByte(b1);
411 mSPI.writeByte(b2);
412#else
413 mSPI.writeWord(uint16_t(b1) << 8 | b2);
414#endif
415 }
416
417public:
419
420 virtual void init() override {
421 mSPI.init();
422 }
423
424protected:
426 virtual void showPixels(PixelController<RGB_ORDER> & pixels) override {
427 switch (GAMMA_CORRECTION_MODE) {
428 case kFiveBitGammaCorrectionMode_Null: {
429 showPixelsDefault(pixels);
430 break;
431 }
432 case kFiveBitGammaCorrectionMode_BitShift: {
433 showPixelsGammaBitShift(pixels);
434 break;
435 }
436 }
437 }
438
439private:
440
441 static inline void getGlobalBrightnessAndScalingFactors(
443 uint8_t* out_s0, uint8_t* out_s1, uint8_t* out_s2, uint8_t* out_brightness) {
444#if FASTLED_HD_COLOR_MIXING
445 uint8_t brightness;
446 pixels.getHdScale(out_s0, out_s1, out_s2, &brightness);
447 struct Math {
448 static uint16_t map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max) {
449 const uint16_t run = in_max - in_min;
450 const uint16_t rise = out_max - out_min;
451 const uint16_t delta = x - in_min;
452 return (delta * rise) / run + out_min;
453 }
454 };
455 *out_brightness = Math::map(brightness, 0, 255, 0, 31);
456 return;
457#else
458 uint8_t s0, s1, s2;
459 pixels.loadAndScaleRGB(&s0, &s1, &s2);
460#if FASTLED_USE_GLOBAL_BRIGHTNESS == 1
461 // This function is pure magic.
462 const uint16_t maxBrightness = 0x1F;
463 uint16_t brightness = ((((uint16_t)max(max(s0, s1), s2) + 1) * maxBrightness - 1) >> 8) + 1;
464 s0 = (maxBrightness * s0 + (brightness >> 1)) / brightness;
465 s1 = (maxBrightness * s1 + (brightness >> 1)) / brightness;
466 s2 = (maxBrightness * s2 + (brightness >> 1)) / brightness;
467#else
468 const uint8_t brightness = 0x1F;
469#endif // FASTLED_USE_GLOBAL_BRIGHTNESS
470 *out_s0 = s0;
471 *out_s1 = s1;
472 *out_s2 = s2;
473 *out_brightness = static_cast<uint8_t>(brightness);
474#endif // FASTLED_HD_COLOR_MIXING
475 }
476
477 // Legacy showPixels implementation.
478 inline void showPixelsDefault(PixelController<RGB_ORDER> & pixels) {
479 mSPI.select();
480 uint8_t s0, s1, s2, global_brightness;
481 getGlobalBrightnessAndScalingFactors(pixels, &s0, &s1, &s2, &global_brightness);
482 startBoundary();
483 while (pixels.has(1)) {
484 uint8_t c0, c1, c2;
485 pixels.loadAndScaleRGB(&c0, &c1, &c2);
486 writeLed(global_brightness, c0, c1, c2);
487 pixels.stepDithering();
488 pixels.advanceData();
489 }
490 endBoundary(pixels.size());
491
492 mSPI.waitFully();
493 mSPI.release();
494 }
495
496 inline void showPixelsGammaBitShift(PixelController<RGB_ORDER> & pixels) {
497 mSPI.select();
498 startBoundary();
499 while (pixels.has(1)) {
500 // Load raw uncorrected r,g,b values.
501 uint8_t brightness, c0, c1, c2; // c0-c2 is the RGB data re-ordered for pixel
502 pixels.loadAndScale_APA102_HD(&c0, &c1, &c2, &brightness);
503 writeLed(brightness, c0, c1, c2);
504 pixels.stepDithering();
505 pixels.advanceData();
506 }
507 endBoundary(pixels.size());
508 mSPI.waitFully();
509 mSPI.release();
510 }
511};
512
518template <
519 uint8_t DATA_PIN,
520 uint8_t CLOCK_PIN,
521 EOrder RGB_ORDER = RGB,
522 // APA102 has a bug where long strip can't handle full speed due to clock degredation.
523 // This only affects long strips, but then again if you have a short strip does 6 mhz actually slow
524 // you down? Probably not. And you can always bump it up for speed. Therefore we are prioritizing
525 // "just works" over "fastest possible" here.
526 // https://www.pjrc.com/why-apa102-leds-have-trouble-at-24-mhz/
527 uint32_t SPI_SPEED = DATA_RATE_MHZ(6)
528>
530 DATA_PIN,
531 CLOCK_PIN,
532 RGB_ORDER,
533 SPI_SPEED,
534 kFiveBitGammaCorrectionMode_BitShift,
535 uint32_t(0x00000000),
536 uint32_t(0x00000000)> {
537public:
538 APA102ControllerHD() = default;
539 APA102ControllerHD(const APA102ControllerHD&) = delete;
540};
541
547template <
548 uint8_t DATA_PIN,
549 uint8_t CLOCK_PIN,
550 EOrder RGB_ORDER = RGB,
551 uint32_t SPI_SPEED = DATA_RATE_MHZ(12)
552>
554 DATA_PIN,
555 CLOCK_PIN,
556 RGB_ORDER,
557 SPI_SPEED,
558 kFiveBitGammaCorrectionMode_Null,
559 0x00000000,
560 0x00000000
561> {
562};
563
569template <
570 uint8_t DATA_PIN,
571 uint8_t CLOCK_PIN,
572 EOrder RGB_ORDER = RGB,
573 uint32_t SPI_SPEED = DATA_RATE_MHZ(12)
574>
576 DATA_PIN,
577 CLOCK_PIN,
578 RGB_ORDER,
579 SPI_SPEED,
580 kFiveBitGammaCorrectionMode_BitShift,
581 0x00000000,
582 0x00000000
583> {
584};
585
586
588template <
589 uint8_t DATA_PIN,
590 uint8_t CLOCK_PIN,
591 EOrder RGB_ORDER = RGB,
592 uint32_t SPI_SPEED = DATA_RATE_MHZ(40)
593>
595 DATA_PIN,
596 CLOCK_PIN,
597 RGB_ORDER,
598 SPI_SPEED,
599 kFiveBitGammaCorrectionMode_Null,
600 0x00000000,
601 0x00000000
602> {};
603
605template <
606 uint8_t DATA_PIN,
607 uint8_t CLOCK_PIN,
608 EOrder RGB_ORDER = RGB,
609 uint32_t SPI_SPEED = DATA_RATE_MHZ(40)\
610>
612 DATA_PIN,
613 CLOCK_PIN,
614 RGB_ORDER,
615 SPI_SPEED> {
616};
617
618
620//
621// P9813 definition - takes data/clock/select pin values (N.B. should take an SPI definition?)
622//
624
630template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(10)>
631class P9813Controller : public CPixelLEDController<RGB_ORDER> {
633 SPI mSPI;
634
635 void writeBoundary() { mSPI.writeWord(0); mSPI.writeWord(0); }
636
637 FASTLED_FORCE_INLINE void writeLed(uint8_t r, uint8_t g, uint8_t b) {
638 FASTLED_REGISTER uint8_t top = 0xC0 | ((~b & 0xC0) >> 2) | ((~g & 0xC0) >> 4) | ((~r & 0xC0) >> 6);
639 mSPI.writeByte(top); mSPI.writeByte(b); mSPI.writeByte(g); mSPI.writeByte(r);
640 }
641
642public:
643 P9813Controller() {}
644
645 virtual void init() {
646 mSPI.init();
647 }
648
649protected:
651 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
652 mSPI.select();
653
654 writeBoundary();
655 while(pixels.has(1)) {
656 writeLed(pixels.loadAndScale0(), pixels.loadAndScale1(), pixels.loadAndScale2());
657 pixels.advanceData();
658 pixels.stepDithering();
659 }
660 writeBoundary();
661 mSPI.waitFully();
662
663 mSPI.release();
664 }
665
666};
667
668
670//
671// SM16716 definition - takes data/clock/select pin values (N.B. should take an SPI definition?)
672//
674
680template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint32_t SPI_SPEED = DATA_RATE_MHZ(16)>
681class SM16716Controller : public CPixelLEDController<RGB_ORDER> {
683 SPI mSPI;
684
685 void writeHeader() {
686 // Write out 50 zeros to the spi line (6 blocks of 8 followed by two single bit writes)
687 mSPI.select();
688 mSPI.template writeBit<0>(0);
689 mSPI.writeByte(0);
690 mSPI.writeByte(0);
691 mSPI.writeByte(0);
692 mSPI.template writeBit<0>(0);
693 mSPI.writeByte(0);
694 mSPI.writeByte(0);
695 mSPI.writeByte(0);
696 mSPI.waitFully();
697 mSPI.release();
698 }
699
700public:
702
703 virtual void init() {
704 mSPI.init();
705 }
706
707protected:
709 virtual void showPixels(PixelController<RGB_ORDER> & pixels) {
710 // Make sure the FLAG_START_BIT flag is set to ensure that an extra 1 bit is sent at the start
711 // of each triplet of bytes for rgb data
712 // writeHeader();
713 mSPI.template writePixels<FLAG_START_BIT, DATA_NOP, RGB_ORDER>(pixels, NULL);
714 writeHeader();
715 }
716
717};
718
720
721
723//
724// Clockless template instantiations - see clockless.h for how the timing values are used
725//
726
727#ifdef FASTLED_HAS_CLOCKLESS
749
750// Allow clock that clockless controller is based on to have different
751// frequency than the CPU.
752#if !defined(CLOCKLESS_FREQUENCY)
753 #define CLOCKLESS_FREQUENCY F_CPU
754#endif
755
756// We want to force all avr's to use the Trinket controller when running at 8Mhz, because even the 328's at 8Mhz
757// need the more tightly defined timeframes.
758#if defined(__LGT8F__) || (CLOCKLESS_FREQUENCY == 8000000 || CLOCKLESS_FREQUENCY == 16000000 || CLOCKLESS_FREQUENCY == 24000000) || defined(FASTLED_DOXYGEN) // || CLOCKLESS_FREQUENCY == 48000000 || CLOCKLESS_FREQUENCY == 96000000) // 125ns/clock
759
762#define FMUL (CLOCKLESS_FREQUENCY/8000000)
763
766template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
767class GE8822Controller800Khz : public ClocklessController<DATA_PIN, 3 * FMUL, 5 * FMUL, 3 * FMUL, RGB_ORDER, 4> {};
768
771template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
772class LPD1886Controller1250Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 3 * FMUL, 2 * FMUL, RGB_ORDER, 4> {};
773
776template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
777class LPD1886Controller1250Khz_8bit : public ClocklessController<DATA_PIN, 2 * FMUL, 3 * FMUL, 2 * FMUL, RGB_ORDER> {};
778
782template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
783class WS2812Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 5 * FMUL, 3 * FMUL, RGB_ORDER> {};
784
787template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
788class WS2815Controller : public ClocklessController<DATA_PIN, 2 * FMUL, 9 * FMUL, 4 * FMUL, RGB_ORDER> {};
789
792template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
793class WS2811Controller800Khz : public ClocklessController<DATA_PIN, 3 * FMUL, 4 * FMUL, 3 * FMUL, RGB_ORDER> {};
794
797template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
798class DP1903Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 8 * FMUL, 2 * FMUL, RGB_ORDER> {};
799
802template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
803class DP1903Controller400Khz : public ClocklessController<DATA_PIN, 4 * FMUL, 16 * FMUL, 4 * FMUL, RGB_ORDER> {};
804
807template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB> //not tested
808class WS2813Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 4 * FMUL, 3 * FMUL, RGB_ORDER> {};
809
812template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
813class WS2811Controller400Khz : public ClocklessController<DATA_PIN, 4 * FMUL, 10 * FMUL, 6 * FMUL, RGB_ORDER> {};
814
817template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
818class SK6822Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 8 * FMUL, 3 * FMUL, RGB_ORDER> {};
819
822template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
823class SM16703Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 4 * FMUL, 3 * FMUL, RGB_ORDER> {};
824
827template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
828class SK6812Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 3 * FMUL, 4 * FMUL, RGB_ORDER> {};
829
832template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
833class UCS1903Controller400Khz : public ClocklessController<DATA_PIN, 4 * FMUL, 12 * FMUL, 4 * FMUL, RGB_ORDER> {};
834
837template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
838class UCS1903BController800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 4 * FMUL, 4 * FMUL, RGB_ORDER> {};
839
842template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
843class UCS1904Controller800Khz : public ClocklessController<DATA_PIN, 3 * FMUL, 3 * FMUL, 4 * FMUL, RGB_ORDER> {};
844
847template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
848class UCS2903Controller : public ClocklessController<DATA_PIN, 2 * FMUL, 6 * FMUL, 2 * FMUL, RGB_ORDER> {};
849
852template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
853class TM1809Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 5 * FMUL, 3 * FMUL, RGB_ORDER> {};
854
857template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
858class TM1803Controller400Khz : public ClocklessController<DATA_PIN, 6 * FMUL, 9 * FMUL, 6 * FMUL, RGB_ORDER> {};
859
862template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
863class TM1829Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 5 * FMUL, 3 * FMUL, RGB_ORDER, 0, true, 500> {};
864
867template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
868class GW6205Controller400Khz : public ClocklessController<DATA_PIN, 6 * FMUL, 7 * FMUL, 6 * FMUL, RGB_ORDER, 4> {};
869
872template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
873class GW6205Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 4 * FMUL, 4 * FMUL, RGB_ORDER, 4> {};
874
877template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
878class PL9823Controller : public ClocklessController<DATA_PIN, 3 * FMUL, 8 * FMUL, 3 * FMUL, RGB_ORDER> {};
879
880// UCS1912 - Note, never been tested, this is according to the datasheet
881template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
882class UCS1912Controller : public ClocklessController<DATA_PIN, 2 * FMUL, 8 * FMUL, 3 * FMUL, RGB_ORDER> {};
883
884
885#else
886
887// Allow overclocking of the clockless family of leds. 1.2 would be
888// 20% overclocking. In tests WS2812 can be overclocked at 20%, but
889// various manufacturers may be different. This is a global value
890// which is overridable by each supported chipset.
891#ifdef FASTLED_LED_OVERCLOCK
892#warning "FASTLED_LED_OVERCLOCK has been changed to FASTLED_OVERCLOCK. Please update your code."
893#define FASTLED_OVERCLOCK FASTLED_LED_OVERCLOCK
894#endif
895
896#ifndef FASTLED_OVERCLOCK
897#define FASTLED_OVERCLOCK 1.0
898#else
899#ifndef FASTLED_OVERCLOCK_SUPPRESS_WARNING
900#warning "FASTLED_OVERCLOCK is now active, #define FASTLED_OVERCLOCK_SUPPRESS_WARNING to disable this warning"
901#endif
902#endif
903
904// WS2812 can be overclocked pretty aggressively, however, there are
905// some excellent articles that you should read about WS2812 overclocking
906// and corruption for a large number of LEDs.
907// https://wp.josh.com/2014/05/16/why-you-should-give-your-neopixel-bits-room-to-breathe/
908// https://wp.josh.com/2014/05/13/ws2812-neopixels-are-not-so-finicky-once-you-get-to-know-them/
909#ifndef FASTLED_OVERCLOCK_WS2812
910#define FASTLED_OVERCLOCK_WS2812 FASTLED_OVERCLOCK
911#endif
912
913#ifndef FASTLED_OVERCLOCK_WS2811
914#define FASTLED_OVERCLOCK_WS2811 FASTLED_OVERCLOCK
915#endif
916
917#ifndef FASTLED_OVERCLOCK_WS2813
918#define FASTLED_OVERCLOCK_WS2813 FASTLED_OVERCLOCK
919#endif
920
921#ifndef FASTLED_OVERCLOCK_WS2815
922#define FASTLED_OVERCLOCK_WS2815 FASTLED_OVERCLOCK
923#endif
924
925#ifndef FASTLED_OVERCLOCK_SK6822
926#define FASTLED_OVERCLOCK_SK6822 FASTLED_OVERCLOCK
927#endif
928
929#ifndef FASTLED_OVERCLOCK_SK6812
930#define FASTLED_OVERCLOCK_SK6812 FASTLED_OVERCLOCK
931#endif
932
935#if FASTLED_CLOCKLESS_USES_NANOSECONDS
936// just use raw nanosecond values for the teensy4
937#define C_NS(_NS) _NS
938#else
939#define C_NS(_NS) (((_NS * ((CLOCKLESS_FREQUENCY / 1000000L)) + 999)) / 1000)
940#endif
941
942// Allow overclocking various LED chipsets in the clockless family.
943// Clocked chips like the APA102 don't need this because they allow
944// you to control the clock speed directly.
945#define C_NS_WS2812(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_WS2812)))
946#define C_NS_WS2811(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_WS2811)))
947#define C_NS_WS2813(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_WS2813)))
948#define C_NS_WS2815(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_WS2815)))
949#define C_NS_SK6822(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_SK6822)))
950#define C_NS_SK6812(_NS) (C_NS(int(_NS / FASTLED_OVERCLOCK_SK6812)))
951
952
953
954// At T=0 : the line is raised hi to start a bit
955// At T=T1 : the line is dropped low to transmit a zero bit
956// At T=T1+T2 : the line is dropped low to transmit a one bit
957// At T=T1+T2+T3 : the cycle is concluded (next bit can be sent)
958//
959// Python script to calculate the values for T1, T2, and T3 for FastLED:
960// Note: there is a discussion on whether this python script is correct or not:
961// https://github.com/FastLED/FastLED/issues/1806
962//
963// print("Enter the values of T0H, T0L, T1H, T1L, in nanoseconds: ")
964// T0H = int(input(" T0H: "))
965// T0L = int(input(" T0L: "))
966// T1H = int(input(" T1H: "))
967// T1L = int(input(" T1L: "))
968//
969// duration = max(T0H + T0L, T1H + T1L)
970//
971// print("The max duration of the signal is: ", duration)
972//
973// T1 = T0H
974// T2 = T1H
975// T3 = duration - T0H - T0L
976//
977// print("T1: ", T1)
978// print("T2: ", T2)
979// print("T3: ", T3)
980
981
982// GE8822 - 350ns 660ns 350ns
983template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
984class GE8822Controller800Khz : public ClocklessController<DATA_PIN, C_NS(350), C_NS(660), C_NS(350), RGB_ORDER, 4> {};
985
986// GW6205@400khz - 800ns, 800ns, 800ns
987template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
988class GW6205Controller400Khz : public ClocklessController<DATA_PIN, C_NS(800), C_NS(800), C_NS(800), RGB_ORDER, 4> {};
989
990// GW6205@400khz - 400ns, 400ns, 400ns
991template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
992class GW6205Controller800Khz : public ClocklessController<DATA_PIN, C_NS(400), C_NS(400), C_NS(400), RGB_ORDER, 4> {};
993
994// UCS1903 - 500ns, 1500ns, 500ns
995template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
996class UCS1903Controller400Khz : public ClocklessController<DATA_PIN, C_NS(500), C_NS(1500), C_NS(500), RGB_ORDER> {};
997
998// UCS1903B - 400ns, 450ns, 450ns
999template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1000class UCS1903BController800Khz : public ClocklessController<DATA_PIN, C_NS(400), C_NS(450), C_NS(450), RGB_ORDER> {};
1001
1002// UCS1904 - 400ns, 400ns, 450ns
1003template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1004class UCS1904Controller800Khz : public ClocklessController<DATA_PIN, C_NS(400), C_NS(400), C_NS(450), RGB_ORDER> {};
1005
1006// UCS2903 - 250ns, 750ns, 250ns
1007template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1008class UCS2903Controller : public ClocklessController<DATA_PIN, C_NS(250), C_NS(750), C_NS(250), RGB_ORDER> {};
1009
1010// TM1809 - 350ns, 350ns, 550ns
1011template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1012class TM1809Controller800Khz : public ClocklessController<DATA_PIN, C_NS(350), C_NS(350), C_NS(450), RGB_ORDER> {};
1013
1014// WS2811 - 320ns, 320ns, 640ns
1015template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1016class WS2811Controller800Khz : public ClocklessController<DATA_PIN, C_NS_WS2811(320), C_NS_WS2811(320), C_NS_WS2811(640), RGB_ORDER> {};
1017
1018// WS2813 - 320ns, 320ns, 640ns
1019template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1020class WS2813Controller : public ClocklessController<DATA_PIN, C_NS_WS2813(320), C_NS_WS2813(320), C_NS_WS2813(640), RGB_ORDER> {};
1021
1022#ifndef FASTLED_WS2812_T1
1023#define FASTLED_WS2812_T1 250
1024#endif
1025
1026#ifndef FASTLED_WS2812_T2
1027#define FASTLED_WS2812_T2 625
1028#endif
1029
1030#ifndef FASTLED_WS2812_T3
1031#define FASTLED_WS2812_T3 375
1032#endif
1033
1034
1035#if defined(__IMXRT1062__) && !defined(FASTLED_NOT_USES_OBJECTFLED)
1036#if defined(FASTLED_USES_OBJECTFLED)
1037#warning "FASTLED_USES_OBJECTFLED is now implicit for Teensy 4.0/4.1 for WS2812 and is no longer needed."
1038#endif
1039template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1041 public fl::ClocklessController_ObjectFLED_WS2812<
1042 DATA_PIN,
1043 RGB_ORDER> {
1044 public:
1045 typedef fl::ClocklessController_ObjectFLED_WS2812<DATA_PIN, RGB_ORDER> Base;
1046 WS2812Controller800Khz(): Base(FASTLED_OVERCLOCK) {}
1047};
1048#elif defined(FASTLED_USES_ESP32S3_I2S)
1049#include "platforms/esp/32/clockless_i2s_esp32s3.h"
1050template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1052 public fl::ClocklessController_I2S_Esp32_WS2812<
1053 DATA_PIN,
1054 RGB_ORDER
1055 > {};
1056#else
1057// WS2812 - 250ns, 625ns, 375ns
1058template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1059class WS2812Controller800Khz : public ClocklessController<
1060 DATA_PIN,
1061 C_NS_WS2812(FASTLED_WS2812_T1),
1062 C_NS_WS2812(FASTLED_WS2812_T2),
1063 C_NS_WS2812(FASTLED_WS2812_T3),
1064 RGB_ORDER> {};
1065#endif // defined(FASTLED_USES_OBJECTFLED)
1066
1067
1068// WS2811@400khz - 800ns, 800ns, 900ns
1069template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1070class WS2811Controller400Khz : public ClocklessController<DATA_PIN, C_NS_WS2811(800), C_NS_WS2811(800), C_NS_WS2811(900), RGB_ORDER> {};
1071
1072template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1073class WS2815Controller : public ClocklessController<DATA_PIN, C_NS_WS2815(250), C_NS_WS2815(1090), C_NS_WS2815(550), RGB_ORDER> {};
1074
1075// 750NS, 750NS, 750NS
1076template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1077class TM1803Controller400Khz : public ClocklessController<DATA_PIN, C_NS(700), C_NS(1100), C_NS(700), RGB_ORDER> {};
1078
1079template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1080class TM1829Controller800Khz : public ClocklessController<DATA_PIN, C_NS(340), C_NS(340), C_NS(550), RGB_ORDER, 0, true, 500> {};
1081
1082template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1083class TM1829Controller1600Khz : public ClocklessController<DATA_PIN, C_NS(100), C_NS(300), C_NS(200), RGB_ORDER, 0, true, 500> {};
1084
1085template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1086class LPD1886Controller1250Khz : public ClocklessController<DATA_PIN, C_NS(200), C_NS(400), C_NS(200), RGB_ORDER, 4> {};
1087
1088template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1089class LPD1886Controller1250Khz_8bit : public ClocklessController<DATA_PIN, C_NS(200), C_NS(400), C_NS(200), RGB_ORDER> {};
1090
1091
1092template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1093class SK6822Controller : public ClocklessController<DATA_PIN, C_NS_SK6822(375), C_NS_SK6822(1000), C_NS_SK6822(375), RGB_ORDER> {};
1094
1095template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1096class SK6812Controller : public ClocklessController<DATA_PIN, C_NS_SK6812(300), C_NS_SK6812(300), C_NS_SK6812(600), RGB_ORDER> {};
1097
1098template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1099class SM16703Controller : public ClocklessController<DATA_PIN, C_NS(300), C_NS(600), C_NS(300), RGB_ORDER> {};
1100
1101template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1102class PL9823Controller : public ClocklessController<DATA_PIN, C_NS(350), C_NS(1010), C_NS(350), RGB_ORDER> {};
1103
1104// UCS1912 - Note, never been tested, this is according to the datasheet
1105template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB>
1106class UCS1912Controller : public ClocklessController<DATA_PIN, C_NS(250), C_NS(1000), C_NS(350), RGB_ORDER> {};
1107#endif
1109
1110
1111// WS2816 - is an emulated controller that emits 48 bit pixels by forwarding
1112// them to a platform specific WS2812 controller. The WS2812 controller
1113// has to output twice as many 24 bit pixels.
1114template <uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
1116 : public CPixelLEDController<RGB_ORDER,
1117 WS2812Controller800Khz<DATA_PIN, RGB>::LANES_VALUE,
1118 WS2812Controller800Khz<DATA_PIN, RGB>::MASK_VALUE> {
1119
1120public:
1121
1122 // ControllerT is a helper class. It subclasses the device controller class
1123 // and has three methods to call the three protected methods we use.
1124 // This is janky, but redeclaring public methods protected in a derived class
1125 // is janky, too.
1126
1127 // N.B., byte order must be RGB.
1130 friend class WS2816Controller<DATA_PIN, RGB_ORDER>;
1131 void *callBeginShowLeds(int size) { return ControllerBaseT::beginShowLeds(size); }
1132 void callShow(CRGB *data, int nLeds, uint8_t brightness) {
1133 ControllerBaseT::show(data, nLeds, brightness);
1134 }
1135 void callEndShowLeds(void *data) { ControllerBaseT::endShowLeds(data); }
1136 };
1137
1138 static const int LANES = ControllerT::LANES_VALUE;
1139 static const uint32_t MASK = ControllerT::MASK_VALUE;
1140
1141 WS2816Controller() {}
1143 mController.setLeds(nullptr, 0);
1144 delete [] mData;
1145 }
1146
1147 virtual void *beginShowLeds(int size) override {
1148 mController.setEnabled(true);
1149 void *result = mController.callBeginShowLeds(2 * size);
1150 mController.setEnabled(false);
1151 return result;
1152 }
1153
1154 virtual void endShowLeds(void *data) override {
1155 mController.setEnabled(true);
1156 mController.callEndShowLeds(data);
1157 mController.setEnabled(false);
1158 }
1159
1161 // Ensure buffer is large enough
1162 ensureBuffer(pixels.size());
1163
1164 // expand and copy all the pixels
1165 size_t out_index = 0;
1166 while (pixels.has(1)) {
1167 pixels.stepDithering();
1168
1169 uint16_t s0, s1, s2;
1170 pixels.loadAndScale_WS2816_HD(&s0, &s1, &s2);
1171 uint8_t b0_hi = s0 >> 8;
1172 uint8_t b0_lo = s0 & 0xFF;
1173 uint8_t b1_hi = s1 >> 8;
1174 uint8_t b1_lo = s1 & 0xFF;
1175 uint8_t b2_hi = s2 >> 8;
1176 uint8_t b2_lo = s2 & 0xFF;
1177
1178 mData[out_index] = CRGB(b0_hi, b0_lo, b1_hi);
1179 mData[out_index + 1] = CRGB(b1_lo, b2_hi, b2_lo);
1180
1181 pixels.advanceData();
1182 out_index += 2;
1183 }
1184
1185 // ensure device controller won't modify color values
1186 mController.setCorrection(CRGB(255, 255, 255));
1187 mController.setTemperature(CRGB(255, 255, 255));
1188 mController.setDither(DISABLE_DITHER);
1189
1190 // output the data stream
1191 mController.setEnabled(true);
1192#ifdef BOUNCE_SUBCLASS
1193 mController.callShow(mData, 2 * pixels.size(), 255);
1194#else
1195 mController.show(mData, 2 * pixels.size(), 255);
1196#endif
1197 mController.setEnabled(false);
1198 }
1199
1200private:
1201 void init() override {
1202 mController.init();
1203 mController.setEnabled(false);
1204 }
1205
1206 void ensureBuffer(int size_8bit) {
1207 int size_16bit = 2 * size_8bit;
1208 if (mController.size() != size_16bit) {
1209 delete [] mData;
1210 CRGB *new_leds = new CRGB[size_16bit];
1211 mData = new_leds;
1212 mController.setLeds(new_leds, size_16bit);
1213 }
1214 }
1215
1216 CRGB *mData = 0;
1217 ControllerT mController;
1218};
1219
1220
1221#endif
1223
1225
1226#endif
APA102 high definition controller class.
Definition chipsets.h:536
APA102 controller class.
Definition chipsets.h:371
virtual void init() override
Initialize the LED controller.
Definition chipsets.h:420
virtual void showPixels(PixelController< RGB_ORDER > &pixels) override
Send the LED data to the strip.
Definition chipsets.h:426
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 int size()
How many LEDs does this controller manage?
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:803
DP1903 controller class @ 800 KHz.
Definition chipsets.h:798
GE8822 controller class.
Definition chipsets.h:767
GW6205 controller class @ 400 KHz.
Definition chipsets.h:868
UCS1904 controller class @ 800 KHz.
Definition chipsets.h:873
HD107 is just the APA102 with a default 40Mhz clock rate.
Definition chipsets.h:602
HD107HD is just the APA102HD with a default 40Mhz clock rate.
Definition chipsets.h:615
LPD1886 controller class.
Definition chipsets.h:777
LPD1886 controller class.
Definition chipsets.h:772
LPD6803 controller class (LPD1101).
Definition chipsets.h:308
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:324
virtual void init()
Initialize the LED controller.
Definition chipsets.h:318
LPD8806 controller class.
Definition chipsets.h:227
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:252
virtual void init()
Initialize the LED controller.
Definition chipsets.h:245
P9813 controller class.
Definition chipsets.h:631
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:651
virtual void init()
Initialize the LED controller.
Definition chipsets.h:645
PL9823 controller class.
Definition chipsets.h:878
virtual void showPixels(PixelController< RGB_ORDER, LANES, MASK > &pixels) override
Send the LED data to the strip.
Definition chipsets.h:149
SK6812 controller class.
Definition chipsets.h:828
SK6822 controller class.
Definition chipsets.h:818
SK9822 controller class.
Definition chipsets.h:583
SK9822 controller class.
Definition chipsets.h:561
SM16703 controller class.
Definition chipsets.h:823
SM16716 controller class.
Definition chipsets.h:681
virtual void init()
Initialize the LED controller.
Definition chipsets.h:703
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:709
Hardware SPI output.
Definition fastspi.h:51
TM1803 controller class.
Definition chipsets.h:858
TM1809 controller class.
Definition chipsets.h:853
TM1829 controller class.
Definition chipsets.h:863
UCS1903B controller class.
Definition chipsets.h:838
UCS1903 controller class @ 400 KHz.
Definition chipsets.h:833
UCS1904 controller class.
Definition chipsets.h:843
UCS2903 controller class.
Definition chipsets.h:848
WS2801 controller class.
Definition chipsets.h:270
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
Definition chipsets.h:287
virtual void init()
Initialize the controller.
Definition chipsets.h:279
WS2803 controller class.
Definition chipsets.h:297
WS2811 controller class @ 400 KHz.
Definition chipsets.h:813
WS2811 controller class @ 800 KHz.
Definition chipsets.h:793
WS2812 controller class @ 800 KHz.
Definition chipsets.h:783
WS2813 controller class.
Definition chipsets.h:808
WS2815 controller class @ 400 KHz.
Definition chipsets.h:788
virtual void showPixels(PixelController< RGB_ORDER, LANES, MASK > &pixels) override
Send the LED data to the strip.
Definition chipsets.h:1160
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