5#include "pixel_iterator.h"
9#include "platforms/shared/spi_pixel_writer.h"
11#include "platforms/spi_output_template.h"
28template <
int DATA_PIN, fl::u8 CLOCK_PIN, EOrder RGB_ORDER = RGB, fl::u32 SPI_SPEED = DATA_RATE_MHZ(12) >
30 typedef fl::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>
SPI;
37 SPI* pSPI =
static_cast<SPI*
>(context);
38 pSPI->writeBytesValueRaw(0, ((len*3+63)>>6));
47 #if defined(FL_IS_ESP32)
61 fl::writePixelsToSPI<0, LPD8806_ADJUST, RGB_ORDER>(pixels,
mSPI, &
mSPI);
74 static const fl::u8 frame[] = {
96 return (num_leds * 3) + ((num_leds * 3 + 63) / 64);
108template <
int DATA_PIN, fl::u8 CLOCK_PIN, EOrder RGB_ORDER = RGB, fl::u32 SPI_SPEED = DATA_RATE_MHZ(12)>
110 typedef fl::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>
SPI;
118 #if defined(FL_IS_ESP32)
135 while(pixels.has(1)) {
138 command |= (pixels.loadAndScale0() & 0xF8) << 7;
139 command |= (pixels.loadAndScale1() & 0xF8) << 2;
140 mSPI.writeByte((command >> 8) & 0xFF);
141 command |= pixels.loadAndScale2() >> 3 ;
142 mSPI.writeByte(command & 0xFF);
144 pixels.stepDithering();
145 pixels.advanceData();
148 mSPI.endTransaction();
CPixelLEDController(RegistrationMode mode) FL_NO_EXCEPT
fl::SPIOutput< DATA_PIN, CLOCK_PIN, SPI_SPEED > SPI
void startBoundary() FL_NO_EXCEPT
LPD6803Controller() FL_NO_EXCEPT
void endBoundary(int nLeds) FL_NO_EXCEPT
virtual void init() FL_NO_EXCEPT
Initialize the LED controller.
virtual void showPixels(PixelController< RGB_ORDER > &pixels) FL_NO_EXCEPT
Send the LED data to the strip.
static FASTLED_FORCE_INLINE fl::u8 adjust(FASTLED_REGISTER fl::u8 data) FL_NO_EXCEPT
static FASTLED_FORCE_INLINE void postBlock(int len, void *context=nullptr) FL_NO_EXCEPT
virtual void showPixels(PixelController< RGB_ORDER > &pixels) FL_NO_EXCEPT
Send the LED data to the strip.
static constexpr fl::u8 getPaddingByte() FL_NO_EXCEPT
Get the protocol-safe padding byte for LPD8806 Used for quad-SPI lane padding when strips have differ...
LPD8806Controller() FL_NO_EXCEPT
static constexpr size_t getPaddingLEDFrameSize() FL_NO_EXCEPT
Get the size of the padding LED frame in bytes.
static fl::span< const fl::u8 > getPaddingLEDFrame() FL_NO_EXCEPT
Get a black LED frame for synchronized latching Used for quad-SPI lane padding to ensure all strips l...
fl::SPIOutput< DATA_PIN, CLOCK_PIN, SPI_SPEED > SPI
static constexpr size_t calculateBytes(size_t num_leds) FL_NO_EXCEPT
Calculate total byte count for LPD8806 protocol Used for quad-SPI buffer pre-allocation.
virtual void init() FL_NO_EXCEPT
Initialize the LED controller.
CLEDController & setSpiBus(Esp32SpiBus bus) FL_NO_EXCEPT
Select an ESP-IDF SPI host for this clocked controller before init().
fl::CLEDController CLEDController
#define FASTLED_REGISTER
Helper macro to replace the deprecated 'register' keyword if we're using modern C++ where it's been r...
#define FASTLED_FORCE_INLINE
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP
#define FL_DISABLE_WARNING_DEPRECATED_REGISTER
Esp32SpiBus
ESP-IDF SPI host selection for an individual clocked LED controller.
Includes defintions for RGB and HSV pixels.