22#include "platforms/shared/spi_types.h"
65 u32 clock_speed_hz = 0xffffffff);
88 explicit operator bool()
const {
return ok(); }
118 template<
typename... Spans>
134 bool wait(u32 timeout_ms = 0xFFFFFFFF);
153template<
typename T =
void>
~Spi() FL_NOEXCEPT
Destructor (defined out-of-line in spi.cpp.hpp to keep MultiLaneDevice destructor out of callers' com...
WriteResult write(Spans &&... lanes)
Write multiple lanes in parallel (variadic template)
Spi() FL_NOEXCEPT
Default constructor - creates device in error state.
SPIError error() const
Get error code (only meaningful if !ok())
bool wait(u32 timeout_ms=0xFFFFFFFF)
Wait for async write operation to complete.
const spi::MultiLaneDevice * get() const
Spi & operator=(Spi &&other) FL_NOEXCEPT
Move assignment.
spi::MultiLaneDevice * get()
Get access to underlying device (for advanced operations)
fl::unique_ptr< spi::MultiLaneDevice > device
bool ok() const
Check if device was created and initialized successfully.
SPI Device - RAII wrapper for multi-lane SPI.
Multi-lane SPI device (1-8 independent LED strips)
Handle for asynchronous SPI operations.
SPI Device class for single-channel communication.
Configuration structure for SPI communication.
Lane class for multi-lane SPI devices.
Multi-lane SPI device for 2-8 independent LED strips.
constexpr T && forward(typename remove_reference< T >::type &t) FL_NOEXCEPT
fl::result< T, SPIError > Result
spi_output_mode_t
SPI output mode for multi-lane devices.
@ SPI_HW
Use DMA-capable hardware (Async or Sync), supports 1/2/4/8 lanes depending on platform.
spi::Transaction SpiTransaction
@ NOT_INITIALIZED
Object not initialized.
spi::Result< T > SpiResult
Base definition for an LED controller.
Configuration for SPI device (supports 1-8 lanes)
Result of a write operation.
Transaction class for asynchronous SPI operations.
Result type for SPI write operations.