diff options
-rw-r--r-- | FastLED.h | 3 | ||||
-rw-r--r-- | chipsets.h | 12 | ||||
-rw-r--r-- | clockless_trinket.h | 3 |
3 files changed, 14 insertions, 4 deletions
@@ -4,6 +4,8 @@ // #define NO_CORRECTION 1 // #define NO_DITHERING 1 +#define xstr(s) str(s) +#define str(s) #s #define FASTLED_VERSION 2001000 #include "controller.h" @@ -52,6 +54,7 @@ template<uint8_t DATA_PIN, EOrder RGB_ORDER> class WS2811 : public WS2811Control template<uint8_t DATA_PIN, EOrder RGB_ORDER> class WS2811_400 : public WS2811Controller400Khz<DATA_PIN, RGB_ORDER> {}; template<uint8_t DATA_PIN, EOrder RGB_ORDER> class GW6205 : public GW6205Controller800Khz<DATA_PIN, RGB_ORDER> {}; template<uint8_t DATA_PIN, EOrder RGB_ORDER> class GW6205_400 : public GW6205Controller400Khz<DATA_PIN, RGB_ORDER> {}; +template<uint8_t DATA_PIN, EOrder RGB_ORDER> class LPD1886 : public LPD1886Controller1250Khz<DATA_PIN, RGB_ORDER> {}; // template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint8_t SPI_SPEED = DATA_RATE_MHZ(20)> class LPD8806 : public LPD8806Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED> {}; // template <uint8_t DATA_PIN, uint8_t CLOCK_PIN, EOrder RGB_ORDER = RGB, uint8_t SPI_SPEED = DATA_RATE_MHZ(1)> class WS2801 : public WS2801Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED> {}; @@ -273,7 +273,11 @@ public: // need the more tightly defined timeframes. #if (F_CPU == 8000000 || F_CPU == 16000000 || F_CPU == 24000000 || F_CPU == 48000000 || F_CPU == 96000000) // 125ns/clock #define FMUL (F_CPU/8000000) -// WS2811@8Mhz 2 clocks, 5 clocks, 3 clocks +// LPD1886 +template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB> +class LPD1886Controller1250Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 3 * FMUL, 2 * FMUL, RGB_ORDER, 4> {}; + +// WS2811@800khz 2 clocks, 5 clocks, 3 clocks template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB> class WS2811Controller800Khz : public ClocklessController<DATA_PIN, 2 * FMUL, 5 * FMUL, 3 * FMUL, RGB_ORDER> {}; @@ -365,6 +369,12 @@ template <uint8_t DATA_PIN, EOrder RGB_ORDER = RGB> class TM1829Controller1600Khz : public ClocklessController<DATA_PIN, NS(100), NS(300), NS(200), RGB_ORDER, 0, true, 500> {}; #if NO_TIME(100, 300, 200) #warning "Not enough clock cycles available for TM1829@1.6Mhz" +#endif + +template <uint8_t DATA_PIN, EORder RGB_ORDER = RGB> +class LPD1886Controller1250Khz : public ClocklessController<DATA_PIN, NS(200), NS(400), NS(200), RGB_ORDER, 4> {}; +#if NO_TIME(200,400,200) +#warning "Not enough clock cycles for LPD1886" #endif #endif diff --git a/clockless_trinket.h b/clockless_trinket.h index 16d3a261..55cd3f2b 100644 --- a/clockless_trinket.h +++ b/clockless_trinket.h @@ -132,9 +132,6 @@ public: : /* clobber registers */ -#define xstr(s) str(s) -#define str(s) #s - // 1 cycle, write hi to the port #define HI1 if((int)(FastPin<DATA_PIN>::port())-0x20 < 64) { asm __volatile__("out %[PORT], %[hi]" ASM_VARS ); } else { *FastPin<DATA_PIN>::port()=hi; } // 1 cycle, write lo to the port |