|
TLE92466ED Driver 0.1.0-preview
Modern C++23 driver for Infineon TLE92466ED Six-Channel Low-Side Solenoid Driver
|
Example HAL implementation for 32-bit SPI. More...
#include <example_hal.hpp>
Public Member Functions | |
| ExampleHAL (int spi_device=0, int cs_pin=10) noexcept | |
| Constructor. | |
| HALResult< void > | init () noexcept override |
| Initialize SPI hardware for 32-bit communication. | |
| HALResult< void > | deinit () noexcept override |
| Deinitialize SPI hardware. | |
| HALResult< uint32_t > | transfer32 (uint32_t tx_data) noexcept override |
| Transfer 32-bit data via SPI. | |
| HALResult< void > | transfer_multi (std::span< const uint32_t > tx_data, std::span< uint32_t > rx_data) noexcept override |
| Transfer multiple 32-bit words. | |
| HALResult< void > | chip_select () noexcept override |
| Assert chip select. | |
| HALResult< void > | chip_deselect () noexcept override |
| Deassert chip select. | |
| HALResult< void > | delay (uint32_t microseconds) noexcept override |
| Delay for specified duration. | |
| HALResult< void > | configure (const SPIConfig &config) noexcept override |
| Configure SPI parameters. | |
| bool | is_ready () const noexcept override |
| Check if hardware is ready. | |
| HALError | get_last_error () const noexcept override |
| Get last error. | |
| HALResult< void > | clear_errors () noexcept override |
| Clear errors. | |
Public Member Functions inherited from TLE92466ED::HAL | |
| virtual | ~HAL ()=default |
| Virtual destructor for polymorphic behavior. | |
Private Attributes | |
| int | spi_device_ |
| SPI device identifier. | |
| int | cs_pin_ |
| Chip select pin. | |
| bool | initialized_ |
| Initialization status. | |
| HALError | last_error_ |
| Last error code. | |
| SPIConfig | config_ |
| Current SPI configuration. | |
Additional Inherited Members | |
Protected Member Functions inherited from TLE92466ED::HAL | |
| HAL ()=default | |
| Protected constructor to prevent direct instantiation. | |
| HAL (const HAL &)=delete | |
| Prevent copying. | |
| HAL & | operator= (const HAL &)=delete |
| HAL (HAL &&) noexcept=default | |
| Allow moving. | |
| HAL & | operator= (HAL &&) noexcept=default |
Example HAL implementation for 32-bit SPI.
This is a template implementation showing how to create a platform-specific HAL for 32-bit SPI communication.
Key Requirements:
|
inlinenoexcept |
Constructor.
| spi_device | Platform-specific SPI device identifier |
| cs_pin | Chip select pin identifier |
|
inlineoverridevirtualnoexcept |
Deassert chip select.
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Assert chip select.
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Clear errors.
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Configure SPI parameters.
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Deinitialize SPI hardware.
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Delay for specified duration.
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Get last error.
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Initialize SPI hardware for 32-bit communication.
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Check if hardware is ready.
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Transfer 32-bit data via SPI.
This is the core communication function. It must transfer 4 bytes in MSB-first order (big-endian).
Implements TLE92466ED::HAL.
|
inlineoverridevirtualnoexcept |
Transfer multiple 32-bit words.
Implements TLE92466ED::HAL.
|
private |
Current SPI configuration.
|
private |
Chip select pin.
|
private |
Initialization status.
|
private |
Last error code.
|
private |
SPI device identifier.