15#include "platforms/shared/spi_types.h"
168 template<
typename... Spans>
175 for (
size_t i = 0; i <
sizeof...(lanes); i++) {
void push_back(const T &value) FL_NOEXCEPT
Single lane in a multi-lane SPI device.
~MultiLaneDevice() FL_NOEXCEPT
Destructor - releases hardware resources.
bool waitComplete(u32 timeout_ms=(fl::numeric_limits< u32 >::max)())
Wait for pending transmission to complete.
bool isReady() const
Check if device is initialized.
WriteResult writeImpl(fl::span< const fl::span< const u8 > > lane_data)
Internal implementation - write all lanes atomically.
Lane & lane(size_t lane_id)
Get access to a specific lane.
void end()
Shutdown hardware and release resources.
const Config & getConfig() const
Get current configuration.
fl::optional< fl::task::Error > begin()
Initialize hardware.
fl::unique_ptr< Impl > pImpl
Result< void > flush()
Flush all lanes (transpose and transmit)
size_t numLanes() const
Get number of lanes.
MultiLaneDevice(const Config &config)
Construct multi-lane device.
WriteResult write(Spans &&... lanes)
Convenience method - write multiple lanes in parallel (variadic template)
bool isBusy() const
Check if transmission is in progress.
bool wait()
Convenience method - wait for transmission to complete.
Configuration structure for SPI communication.
constexpr T && forward(typename remove_reference< T >::type &t) FL_NOEXCEPT
fl::result< T, SPIError > Result
constexpr size_t MAX_SPI_LANES
Maximum number of SPI lanes supported (hardware: 1-8, software: up to 32)
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
Base definition for an LED controller.
Promise-based fluent API for FastLED - standalone async primitives.
Result of a write operation.
u32 clock_speed_hz
Clock speed in Hz (0xffffffff = as fast as possible)
u8 mode
SPI mode (CPOL/CPHA)
u8 clock_pin
Shared clock pin (SCK)
fl::vector< u8 > data_pins
Data pins (1-8 pins)
Transaction class for asynchronous SPI operations.
Result type for SPI write operations.