|
HF-MAX22200 Driver 0.1.0-dev
HF-MAX22200 C++ Driver
|
Type definitions and structures for MAX22200 driver. More...
Go to the source code of this file.
Classes | |
| struct | max22200::ChannelConfig |
| Channel configuration structure. More... | |
| struct | max22200::StatusConfig |
| STATUS register structure. More... | |
| struct | max22200::FaultStatus |
| Per-channel fault information from FAULT register (0x09) More... | |
| struct | max22200::DpmConfig |
| DPM (Detection of Plunger Movement) algorithm configuration. More... | |
| struct | max22200::BoardConfig |
| Board/scale configuration for unit-based APIs. More... | |
| struct | max22200::DutyLimits |
| Duty cycle limits (δMIN, δMAX) for a given configuration. More... | |
| struct | max22200::DriverStatistics |
| Driver statistics structure. More... | |
Namespaces | |
| namespace | max22200 |
Typedefs | |
| using | max22200::ChannelConfigArray = std::array<ChannelConfig, NUM_CHANNELS_> |
| Array type for channel configurations. | |
| using | max22200::FaultCallback |
| Callback function type for fault events. | |
| using | max22200::StateChangeCallback |
| Callback function type for channel state changes. | |
Functions | |
| uint32_t | max22200::getChopFreqKhz (bool master_clock_80khz, ChopFreq cf) |
| Get chopping frequency in kHz for conversion (FREQM + FREQ_CFG) | |
| uint8_t | max22200::currentMaToRaw (uint32_t full_scale_current_ma, uint32_t ma) |
| Convert current in mA to 7-bit raw value (0–127) for CDR. | |
| uint8_t | max22200::hitTimeMsToRaw (float ms, bool master_clock_80khz, ChopFreq cf) |
| Convert HIT time in ms to 8-bit raw value (0–255) | |
| float | max22200::getMaxHitTimeMs (bool master_clock_80khz, ChopFreq cf) |
| Maximum representable HIT time in ms for raw values 1–254 (255 = continuous). | |
| const char * | max22200::FaultTypeToStr (FaultType ft) |
| Human-readable fault type name (for logging and tests) | |
| const char * | max22200::DriverStatusToStr (DriverStatus s) |
| Return a human-readable string for DriverStatus (for logging and tests) | |
Type definitions and structures for MAX22200 driver.
This file defines all data structures, enumerations, and type aliases used by the MAX22200 driver. All types match the MAX22200 datasheet register layout (Rev 1, 3/25, Document 19-100531).
In CDR mode, currents are programmed as fractions of the full-scale current (IFS):
The full-scale current IFS is set by an external resistor RREF on the IREF pin:
In VDR mode, HIT and HOLD values represent PWM duty cycle percentages:
Duty cycle limits (δMIN, δMAX) depend on FREQM, FREQ_CFG, and SRC settings.
The HIT excitation time is calculated as:
Where fCHOP is the chopping frequency (depends on FREQM and FREQ_CFG).
The chopping frequency fCHOP depends on FREQM (STATUS[16]) and FREQ_CFG[1:0]:
| FREQM | FREQ_CFG | fCHOP (kHz) |
|---|---|---|
| 0 | 00 | 25 |
| 0 | 01 | 33.33 |
| 0 | 10 | 50 |
| 0 | 11 | 100 |
| 1 | 00 | 20 |
| 1 | 01 | 26.66 |
| 1 | 10 | 40 |
| 1 | 11 | 80 |