|
| | EspSpiDevice (EspSpiBus *parent, const hf_spi_device_config_t &config) |
| | Construct a new EspSpiDevice.
|
| |
| | ~EspSpiDevice () noexcept override |
| | Destructor. Automatically deinitializes the device if needed.
|
| |
| bool | Initialize () noexcept override |
| | Initialize the SPI device (no-op if already initialized).
|
| |
| bool | Deinitialize () noexcept override |
| | Deinitialize the SPI device and free resources.
|
| |
| bool | MarkAsDeinitialized () noexcept |
| | Mark the device as deinitialized without ESP-IDF cleanup.
|
| |
| hf_spi_err_t | Transfer (const hf_u8_t *tx_data, hf_u8_t *rx_data, hf_u16_t length, hf_u32_t timeout_ms=0) noexcept override |
| | Perform a full-duplex SPI transfer.
|
| |
| const void * | GetDeviceConfig () const noexcept override |
| | Get the device configuration for this SPI device.
|
| |
| hf_spi_err_t | AcquireBus (hf_u32_t timeout_ms) noexcept |
| | Acquire the SPI bus for exclusive use by this device.
|
| |
| hf_spi_err_t | ReleaseBus () noexcept |
| | Release the bus lock after operations.
|
| |
| spi_device_handle_t | GetHandle () const noexcept |
| | Get the ESP-IDF device handle.
|
| |
| const hf_spi_device_config_t & | GetConfig () const noexcept |
| | Get the device configuration.
|
| |
| hf_spi_err_t | GetActualClockFrequency (hf_u32_t &actual_freq_hz) const noexcept |
| | Get the actual clock frequency used by this device.
|
| |
| virtual | ~BaseSpi () noexcept=default |
| | Virtual destructor ensures proper cleanup in derived classes.
|
| |
| | BaseSpi (const BaseSpi &)=delete |
| |
| BaseSpi & | operator= (const BaseSpi &)=delete |
| |
| | BaseSpi (BaseSpi &&)=delete |
| |
| BaseSpi & | operator= (BaseSpi &&)=delete |
| |
| bool | EnsureInitialized () noexcept |
| | Ensures that the SPI bus is initialized (lazy initialization).
|
| |
| bool | EnsureDeinitialized () noexcept |
| | Ensures that the SPI bus is deinitialized (lazy deinitialization).
|
| |
| bool | IsInitialized () const noexcept |
| | Checks if the bus is initialized.
|
| |
| virtual bool | Open () noexcept |
| | Legacy compatibility: Open and initialize the SPI bus.
|
| |
| virtual bool | Close () noexcept |
| | Legacy compatibility: Close and de-initialize the SPI bus.
|
| |
| virtual bool | Transfer (const hf_u8_t *tx_data, hf_u8_t *rx_data, hf_u16_t length) noexcept |
| | Legacy compatibility: Transfer with boolean return.
|
| |
| virtual hf_spi_err_t | Write (const hf_u8_t *data, hf_u16_t length, hf_u32_t timeout_ms=0) noexcept |
| | Write data to SPI bus.
|
| |
| virtual hf_spi_err_t | Read (hf_u8_t *data, hf_u16_t length, hf_u32_t timeout_ms=0) noexcept |
| | Read data from SPI bus.
|
| |
| virtual bool | Write (const hf_u8_t *data, hf_u16_t length) noexcept |
| | Legacy compatibility: Write with boolean return.
|
| |
| virtual bool | Read (hf_u8_t *data, hf_u16_t length) noexcept |
| | Legacy compatibility: Read with boolean return.
|
| |
| virtual bool | WriteByte (hf_u8_t data) noexcept |
| | Write single byte to SPI bus.
|
| |
| virtual bool | ReadByte (hf_u8_t &data) noexcept |
| | Read single byte from SPI bus.
|
| |
| virtual bool | TransferByte (hf_u8_t tx_data, hf_u8_t &rx_data) noexcept |
| | Write single byte and read response.
|
| |
| virtual hf_spi_err_t | ResetStatistics () noexcept |
| | Reset SPI operation statistics.
|
| |
| virtual hf_spi_err_t | ResetDiagnostics () noexcept |
| | Reset SPI diagnostic information.
|
| |
| virtual hf_spi_err_t | GetStatistics (hf_spi_statistics_t &statistics) const noexcept |
| | Get SPI operation statistics.
|
| |
| virtual hf_spi_err_t | GetDiagnostics (hf_spi_diagnostics_t &diagnostics) const noexcept |
| | Get SPI diagnostic information.
|
| |
Represents a single SPI device on a bus (CS/config/handle).
Inherits from BaseSpi and delegates transfers to the parent bus. Provides full configuration and control for a single SPI device, including DMA, queueing, and advanced ESP-IDF v5.5+ features.
- Note
- Thread-safe. All operations are protected by PlatformMutex.