|
TLE92466ED Driver 2.0.0
API 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 | CLK_DIV |
| CLK_DIV bit definitions. | |
| namespace | CTRL_INT_THRESH |
| CTRL_INT_THRESH register bit definitions. | |
| namespace | DeviceID |
| Device identification and version information. | |
| namespace | DIAG_ERR_CHGR |
| DIAG_ERR_CHGR bit layout and address helpers. | |
| namespace | DIAG_WARN_CHGR |
| DIAG_WARN_CHGR bit layout and address helpers. | |
| namespace | DITHER |
| Dither configuration helper functions. | |
| namespace | DITHER_CLK_DIV |
| DITHER_CLK_DIV register bitfield definitions and helpers. | |
| namespace | DITHER_CTRL |
| DITHER_CTRL register bit definitions. | |
| namespace | DITHER_STEP |
| DITHER_STEP register bit definitions. | |
| namespace | FAULT_MASK0 |
| FAULT_MASK bit definitions. | |
| namespace | FAULT_MASK1 |
| namespace | FAULT_MASK2 |
| namespace | FB_FEEDBACK |
| Per-channel averaged feedback decoders for FB_DC, FB_I_AVG, FB_VBAT. | |
| namespace | FB_I_AVG_s16 |
| FB_I_AVG_s16 decoder (calibration only — see the warning below). | |
| namespace | FB_IMIN_IMAX |
| Decoder for the FB_IMIN_IMAX register (ChannelReg::FB_IMIN_IMAX). | |
| namespace | FB_INT_THRESH |
| FB_INT_THRESH feedback reader. | |
| namespace | FB_PERIOD_MIN_MAX |
| FB_PERIOD_MIN_MAX decoder. | |
| 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 (datasheet Rev 1.2 §5.3.2.7). | |
| namespace | INTEGRATOR_LIMIT |
| INTEGRATOR_LIMIT register bit definitions. | |
| namespace | PERIOD |
| PERIOD register bit definitions and helper functions. | |
| namespace | PIN_STAT |
| PIN_STAT bit definitions. | |
| namespace | SETPOINT |
| SETPOINT register bit definitions (per channel) | |
| namespace | SFF_BIST |
| SFF_BIST bit definitions. | |
| namespace | TON |
| TON register bit definitions. | |
| namespace | VBAT_THRESHOLD |
| VBAT threshold helper functions. | |
| namespace | VOLTAGE_FEEDBACK |
| Voltage feedback helper functions for FB_VOLTAGE1 and FB_VOLTAGE2. | |
| namespace | WD_RELOAD |
| WD_RELOAD register bit definitions. | |
Classes | |
| struct | BistResult |
| Result of RunSffBist(). More... | |
| struct | ChannelConfig |
| Channel configuration structure. More... | |
| struct | ChannelCurrentSample |
| One channel's decoded average current from a batched freeze/read. More... | |
| struct | ChannelDiagnostics |
| Channel diagnostic information. More... | |
| struct | ChannelErrorFlags |
| Latched error bits for one channel (DIAG_ERR_CHGRx only). More... | |
| struct | ChannelFeedback |
| High-resolution per-channel feedback snapshot (Phase 6). More... | |
| struct | CriticalFaultFlags |
| Helper structure for critical fault frame flags. More... | |
| struct | CurrentFeedbackBatch |
| Result of one Tle92466edDriver::SampleChannelCurrents call. More... | |
| struct | DeviceStatus |
| Global device status structure. More... | |
| struct | DitherSetup |
| High-level dither configuration (Phase 4 superset of ConfigureDither). More... | |
| class | Driver |
| Main TLE92466ED driver class. More... | |
| struct | FaultReport |
| Comprehensive fault report structure. More... | |
| struct | GlobalConfig |
| Global configuration structure. More... | |
| struct | PinStatus |
Snapshot returned by ReadPinStatus(). More... | |
| struct | SPIConfig |
| SPI transaction configuration. More... | |
| union | SPIFrame |
| 32-bit SPI frame structure for TLE92466ED communication More... | |
| class | SpiInterface |
| CRTP-based Communication Interface template class. More... | |
| struct | SupplyMonitorSelfTestResult |
| Result of RunSupplyMonitorSelfTest(). More... | |
| struct | SupplyVoltages |
| High-level supply-voltage snapshot returned by ReadAllSupplyVoltages(). More... | |
Typedefs | |
| template<typename T > | |
| using | DriverResult = tle::expected< T, DriverError > |
| Driver result type. | |
| template<typename T > | |
| using | CommResult = tle::expected< T, CommError > |
| Result type for communication interface operations. | |
Enumerations | |
| enum class | DriverError : uint8_t { None = 0 , NotInitialized , HardwareError , InvalidChannel , InvalidParameter , DeviceNotResponding , WrongDeviceID , RegisterError , CRCError , FaultDetected , ConfigurationError , TimeoutError , WrongMode , SPIFrameError , WriteToReadOnly , FeedbackNotReady } |
| Driver error 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... | |
| enum class | ExpectedReply : uint8_t { Bits16 , Bits22 } |
| Reply-frame width a register is required to answer with. More... | |
| enum class | ClockSource : uint8_t { InternalOscillator , ExternalClockPll } |
| Clock source selection for ConfigureClockSource(). More... | |
| enum class | VioLevel : uint8_t { V3_3 = 0 , V5_0 = 1 } |
| VIO voltage-level selection for SetVioLevel(). More... | |
| enum class | OperationState : uint8_t { Reset , Config , Mission , CriticalFault } |
| Coarse operational state returned by GetOperationState(). More... | |
| enum class | FastMeasureMode : uint8_t { FullPeriod = 0 , HalfPeriod = 1 , QuarterPeriod = 2 } |
| Fast-measurement mode for dither-synchronous feedback. More... | |
| enum class | MaskableFault : uint32_t { Ch0Error = (0u << 24) | (1u << 0) , Ch1Error = (0u << 24) | (1u << 1) , Ch2Error = (0u << 24) | (1u << 2) , Ch3Error = (0u << 24) | (1u << 3) , Ch4Error = (0u << 24) | (1u << 4) , Ch5Error = (0u << 24) | (1u << 5) , EnPin = (0u << 24) | (1u << 13) , SupplyNokInternal = (0u << 24) | (1u << 14) , SupplyNokExternal = (0u << 24) | (1u << 15) , Ch0Warning = (1u << 24) | (1u << 0) , Ch1Warning = (1u << 24) | (1u << 1) , Ch2Warning = (1u << 24) | (1u << 2) , Ch3Warning = (1u << 24) | (1u << 3) , Ch4Warning = (1u << 24) | (1u << 4) , Ch5Warning = (1u << 24) | (1u << 5) , CentralOtWarning = (1u << 24) | (1u << 12) , CentralOtError = (1u << 24) | (1u << 13) , ClockLow = (1u << 24) | (1u << 14) , VbatUv = (2u << 24) | (1u << 0) , VbatOv = (2u << 24) | (1u << 1) , VioUv = (2u << 24) | (1u << 2) , VioOv = (2u << 24) | (1u << 3) , VddUv = (2u << 24) | (1u << 4) , VddOv = (2u << 24) | (1u << 5) , DataErr = (2u << 24) | (1u << 14) , SpiWatchdog = (2u << 24) | (1u << 15) } |
| Maskable fault sources for SetFaultMask(). More... | |
| enum class | CommError : uint8_t { None = 0 , BusError , Timeout , InvalidParameter , TransferError , HardwareNotReady , BufferOverflow , CRCError , NoReply , UnknownError } |
| Error codes for communication interface operations. More... | |
| enum class | CtrlPin : uint8_t { RESN , EN , FAULTN } |
| Control pin enumeration for TLE92466ED. More... | |
| enum class | GpioSignal : uint8_t { INACTIVE = 0 , ACTIVE = 1 } |
| GPIO signal states with board-agnostic naming. More... | |
| enum class | LogLevel : uint8_t { Error = 0 , Warn , Info , Debug , Verbose } |
| Log severity levels for driver logging. 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... | |
Functions | |
| const char * | GetDriverVersion () noexcept |
Return the compiled driver version string (same as Driver::GetDriverVersion()). | |
| constexpr uint16_t | GetChannelBase (Channel channel) noexcept |
| Get channel base address. | |
| constexpr uint16_t | GetChannelRegister (Channel channel, uint16_t offset) noexcept |
| Get channel register address. | |
| constexpr ExpectedReply | ExpectedReplyFor (uint16_t address) noexcept |
Reply width the device must use when answering a read of address. | |
| constexpr uint8_t | ToIndex (Channel ch) noexcept |
| Convert channel to index. | |
| const char * | ToString (ChannelMode mode) noexcept |
| Convert ChannelMode enum to string. | |
| const char * | ToString (SlewRate rate) noexcept |
| Convert SlewRate enum to string. | |
| const char * | ToString (DiagCurrent current) noexcept |
| Convert DiagCurrent enum to string. | |
| const char * | ToString (ParallelPair pair) noexcept |
| Convert ParallelPair enum to string. | |
| const char * | ToString (Channel channel) noexcept |
| Convert Channel enum to string. | |
| constexpr bool | IsValidChannel (Channel ch) noexcept |
| Validate channel number. | |
| constexpr uint8_t | CalculateCrc8J1850 (const uint8_t *data, std::size_t length) noexcept |
| Calculate SAE J1850 CRC-8. | |
| uint8_t | CalculateFrameCrc (const tle92466ed::SPIFrame &frame) noexcept |
| Calculate CRC for SPI frame. | |
| bool | VerifyFrameCrc (const tle92466ed::SPIFrame &frame) noexcept |
| Verify CRC in received frame. | |
| constexpr uint8_t | FaultMaskIndex (MaskableFault f) noexcept |
Extract FAULT_MASK register index (0..2) from a MaskableFault value. | |
| constexpr uint16_t | FaultMaskBit (MaskableFault f) noexcept |
| Extract the bit mask within the target FAULT_MASK register. | |
| using tle92466ed::CommResult = typedef tle::expected<T, CommError> |
Result type for communication interface operations.
| T | The success type |
This provides a modern, safe way to return either a success value or an error. Uses std::expected on C++23, or a lightweight polyfill on C++20.
| using tle92466ed::DriverResult = typedef tle::expected<T, DriverError> |
Driver result type.
FeedbackNotReady is returned by GetAverageCurrent() when FB_FEEDBACK::HasValidMeasurementWindow() is false for the channel's FB_DC read (see FB_FEEDBACK::kMinValidTpMant). Typical causes: DITHER_CLK_DIV still at its POR value of 0 (so Tmeas never runs), feedback frozen via FB_FRZ, or a pipelined reply spliced on a shared bus. Reporting it explicitly stops a near-zero divisor from being published as a plausible-looking current.
|
strong |
|
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. |
|
strong |
|
strong |
Error codes for communication interface operations.
This enumeration defines all possible error conditions that can occur during hardware communication with the TLE92466ED IC.
|
strong |
Control pin enumeration for TLE92466ED.
These pins are used for device control and status monitoring. The naming convention matches the standardized GPIO interface used across all HardFOC drivers.
|
strong |
|
strong |
Driver error codes.
| Enumerator | |
|---|---|
| None | No error. |
| NotInitialized | Driver not initialized. |
| HardwareError | Communication interface 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. |
| FeedbackNotReady | Averaged-feedback measurement window not established. |
|
strong |
Reply-frame width a register is required to answer with.
| Enumerator | |
|---|---|
| Bits16 | Reply mode 00B — 16-bit data plus a status field. |
| Bits22 | Reply mode 01B — 22-bit data, no status field. |
|
strong |
|
strong |
GPIO signal states with board-agnostic naming.
Defines the logical active/inactive state of control pins. The actual HIGH/LOW GPIO level depends on whether the pin is active-high or active-low.
| Enumerator | |
|---|---|
| INACTIVE | Inactive signal state (logical inactive) |
| ACTIVE | Active signal state (logical active) |
|
strong |
Log severity levels for driver logging.
Defines the severity levels for logging messages from the driver. Implementations should map these to their platform-specific logging systems.
| Enumerator | |
|---|---|
| Error | Error messages (highest severity) |
| Warn | Warning messages. |
| Info | Informational messages. |
| Debug | Debug messages (lowest severity) |
| Verbose | Verbose messages (lowest severity, most detailed) |
|
strong |
Maskable fault sources for SetFaultMask().
Each enumerator packs a FAULT_MASK register index (0/1/2) in the upper byte and the bit-mask within that register in the lower 16 bits.
|
strong |
|
strong |
|
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) |
Datasheet Rev 1.2 §5.1.2 fixes the CRC byte sequence as frame[7:0], then frame[15:8], then frame[23:16] — i.e. little-endian byte order, which is the reverse of the MSB-first wire order. On a little-endian target that is exactly bytes 0..2 of the frame word.
|
constexprnoexcept |
Reply width the device must use when answering a read of address.
| address | Register address passed to a read. |
Bits22 for the feedback/status registers that answer in reply mode 01B; Bits16 for everything else.The pipelined bus does not echo the address in a reply, so a reply that arrives in the wrong slot is otherwise indistinguishable from the register that was asked for — and it carries a valid CRC, so CRC alone cannot reject it. Bench measurement (2026-08-13) had 25 % of FB_STAT reads return the preceding ICVID reply, which decoded as plausible-looking status bits. Comparing the reply mode against this table catches the subset of those where the two registers differ in width, which covers every feedback register the current-control path depends on.
|
constexprnoexcept |
Extract the bit mask within the target FAULT_MASK register.
|
constexprnoexcept |
Extract FAULT_MASK register index (0..2) from a MaskableFault value.
|
constexprnoexcept |
Get channel base address.
| channel | Channel number (0-5) |
Per datasheet Table 25, channel base addresses are:
Note: Channels are NOT in sequential order, so we use a lookup table.
|
constexprnoexcept |
Get channel register address.
| channel | Channel number |
| offset | Register offset from channel base |
|
inlinenoexcept |
Return the compiled driver version string (same as Driver::GetDriverVersion()).
|
constexprnoexcept |
Validate channel number.
|
constexprnoexcept |
Convert channel to index.
|
inlinenoexcept |
Convert Channel enum to string.
| channel | Channel |
|
inlinenoexcept |
Convert ChannelMode enum to string.
| mode | Channel mode |
|
inlinenoexcept |
Convert DiagCurrent enum to string.
| current | Diagnostic current |
|
inlinenoexcept |
Convert ParallelPair enum to string.
| pair | Parallel pair |
|
inlinenoexcept |
Convert SlewRate enum to string.
| rate | Slew rate |
|
inlinenoexcept |
Verify CRC in received frame.
| frame | Received SPI frame |