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

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.
 

Typedef Documentation

◆ DriverResult

template<typename T >
using TLE92466ED::DriverResult = std::expected<T, DriverError>

Driver result type using std::expected.

◆ HALResult

template<typename T >
using TLE92466ED::HALResult = std::expected<T, HALError>

Result type for HAL operations using std::expected (C++23)

Template Parameters
TThe success type

This provides a modern, safe way to return either a success value or an error.

Enumeration Type Documentation

◆ Channel

enum class TLE92466ED::Channel : uint8_t
strong

Channel enumeration.

Enumerator
CH0 

Channel 0.

CH1 

Channel 1.

CH2 

Channel 2.

CH3 

Channel 3.

CH4 

Channel 4.

CH5 

Channel 5.

COUNT 

Total number of channels.

◆ ChannelMode

enum class TLE92466ED::ChannelMode : uint8_t
strong

Channel operation mode.

Enumerator
OFF 

Channel off.

ICC 

Integrated Current Control.

DIRECT_DRIVE_SPI 

Direct drive via SPI TON register.

DIRECT_DRIVE_DRV0 

Direct drive via DRV0 pin.

DIRECT_DRIVE_DRV1 

Direct drive via DRV1 pin.

FREE_RUN_MEAS 

Free running measurement mode.

◆ DiagCurrent

enum class TLE92466ED::DiagCurrent : uint8_t
strong

OFF-state diagnostic current.

Enumerator
I_80UA 

80 µA

I_190UA 

190 µA

I_720UA 

720 µA

I_1250UA 

1250 µA

◆ DriverError

enum class TLE92466ED::DriverError : uint8_t
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.

◆ HALError

enum class TLE92466ED::HALError : uint8_t
strong

Error codes for HAL operations.

This enumeration defines all possible error conditions that can occur during hardware communication with the TLE92466ED IC.

Enumerator
None 

No error occurred.

BusError 

SPI bus communication error.

Timeout 

Operation timed out.

InvalidParameter 

Invalid parameter passed to function.

ChipselectError 

Chip select control failed.

TransferError 

Data transfer failed.

HardwareNotReady 

Hardware not initialized or ready.

BufferOverflow 

Buffer size exceeded.

CRCError 

CRC mismatch error.

UnknownError 

Unknown error occurred.

◆ ParallelPair

enum class TLE92466ED::ParallelPair : uint8_t
strong

Parallel operation pairs.

Enumerator
NONE 

No parallel operation.

CH0_CH3 

Channels 0 and 3 paralleled.

CH1_CH2 

Channels 1 and 2 paralleled.

CH4_CH5 

Channels 4 and 5 paralleled.

◆ ReplyMode

enum class TLE92466ED::ReplyMode : uint8_t
strong

SPI Reply Mode enumeration.

Enumerator
REPLY_16BIT 

16-bit reply frame

REPLY_22BIT 

22-bit reply frame (extended data)

CRITICAL_FAULT 

Critical fault frame.

RESERVED 

Reserved.

◆ SlewRate

enum class TLE92466ED::SlewRate : uint8_t
strong

Slew rate enumeration.

Enumerator
SLOW_1V0_US 

1.0 V/µs

MEDIUM_2V5_US 

2.5 V/µs

FAST_5V0_US 

5.0 V/µs

FASTEST_10V0_US 

10.0 V/µs

◆ SPIStatus

enum class TLE92466ED::SPIStatus : uint8_t
strong

SPI Status codes.

Enumerator
NO_ERROR 

No error.

SPI_FRAME_ERROR 

SPI frame error.

CRC_ERROR 

Parity/CRC error.

WRITE_RO_REG 

Write to read-only register.

INTERNAL_BUS_FAULT 

Internal bus fault.

Function Documentation

◆ calculate_crc8_j1850()

constexpr uint8_t TLE92466ED::calculate_crc8_j1850 ( const uint8_t * data,
size_t length )
constexprnoexcept

Calculate SAE J1850 CRC-8.

Polynomial: 0x1D (x^8 + x^4 + x^3 + x^2 + 1) Initial value: 0xFF Final XOR: 0xFF

Parameters
dataPointer to data bytes
lengthNumber of bytes
Returns
CRC-8 value

◆ calculate_frame_crc()

uint8_t TLE92466ED::calculate_frame_crc ( const SPIFrame & frame)
inlinenoexcept

Calculate CRC for SPI frame.

Parameters
frameSPI frame (CRC field should be 0)
Returns
Calculated CRC value

◆ get_channel_base()

constexpr uint16_t TLE92466ED::get_channel_base ( Channel channel)
constexprnoexcept

Get channel base address.

Parameters
channelChannel number (0-5)
Returns
Base address for channel registers

◆ get_channel_register()

constexpr uint16_t TLE92466ED::get_channel_register ( Channel channel,
uint16_t offset )
constexprnoexcept

Get channel register address.

Parameters
channelChannel number
offsetRegister offset from channel base
Returns
Complete register address

◆ is_valid_channel()

constexpr bool TLE92466ED::is_valid_channel ( Channel ch)
constexprnoexcept

Validate channel number.

◆ to_index()

constexpr uint8_t TLE92466ED::to_index ( Channel ch)
constexprnoexcept

Convert channel to index.

◆ verify_frame_crc()

bool TLE92466ED::verify_frame_crc ( const SPIFrame & frame)
inlinenoexcept

Verify CRC in received frame.

Parameters
frameReceived SPI frame
Returns
true if CRC is valid