ESP32 implementation of the TLE92466ED CommInterface.
More...
#include <esp32_tle92466ed_bus.hpp>
|
| | Esp32Tle92466edSpiBus () |
| | Constructor with default SPI configuration.
|
| |
| | Esp32Tle92466edSpiBus (const SPIConfig &config) noexcept |
| | Constructor with custom SPI configuration.
|
| |
| | ~Esp32Tle92466edSpiBus () noexcept |
| | Destructor - cleans up SPI resources.
|
| |
| auto | Init () noexcept -> CommResult< void > |
| | Initialize the CommInterface (must be called before use)
|
| |
| auto | Deinit () noexcept -> CommResult< void > |
| | Deinitialize the CommInterface.
|
| |
| auto | Transfer32 (uint32_t tx_data) noexcept -> CommResult< uint32_t > |
| | Transfer 32-bit data via SPI (full-duplex)
|
| |
| auto | TransferMulti (std::span< const uint32_t > tx_data, std::span< uint32_t > rx_data) noexcept -> CommResult< void > |
| | Transfer multiple 32-bit words via SPI.
|
| |
| auto | Delay (uint32_t microseconds) noexcept -> CommResult< void > |
| | Delay for specified duration.
|
| |
| auto | Configure (const tle92466ed::SPIConfig &config) noexcept -> CommResult< void > |
| | Configure SPI parameters.
|
| |
| bool | IsReady () const noexcept |
| | Check if hardware is ready for communication.
|
| |
| CommError | GetLastError () const noexcept |
| | Get the last error that occurred.
|
| |
| auto | ClearErrors () noexcept -> CommResult< void > |
| | Clear any pending errors.
|
| |
| auto | getConfig () const noexcept -> const SPIConfig & |
| | Get the current SPI configuration.
|
| |
| auto | GpioSet (CtrlPin pin, GpioSignal signal) noexcept -> CommResult< void > |
| | Set GPIO control pin signal.
|
| |
| auto | GpioRead (CtrlPin pin) noexcept -> CommResult< GpioSignal > |
| | Read GPIO control pin signal.
|
| |
| void | Log (LogLevel level, const char *tag, const char *format, va_list args) noexcept |
| | Log a message with specified severity level and tag (ESP_LOG implementation)
|
| |
| auto | isInitialized () const noexcept -> bool |
| | Check if CommInterface is initialized.
|
| |
|
| auto | initializeGPIO () noexcept -> CommResult< void > |
| | Initialize GPIO pins (RESN, EN, FAULTN)
|
| |
| auto | initializeSPI () noexcept -> CommResult< void > |
| | Initialize SPI bus.
|
| |
| auto | addSPIDevice () noexcept -> CommResult< void > |
| | Add SPI device to the bus.
|
| |
|
| static constexpr const char * | TAG = "Esp32TleComm" |
| | Logging tag.
|
| |
ESP32 implementation of the TLE92466ED CommInterface.
This class provides the platform-specific implementation for ESP32, handling SPI communication with proper timing and error handling.
◆ Esp32Tle92466edSpiBus() [1/2]
| Esp32Tle92466edSpiBus::Esp32Tle92466edSpiBus |
( |
| ) |
|
|
inline |
Constructor with default SPI configuration.
◆ Esp32Tle92466edSpiBus() [2/2]
| Esp32Tle92466edSpiBus::Esp32Tle92466edSpiBus |
( |
const SPIConfig & | config | ) |
|
|
inlineexplicitnoexcept |
Constructor with custom SPI configuration.
- Parameters
-
| config | SPI configuration parameters |
◆ ~Esp32Tle92466edSpiBus()
| Esp32Tle92466edSpiBus::~Esp32Tle92466edSpiBus |
( |
| ) |
|
|
inlinenoexcept |
Destructor - cleans up SPI resources.
Defined inline to avoid incomplete type issues with std::unique_ptr
◆ addSPIDevice()
| auto Esp32Tle92466edSpiBus::addSPIDevice |
( |
| ) |
-> CommResult<void> |
|
inlineprivatenoexcept |
Add SPI device to the bus.
- Returns
- CommResult<void> Success or error
◆ ClearErrors()
| auto Esp32Tle92466edSpiBus::ClearErrors |
( |
| ) |
-> CommResult<void> |
|
inlinenoexcept |
Clear any pending errors.
- Returns
- CommResult<void> Success or error
◆ Configure()
| auto Esp32Tle92466edSpiBus::Configure |
( |
const tle92466ed::SPIConfig & | config | ) |
-> CommResult<void> |
|
inlinenoexcept |
Configure SPI parameters.
- Parameters
-
| config | New SPI configuration |
- Returns
- CommResult<void> Success or error
◆ Deinit()
| auto Esp32Tle92466edSpiBus::Deinit |
( |
| ) |
-> CommResult<void> |
|
inlinenoexcept |
Deinitialize the CommInterface.
- Returns
- CommResult<void> Success or error
◆ Delay()
| auto Esp32Tle92466edSpiBus::Delay |
( |
uint32_t | microseconds | ) |
-> CommResult<void> |
|
inlinenoexcept |
Delay for specified duration.
- Parameters
-
| microseconds | Duration to delay in microseconds |
- Returns
- CommResult<void> Success or error
◆ getConfig()
| auto Esp32Tle92466edSpiBus::getConfig |
( |
| ) |
const -> const SPIConfig& |
|
inlinenoexcept |
Get the current SPI configuration.
- Returns
- Current SPI configuration
◆ GetLastError()
| CommError Esp32Tle92466edSpiBus::GetLastError |
( |
| ) |
const |
|
inlinenoexcept |
Get the last error that occurred.
- Returns
- CommError The last error code
◆ GpioRead()
| auto Esp32Tle92466edSpiBus::GpioRead |
( |
CtrlPin | pin | ) |
-> CommResult<GpioSignal> |
|
inlinenoexcept |
Read GPIO control pin signal.
- Parameters
-
| pin | Control pin to read (FAULTN) |
- Returns
- CommResult<GpioSignal> Pin signal level or error
- Note
- The mapping from physical GPIO level to GpioSignal is the responsibility of this bus implementation. FAULTN is active-low: physical 0 = ACTIVE.
◆ GpioSet()
| auto Esp32Tle92466edSpiBus::GpioSet |
( |
CtrlPin | pin, |
|
|
GpioSignal | signal ) -> CommResult<void> |
|
inlinenoexcept |
Set GPIO control pin signal.
- Parameters
-
| pin | Control pin to set (RESN or EN) |
| signal | GPIO signal level (ACTIVE or INACTIVE) |
- Returns
- CommResult<void> Success or error
- Note
- The mapping from GpioSignal to physical GPIO level is the responsibility of this bus implementation based on the board's active-level design. For TLE92466ED: RESN is active-low, EN is active-high.
◆ Init()
| auto Esp32Tle92466edSpiBus::Init |
( |
| ) |
-> CommResult<void> |
|
inlinenoexcept |
Initialize the CommInterface (must be called before use)
- Returns
- CommResult<void> Success or error
◆ initializeGPIO()
| auto Esp32Tle92466edSpiBus::initializeGPIO |
( |
| ) |
-> CommResult<void> |
|
inlineprivatenoexcept |
Initialize GPIO pins (RESN, EN, FAULTN)
- Returns
- CommResult<void> Success or error
◆ initializeSPI()
| auto Esp32Tle92466edSpiBus::initializeSPI |
( |
| ) |
-> CommResult<void> |
|
inlineprivatenoexcept |
Initialize SPI bus.
- Returns
- CommResult<void> Success or error
◆ isInitialized()
| auto Esp32Tle92466edSpiBus::isInitialized |
( |
| ) |
const -> bool |
|
inlinenoexcept |
Check if CommInterface is initialized.
- Returns
- true if initialized, false otherwise
◆ IsReady()
| bool Esp32Tle92466edSpiBus::IsReady |
( |
| ) |
const |
|
inlinenoexcept |
Check if hardware is ready for communication.
- Returns
- true if ready, false otherwise
◆ Log()
| void Esp32Tle92466edSpiBus::Log |
( |
LogLevel | level, |
|
|
const char * | tag, |
|
|
const char * | format, |
|
|
va_list | args ) |
|
inlinenoexcept |
Log a message with specified severity level and tag (ESP_LOG implementation)
- Parameters
-
| level | Log severity level |
| tag | Tag/component name for the log message |
| format | Format string (printf-style) |
| args | va_list of arguments |
◆ Transfer32()
| auto Esp32Tle92466edSpiBus::Transfer32 |
( |
uint32_t | tx_data | ) |
-> CommResult<uint32_t> |
|
inlinenoexcept |
Transfer 32-bit data via SPI (full-duplex)
- Parameters
-
| tx_data | The 32-bit data to transmit |
- Returns
- CommResult<uint32_t> Received 32-bit data or error
◆ TransferMulti()
| auto Esp32Tle92466edSpiBus::TransferMulti |
( |
std::span< const uint32_t > | tx_data, |
|
|
std::span< uint32_t > | rx_data ) -> CommResult<void> |
|
inlinenoexcept |
Transfer multiple 32-bit words via SPI.
- Parameters
-
| tx_data | Span of transmit data (32-bit words) |
| rx_data | Span to store received data (32-bit words) |
- Returns
- CommResult<void> Success or error
◆ config_
◆ initialized_
| bool Esp32Tle92466edSpiBus::initialized_ = false |
|
private |
◆ last_error_
| CommError Esp32Tle92466edSpiBus::last_error_ = CommError::None |
|
private |
Last error that occurred.
◆ spi_device_
| spi_device_handle_t Esp32Tle92466edSpiBus::spi_device_ = nullptr |
|
private |
◆ TAG
| constexpr const char* Esp32Tle92466edSpiBus::TAG = "Esp32TleComm" |
|
staticconstexprprivate |
The documentation for this class was generated from the following file: