|
FastLED 3.9.15
|
Unified stateless bit-interleaving transposer for multi-lane SPI parallel LED transmission.
This provides a unified functional approach to bit-interleaving for multi-lane SPI transmission. All state is managed by the caller - the transposer only performs the conversion.
transpose2() - 2 parallel data lanestranspose4() - 4 parallel data lanestranspose8() - 8 parallel data lanestranspose16() - 16 parallel data lanesTraditional SPI sends one byte at a time on a single data line (MOSI). Multi-lane SPI uses N data lines (D0-DN) to send N bits in parallel per clock cycle.
The transposer converts per-lane data into interleaved format:
Example: 2-way SPI
LED strips often have different lengths. To ensure all strips latch simultaneously (updating LEDs at the same time), shorter strips are padded with black LED frames at the BEGINNING of the data stream.
Common padding patterns:
These invisible black LEDs are prepended so all strips finish transmitting simultaneously, providing synchronized visual updates across all parallel strips.
Definition at line 583 of file transposition.h.
#include <transposition.h>
Classes | |
| struct | LaneData |
| Lane data structure: payload + padding frame. More... | |
Static Public Member Functions | |
| static bool | transpose16 (const fl::optional< LaneData > lanes[16], fl::span< u8 > output, const char **error=nullptr) FL_NOEXCEPT |
| Transpose 16 lanes of data into interleaved hex-SPI format. | |
| static bool | transpose2 (const fl::optional< LaneData > &lane0, const fl::optional< LaneData > &lane1, fl::span< u8 > output, const char **error=nullptr) FL_NOEXCEPT |
| Transpose 2 lanes of data into interleaved dual-SPI format. | |
| static bool | transpose4 (const fl::optional< LaneData > &lane0, const fl::optional< LaneData > &lane1, const fl::optional< LaneData > &lane2, const fl::optional< LaneData > &lane3, fl::span< u8 > output, const char **error=nullptr) FL_NOEXCEPT |
| Transpose 4 lanes of data into interleaved quad-SPI format. | |
| static bool | transpose8 (const fl::optional< LaneData > lanes[8], fl::span< u8 > output, const char **error=nullptr) FL_NOEXCEPT |
| Transpose 8 lanes of data into interleaved octal-SPI format. | |
Static Private Member Functions | |
| static u8 | getLaneByte (const LaneData &lane, size_t byte_idx, size_t max_size) FL_NOEXCEPT |
| Get byte from lane at given index, handling padding automatically. | |