|
TLE92466ED Driver 0.1.0-preview
Modern C++23 driver for Infineon TLE92466ED Six-Channel Low-Side Solenoid Driver
|
Namespaces | |
| namespace | CentralReg |
| Central and global register addresses. | |
| namespace | CH_CONFIG |
| CH_CONFIG register bit definitions. | |
| namespace | CH_CTRL |
| CH_CTRL register bit definitions. | |
| namespace | CH_CTRL_REG |
| Channel CTRL register bit definitions. | |
| namespace | CH_MODE |
| Channel MODE register bit definitions. | |
| namespace | ChannelBase |
| Per-channel register base addresses. | |
| namespace | ChannelReg |
| Per-channel register offsets (add to channel base address) | |
| namespace | DeviceID |
| Device identification and version information. | |
| namespace | DITHER_CTRL |
| DITHER_CTRL register bit definitions. | |
| namespace | DITHER_STEP |
| DITHER_STEP register bit definitions. | |
| namespace | FB_STAT |
| FB_STAT register bit definitions. | |
| namespace | GLOBAL_CONFIG |
| GLOBAL_CONFIG register bit definitions. | |
| namespace | GLOBAL_DIAG0 |
| GLOBAL_DIAG0 register bit definitions. | |
| namespace | GLOBAL_DIAG1 |
| GLOBAL_DIAG1 register bit definitions. | |
| namespace | GLOBAL_DIAG2 |
| GLOBAL_DIAG2 register bit definitions. | |
| namespace | SETPOINT |
| SETPOINT register bit definitions (per channel) | |
Classes | |
| struct | ChannelConfig |
| Channel configuration structure. More... | |
| struct | ChannelDiagnostics |
| Channel diagnostic information. More... | |
| struct | DeviceStatus |
| Global device status structure. More... | |
| class | Driver |
| Main TLE92466ED driver class. More... | |
| class | ExampleHAL |
| Example HAL implementation for 32-bit SPI. More... | |
| struct | GlobalConfig |
| Global configuration structure. More... | |
| class | HAL |
| Abstract Hardware Abstraction Layer (HAL) base class. More... | |
| struct | SPIConfig |
| SPI transaction configuration. More... | |
| union | SPIFrame |
| 32-bit SPI frame structure for TLE92466ED communication More... | |
Concepts | |
| concept | HALInterface |
| Concept to verify a type implements the HAL interface. | |
Typedefs | |
| template<typename T > | |
| using | DriverResult = std::expected<T, DriverError> |
| Driver result type using std::expected. | |
| template<typename T > | |
| using | HALResult = std::expected<T, HALError> |
| Result type for HAL operations using std::expected (C++23) | |
Enumerations | |
| enum class | DriverError : uint8_t { None = 0 , NotInitialized , HardwareError , InvalidChannel , InvalidParameter , DeviceNotResponding , WrongDeviceID , RegisterError , CRCError , FaultDetected , ConfigurationError , TimeoutError , WrongMode , SPIFrameError , WriteToReadOnly } |
| Driver error codes. More... | |
| enum class | HALError : uint8_t { None = 0 , BusError , Timeout , InvalidParameter , ChipselectError , TransferError , HardwareNotReady , BufferOverflow , CRCError , UnknownError } |
| Error codes for HAL operations. More... | |
| enum class | ReplyMode : uint8_t { REPLY_16BIT = 0b00 , REPLY_22BIT = 0b01 , CRITICAL_FAULT = 0b10 , RESERVED = 0b11 } |
| SPI Reply Mode enumeration. More... | |
| enum class | SPIStatus : uint8_t { NO_ERROR = 0b00000 , SPI_FRAME_ERROR = 0b00001 , CRC_ERROR = 0b00010 , WRITE_RO_REG = 0b00011 , INTERNAL_BUS_FAULT = 0b00100 } |
| SPI Status codes. More... | |
| enum class | Channel : uint8_t { CH0 = 0 , CH1 = 1 , CH2 = 2 , CH3 = 3 , CH4 = 4 , CH5 = 5 , COUNT = 6 } |
| Channel enumeration. More... | |
| enum class | ChannelMode : uint8_t { OFF = 0x0 , ICC = 0x1 , DIRECT_DRIVE_SPI = 0x2 , DIRECT_DRIVE_DRV0 = 0x3 , DIRECT_DRIVE_DRV1 = 0x4 , FREE_RUN_MEAS = 0xC } |
| Channel operation mode. More... | |
| enum class | SlewRate : uint8_t { SLOW_1V0_US = 0 , MEDIUM_2V5_US = 1 , FAST_5V0_US = 2 , FASTEST_10V0_US = 3 } |
| Slew rate enumeration. More... | |
| enum class | DiagCurrent : uint8_t { I_80UA = 0 , I_190UA = 1 , I_720UA = 2 , I_1250UA = 3 } |
| OFF-state diagnostic current. More... | |
| enum class | ParallelPair : uint8_t { NONE = 0 , CH0_CH3 = 1 , CH1_CH2 = 2 , CH4_CH5 = 3 } |
| Parallel operation pairs. More... | |
Functions | |
| constexpr uint16_t | get_channel_base (Channel channel) noexcept |
| Get channel base address. | |
| constexpr uint16_t | get_channel_register (Channel channel, uint16_t offset) noexcept |
| Get channel register address. | |
| constexpr uint8_t | to_index (Channel ch) noexcept |
| Convert channel to index. | |
| constexpr bool | is_valid_channel (Channel ch) noexcept |
| Validate channel number. | |
| constexpr uint8_t | calculate_crc8_j1850 (const uint8_t *data, size_t length) noexcept |
| Calculate SAE J1850 CRC-8. | |
| uint8_t | calculate_frame_crc (const SPIFrame &frame) noexcept |
| Calculate CRC for SPI frame. | |
| bool | verify_frame_crc (const SPIFrame &frame) noexcept |
| Verify CRC in received frame. | |
| using TLE92466ED::DriverResult = std::expected<T, DriverError> |
Driver result type using std::expected.
| using TLE92466ED::HALResult = std::expected<T, HALError> |
Result type for HAL operations using std::expected (C++23)
| T | The success type |
This provides a modern, safe way to return either a success value or an error.
|
strong |
|
strong |
|
strong |
|
strong |
Driver error codes.
| Enumerator | |
|---|---|
| None | No error. |
| NotInitialized | Driver not initialized. |
| HardwareError | HAL communication error. |
| InvalidChannel | Invalid channel number. |
| InvalidParameter | Invalid parameter value. |
| DeviceNotResponding | Device not responding to SPI. |
| WrongDeviceID | Incorrect device ID read. |
| RegisterError | Register read/write error. |
| CRCError | CRC mismatch in SPI communication. |
| FaultDetected | Device fault detected. |
| ConfigurationError | Configuration failed. |
| TimeoutError | Operation timeout. |
| WrongMode | Operation not allowed in current mode. |
| SPIFrameError | SPI frame error from device. |
| WriteToReadOnly | Attempted write to read-only register. |
|
strong |
Error codes for HAL operations.
This enumeration defines all possible error conditions that can occur during hardware communication with the TLE92466ED IC.
|
strong |
|
strong |
|
strong |
|
strong |
|
constexprnoexcept |
Calculate SAE J1850 CRC-8.
Polynomial: 0x1D (x^8 + x^4 + x^3 + x^2 + 1) Initial value: 0xFF Final XOR: 0xFF
| data | Pointer to data bytes |
| length | Number of bytes |
|
inlinenoexcept |
Calculate CRC for SPI frame.
| frame | SPI frame (CRC field should be 0) |
|
constexprnoexcept |
Get channel base address.
| channel | Channel number (0-5) |
|
constexprnoexcept |
Get channel register address.
| channel | Channel number |
| offset | Register offset from channel base |
|
constexprnoexcept |
Validate channel number.
|
constexprnoexcept |
Convert channel to index.
|
inlinenoexcept |
Verify CRC in received frame.
| frame | Received SPI frame |