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));
55 fl::writePixelsToSPI<0, LPD8806_ADJUST, RGB_ORDER>(pixels,
mSPI, &
mSPI);
68 static const fl::u8 frame[] = {
90 return (num_leds * 3) + ((num_leds * 3 + 63) / 64);
102template <
int DATA_PIN, fl::u8 CLOCK_PIN, EOrder RGB_ORDER = RGB, fl::u32 SPI_SPEED = DATA_RATE_MHZ(12)>
104 typedef fl::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>
SPI;
108 void endBoundary(
int nLeds) {
int nDWords = (nLeds/32);
do {
mSPI.writeByte(0xFF);
mSPI.writeByte(0x00);
mSPI.writeByte(0x00);
mSPI.writeByte(0x00); }
while(nDWords--); }
123 while(pixels.
has(1)) {
128 mSPI.writeByte((command >> 8) & 0xFF);
130 mSPI.writeByte(command & 0xFF);
136 mSPI.endTransaction();
CPixelLEDController(RegistrationMode mode)
fl::SPIOutput< DATA_PIN, CLOCK_PIN, SPI_SPEED > SPI
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
virtual void init()
Initialize the LED controller.
void endBoundary(int nLeds)
LPD6803Controller() FL_NOEXCEPT
static FASTLED_FORCE_INLINE fl::u8 adjust(FASTLED_REGISTER fl::u8 data)
static FASTLED_FORCE_INLINE void postBlock(int len, void *context=nullptr)
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
static constexpr size_t getPaddingLEDFrameSize()
Get the size of the padding LED frame in bytes.
static fl::span< const fl::u8 > getPaddingLEDFrame()
Get a black LED frame for synchronized latching Used for quad-SPI lane padding to ensure all strips l...
static constexpr size_t calculateBytes(size_t num_leds)
Calculate total byte count for LPD8806 protocol Used for quad-SPI buffer pre-allocation.
fl::SPIOutput< DATA_PIN, CLOCK_PIN, SPI_SPEED > SPI
virtual void init()
Initialize the LED controller.
static constexpr fl::u8 getPaddingByte()
Get the protocol-safe padding byte for LPD8806 Used for quad-SPI lane padding when strips have differ...
LPD8806Controller() FL_NOEXCEPT
Includes defintions for RGB and HSV pixels.
#define FASTLED_FORCE_INLINE
#define FL_DISABLE_WARNING_PUSH
#define FL_DISABLE_WARNING_POP
#define FL_DISABLE_WARNING_DEPRECATED_REGISTER
FASTLED_FORCE_INLINE int size() const
Get the length of the LED strip.
FASTLED_FORCE_INLINE fl::u8 loadAndScale0(int lane, fl::u8 scale)
non-template alias of loadAndScale<0>()
FASTLED_FORCE_INLINE void advanceData()
Advance the data pointer forward, adjust position counter.
FASTLED_FORCE_INLINE fl::u8 loadAndScale1(int lane, fl::u8 scale)
non-template alias of loadAndScale<1>()
FASTLED_FORCE_INLINE bool has(int n)
Do we have n pixels left to process?
FASTLED_FORCE_INLINE void stepDithering()
Step the dithering forward - creates triangular wave that toggles between pixels.
FASTLED_FORCE_INLINE fl::u8 loadAndScale2(int lane, fl::u8 scale)
non-template alias of loadAndScale<2>()