Optimised fork of bikeNomad's WS2811 LED control library. Supports KL25Z and KL46Z
Fork of Multi_WS2811 by
Optimised to use far less RAM than the original.
Capable of running up to 8 strings of 240 LEDs each with plenty of RAM to spare on the KL46Z.
Should run at least three strings of 240 LEDs on the KL25Z (RAM limited)
Diff: WS2811.h
- Revision:
- 3:2b5b03a3c0a5
- Parent:
- 2:1c2c9c8788a8
- Child:
- 4:586d20c99dbf
--- a/WS2811.h Wed Apr 02 10:53:43 2014 +0000 +++ b/WS2811.h Wed Apr 02 11:54:27 2014 +0000 @@ -12,6 +12,10 @@ // // Modified by Ned Konz, December 2013. // Using three-phase DMA ala Paul Stoffegren's version. +// +// Modified by richard Thompson, Marhc 2014. +// Uses 8-bit DMA transfers instead of 32-bit, uses 1/4 of the RAM. +// Now capable of running 240 LEDs on one pin #ifndef MBED_WS2811_H #define MBED_WS2811_H @@ -24,15 +28,26 @@ extern "C" void DMA0_IRQHandler(); extern "C" void TPM0_IRQHandler(); +/** +* WS2811/n +* LED Strip controller +*/ class WS2811 : public LedStrip { public: + /** Set up the LED strip + @param n Number of LEDs on the strip. Must be less than MAX_LEDS_PER_STRIP + @param pinNumber Pin number on PORTD. 0-7. + */ WS2811(unsigned n, unsigned pinNumber); virtual void begin(); virtual void show(); virtual void blank(); + /** Send a level update to all the WS2811 LED strips + * All updates happen in parallel, ensure all (max. 8) strips have complete data before calling this. + */ static void startDMA(); private: