|
TLE92466ED Driver 0.1.0
API reference
|
Public types of the TLE92466ED driver: errors, Result<T>, configuration, decoded status and feedback, and the unit conversions.
More...
#include <array>#include <cstdint>#include "tle92466ed_detail.hpp"#include "tle92466ed_version.h"Go to the source code of this file.
Classes | |
| struct | tle92466ed::Result< T > |
| The value of a call, or why there is none. More... | |
| struct | tle92466ed::Result< void > |
| The result of a call that returns no value. More... | |
| struct | tle92466ed::IccConfig |
| The integrating current controller of one channel (CTRL, PERIOD, INTEGRATOR_LIMIT, CTRL_INT_THRESH, SETPOINT.AUTO_LIMIT_DIS; section 4.6.2). Defaults are the reset values. More... | |
| struct | tle92466ed::DitherConfig |
The dither generator of one channel (DITHER_CLK_DIV, DITHER_STEP, DITHER_CTRL; section 4.7). In current control and direct drive the dither period is also the feedback measurement period (section 4.4.2): with mant = 0 the averaged feedback never updates. Defaults are the reset values. More... | |
| struct | tle92466ed::DiagConfig |
The diagnosis of one channel (CH_CONFIG, CTRL, TON; section 4.9). Defaults are the reset values. On a channel ChannelConfig::loaded does not declare, the driver writes the OFF-state diagnosis off and both open-load thresholds 0, whatever these fields say (handbook KB-CPP-131). More... | |
| struct | tle92466ed::ChannelConfig |
| Everything the driver writes for one channel. Defaults are the reset values. More... | |
| struct | tle92466ed::FaultPinMask |
Which faults pull FAULTN low (FAULT_MASK0..2, sections 5.3.2.14 to 5.3.2.16); true reports the fault on the pin. Defaults are the reset values. A channel loaded does not declare never reaches the pin (KB-CPP-131). More... | |
| struct | tle92466ed::Config |
Everything EnsureInitialized() writes to the chip, and the driver's own settings. More... | |
| struct | tle92466ed::ChannelFaults |
| The faults and warnings of one channel, decoded (sections 5.3.2.12, 5.3.2.13). More... | |
| struct | tle92466ed::Faults |
The diagnosis registers as read: GLOBAL_DIAG0..2, DIAG_ERR_CHGR0..2 and DIAG_WARN_CHGR0..2. Raw words, so a latch is a plain OR; Has() and Of() decode them. More... | |
| struct | tle92466ed::DeviceStatus |
| FB_STAT, the chip's one-word status summary, decoded (section 5.3.2.21). More... | |
| struct | tle92466ed::SupplyReadings |
| The supply and temperature feedback (FB_VOLTAGE1, FB_VOLTAGE2; 5.3.2.22, 5.3.2.23). More... | |
| struct | tle92466ed::PinStatus |
| PIN_STAT, decoded (section 5.3.2.20). More... | |
| struct | tle92466ed::BistResult |
| The result of the safety flip-flop self-test (SFF_BIST, section 4.9.8). More... | |
| struct | tle92466ed::ChipId |
| The unique chip identification, CHIPID0..2 (sections 5.3.2.24 to 5.3.2.26). More... | |
| struct | tle92466ed::ChannelFeedback |
| One measurement period of a channel's feedback, read under the freeze of section 4.10.5 and converted with Equations 18 to 22, 30 and 31. More... | |
| struct | tle92466ed::BusDiagnostics |
| Counters of the protocol layer (handbook KB-ARCH-044). No I/O to read them. More... | |
| class | tle92466ed::CheckedConfig |
| A configuration proven valid at build time. More... | |
Namespaces | |
| namespace | tle92466ed |
The TLE92466ED driver: everything it declares lives here; internals in detail. | |
Functions | |
| constexpr const char * | tle92466ed::ToString (Error error) noexcept |
| The name of an error, for logs. | |
| constexpr Error | tle92466ed::Validate (const Config &config) noexcept |
| Check a configuration without touching the chip. | |
| constexpr ChannelConfig | tle92466ed::CurrentControlChannel () noexcept |
| A starting point for one current-controlled channel with feedback: ICC, a 1 kHz PWM target (PERIOD_MANT 219, PERIOD_EXP 7), MIN_INT_THRESH 2 (above 1, section 4.6.2.4), a 1 ms dither reference clock with no dither amplitude so the averaged feedback updates every millisecond (sections 4.4.2, 4.7.1), and the reset values elsewhere. Tune it to the load. | |
| void | tle92466ed::ConfigIsInvalid () noexcept |
Reached only when a CheckedConfig is built from an invalid configuration: it is never defined, so the build fails and names it (KB-CPP20-013). | |
| constexpr const char * | tle92466ed::GetDriverVersion () noexcept |
| constexpr uint32_t | tle92466ed::GetDriverVersionMajor () noexcept |
| constexpr uint32_t | tle92466ed::GetDriverVersionMinor () noexcept |
| constexpr uint32_t | tle92466ed::GetDriverVersionPatch () noexcept |
Conversions (constexpr, proved below with the datasheet's own numbers) | |
| constexpr uint32_t | tle92466ed::SystemClockHz (const Config &config) noexcept |
| f_SYS for a configuration: 28 MHz from the internal oscillator, else f_CLK * PLL_FBDIV / (2 * PLL_REFDIV) (Equation 2). | |
| constexpr uint32_t | tle92466ed::PllRefDiv (uint32_t khz) noexcept |
| PLL_REFDIV for an external clock: f_CLK / 1 MHz, rounded down as in Table 10. | |
| constexpr uint32_t | tle92466ed::PllFbDiv (uint32_t khz) noexcept |
| PLL_FBDIV for an external clock: 56 MHz * PLL_REFDIV / f_CLK, rounded to the nearest as in Table 10 (Equation 3). | |
| constexpr uint32_t | tle92466ed::TargetFromMicroamps (uint32_t microamps, bool parallel) noexcept |
| The TARGET count of a current, rounded to the nearest (section 5.3.3.3). | |
| constexpr uint32_t | tle92466ed::MicroampsFromTarget (uint32_t target, bool parallel) noexcept |
| The current a TARGET count programs, rounded to the nearest microamp. | |
| constexpr uint32_t | tle92466ed::DitherAmplitudeUa (const DitherConfig &dither, bool parallel) noexcept |
| The dither amplitude I_Dither = STEPS * STEP_SIZE * full scale / (2^15 - 1) (Equation 6). | |
| constexpr uint32_t | tle92466ed::PwmFrequencyHz (const IccConfig &icc, uint32_t system_hz) noexcept |
| The PWM frequency the controller is set to: f_SYS / (PERIOD_MANT * 2^PERIOD_EXP), times 1/8 in the low range (Equations 4, 5). | |
| constexpr Result< uint16_t > | tle92466ed::WatchdogReloadCode (uint32_t timeout_ms, uint32_t system_hz) noexcept |
| WD_TIME for a watchdog timeout: rounddown(t_SPI_WD * f_SYS / 2^14) (5.3.2.11). | |
| constexpr Result< uint8_t > | tle92466ed::VbatThresholdCode (uint32_t millivolts) noexcept |
| VBAT_UV_TH or VBAT_OV_TH for a threshold voltage, 162.08 mV per count, rounded to the nearest (Equation 1). | |
Variables | |
| constexpr uint32_t | tle92466ed::kChannelCount = 6U |
| Number of output channels (section 4.5.1). | |
| constexpr uint32_t | tle92466ed::kPairCount = 3U |
| Number of parallel pairs. | |
Limits and timing (datasheet sections 3.2, 4.1.3, 4.6.3, 5.1.4) | |
| constexpr uint32_t | tle92466ed::kMaxSetpointUa = 1'500'000U |
| Highest DC setpoint of one channel, in microamps (Table 14, I_set). | |
| constexpr uint32_t | tle92466ed::kMaxSetpointWithDitherUa = 1'800'000U |
| Highest setpoint plus dither amplitude of one channel (Table 14, I_set + I_Dither). | |
| constexpr uint32_t | tle92466ed::kParallelMeasurementRangeUa = 2'700'000U |
| constexpr uint32_t | tle92466ed::kMaxParallelSetpointUa = (kParallelMeasurementRangeUa / 10U) * 9U |
| constexpr uint32_t | tle92466ed::kSetpointFullScaleUa = 2'000'000U |
| Full scale of TARGET, one channel: I_set = 2 A * TARGET / (2^15 - 1) (5.3.3.3). | |
| constexpr uint32_t | tle92466ed::kParallelFullScaleUa = 4'000'000U |
| Full scale of TARGET in a parallel pair: the LSB doubles (4.5.2). | |
| constexpr uint32_t | tle92466ed::kTargetMax = 32767U |
| Largest TARGET value, 2^15 - 1. | |
| constexpr uint32_t | tle92466ed::kInternalClockHz = 28'000'000U |
| f_SYS of the internal oscillator, typical (Table 6). | |
| constexpr uint32_t | tle92466ed::kMinSystemClockHz = 27'500'000U |
| Lowest f_SYS (Table 6). | |
| constexpr uint32_t | tle92466ed::kMaxSystemClockHz = 28'500'000U |
| Highest f_SYS (Table 6). | |
| constexpr uint32_t | tle92466ed::kMinPwmHz = 110U |
| Lowest PWM frequency of the frequency controller, f_PWM min (Table 6). | |
| constexpr uint32_t | tle92466ed::kMaxPwmHz = 4000U |
| Highest PWM frequency, f_PWM max (Table 6). | |
| constexpr uint16_t | tle92466ed::kMaxWatchdogReload = 2047U |
| Largest WD_TIME, an 11-bit field (5.3.2.11). | |
| constexpr uint16_t | tle92466ed::kMinWatchdogReload = 9U |
| constexpr uint32_t | tle92466ed::kWatchdogDivider = 16384U |
| The SPI watchdog counts f_SYS / 2^14 (Table 18). | |
| constexpr uint32_t | tle92466ed::kMaxOcOnTimeUs = 300'000U |
| Longest OFF-state overcurrent on-time t_OCon (TON register note, 5.3.3.12), microseconds. | |
| constexpr uint32_t | tle92466ed::kResetReleaseUs = 100U |
| Logic ready after RESN released, t_RESN max (Table 9). | |
| constexpr uint32_t | tle92466ed::kPowerOnResetUs = 10'000U |
| Logic ready after a power-on reset, t_POR max (Table 9). | |
| constexpr uint32_t | tle92466ed::kResetPulseUs = 1000U |
| constexpr uint32_t | tle92466ed::kPollIntervalUs = 100U |
| Interval of the INIT_DONE and self-test polls. | |
| constexpr uint32_t | tle92466ed::kMinInitTimeoutUs = 100U |
Shortest Config::init_timeout_us. | |
| constexpr uint32_t | tle92466ed::kMaxInitTimeoutUs = 100'000U |
Longest Config::init_timeout_us. | |
| constexpr uint32_t | tle92466ed::kBistTimeoutUs = 10'000U |
| constexpr uint8_t | tle92466ed::kMaxRetries = 3U |
Highest Config::max_retries. | |
| constexpr uint8_t | tle92466ed::kManufacturerId = 0xC1U |
| ICVID.MANUFACTURER of every TLE92466ED (5.3.2.19). | |
| constexpr uint8_t | tle92466ed::kVersionA11 = 0xFCU |
| ICVID.VERSION of design step A11. | |
| constexpr uint8_t | tle92466ed::kVersionA13 = 0xFEU |
| ICVID.VERSION of design step A13. | |
Public types of the TLE92466ED driver: errors, Result<T>, configuration, decoded status and feedback, and the unit conversions.
Everything here is plain data with no platform dependency, so handlers, tests and tools can include it without the driver template. The configuration defaults are the chip's reset values (TLE92466ED datasheet Rev. 1.2, section 5.3), so Config{} describes a chip that was just reset. Section numbers below refer to that datasheet.