TLE92466ED Driver 0.1.0-preview
Modern C++23 driver for Infineon TLE92466ED Six-Channel Low-Side Solenoid Driver
Loading...
Searching...
No Matches
ESP32C6_HAL Class Reference

ESP32-C6 implementation of the TLE92466ED HAL interface. More...

#include <ESP32C6_HAL.hpp>

Inheritance diagram for ESP32C6_HAL:
[legend]
Collaboration diagram for ESP32C6_HAL:
[legend]

Classes

struct  SPIConfig
 SPI configuration structure for ESP32-C6. More...
 

Public Member Functions

 ESP32C6_HAL ()
 Constructor with default SPI configuration.
 
 ESP32C6_HAL (const SPIConfig &config)
 Constructor with custom SPI configuration.
 
 ~ESP32C6_HAL () override
 Destructor - cleans up SPI resources.
 
auto initialize () noexcept -> std::expected< void, HALError >
 Initialize the HAL (must be called before use)
 
auto spiTransfer (std::span< const uint8_t > txData, std::span< uint8_t > rxData) noexcept -> std::expected< void, HALError > override
 Perform SPI transfer (32-bit frames for TLE92466ED)
 
void delayMicroseconds (uint32_t us) noexcept override
 Microsecond delay implementation.
 
auto getConfig () const noexcept -> const SPIConfig &
 Get the current SPI configuration.
 
auto isInitialized () const noexcept -> bool
 Check if HAL is initialized.
 

Private Member Functions

auto initializeSPI () noexcept -> std::expected< void, HALError >
 Initialize SPI bus.
 
auto addSPIDevice () noexcept -> std::expected< void, HALError >
 Add SPI device to the bus.
 

Private Attributes

SPIConfig config_
 SPI configuration.
 
spi_device_handle_t spi_device_ = nullptr
 SPI device handle.
 
bool initialized_ = false
 Initialization state.
 

Static Private Attributes

static constexpr const char * TAG = "ESP32C6_HAL"
 Logging tag.
 

Detailed Description

ESP32-C6 implementation of the TLE92466ED HAL interface.

This class provides the platform-specific implementation for ESP32-C6, handling SPI communication with proper timing and error handling.

Constructor & Destructor Documentation

◆ ESP32C6_HAL() [1/2]

ESP32C6_HAL::ESP32C6_HAL ( )
inline

Constructor with default SPI configuration.

◆ ESP32C6_HAL() [2/2]

ESP32C6_HAL::ESP32C6_HAL ( const SPIConfig & config)
explicit

Constructor with custom SPI configuration.

Parameters
configSPI configuration parameters

◆ ~ESP32C6_HAL()

ESP32C6_HAL::~ESP32C6_HAL ( )
override

Destructor - cleans up SPI resources.

Member Function Documentation

◆ addSPIDevice()

auto ESP32C6_HAL::addSPIDevice ( ) -> std::expected<void, HALError>
privatenoexcept

Add SPI device to the bus.

Returns
std::expected<void, HALError> Success or error

◆ delayMicroseconds()

void ESP32C6_HAL::delayMicroseconds ( uint32_t us)
overridenoexcept

Microsecond delay implementation.

Parameters
usDelay in microseconds

◆ getConfig()

auto ESP32C6_HAL::getConfig ( ) const -> const SPIConfig&
inlinenoexcept

Get the current SPI configuration.

Returns
Current SPI configuration

◆ initialize()

auto ESP32C6_HAL::initialize ( ) -> std::expected<void, HALError>
noexcept

Initialize the HAL (must be called before use)

Returns
std::expected<void, HALError> Success or error

◆ initializeSPI()

auto ESP32C6_HAL::initializeSPI ( ) -> std::expected<void, HALError>
privatenoexcept

Initialize SPI bus.

Returns
std::expected<void, HALError> Success or error

◆ isInitialized()

auto ESP32C6_HAL::isInitialized ( ) const -> bool
inlinenoexcept

Check if HAL is initialized.

Returns
true if initialized, false otherwise

◆ spiTransfer()

auto ESP32C6_HAL::spiTransfer ( std::span< const uint8_t > txData,
std::span< uint8_t > rxData ) -> std::expected<void, HALError>
overridenoexcept

Perform SPI transfer (32-bit frames for TLE92466ED)

Parameters
txDataTransmit data buffer
rxDataReceive data buffer
Returns
std::expected<void, HALError> Success or error

Member Data Documentation

◆ config_

SPIConfig ESP32C6_HAL::config_
private

SPI configuration.

◆ initialized_

bool ESP32C6_HAL::initialized_ = false
private

Initialization state.

◆ spi_device_

spi_device_handle_t ESP32C6_HAL::spi_device_ = nullptr
private

SPI device handle.

◆ TAG

constexpr const char* ESP32C6_HAL::TAG = "ESP32C6_HAL"
staticconstexprprivate

Logging tag.


The documentation for this class was generated from the following files: