MAX22200 Driver
API reference
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
max22200::BoardConfig Struct Reference

Board/scale configuration for unit-based APIs. More...

#include <max22200_types.hpp>

Public Member Functions

 BoardConfig ()
 
 BoardConfig (float rref_kohm, bool hfs)
 Construct BoardConfig from RREF resistor value.
 
bool hasMaxCurrentLimit () const
 True if a max current limit is configured (0 = no limit)
 
bool hasMaxDutyLimit () const
 True if a max duty limit is configured (0 = no limit)
 
bool hasIfsConfigured () const
 True if IFS is configured (non-zero)
 
uint32_t getFullScaleCurrentMa () const
 Full-scale current in mA (IFS from RREF)
 
uint32_t getMaxCurrentLimitMa () const
 Max current limit in mA (0 = no limit)
 
uint8_t getMaxDutyLimitPercent () const
 Max duty limit in percent (0 = no limit)
 

Public Attributes

uint32_t full_scale_current_ma
 Full-scale current in mA (from RREF: IFS = KFS×1000/RREF)
 
uint32_t max_current_ma
 Max current limit in mA (0 = no limit, applies to all channels)
 
uint8_t max_duty_percent
 Max duty limit in percent (0 = no limit, applies to VDR mode)
 

Detailed Description

Board/scale configuration for unit-based APIs.

Stores the full-scale current (IFS) and optional safety limits for current and duty cycle. Used by convenience APIs that work in real units (mA, A, percent) instead of raw register values.

Full-Scale Current (IFS)

The IFS is determined by the external resistor RREF on the IREF pin:

Safety Limits

Note
Set IFS based on your board's RREF value and HFS setting.
Safety limits are optional (0 = disabled). When set, they provide an additional safety layer beyond the device's hardware limits.

Constructor & Destructor Documentation

◆ BoardConfig() [1/2]

max22200::BoardConfig::BoardConfig ( )
inline

◆ BoardConfig() [2/2]

max22200::BoardConfig::BoardConfig ( float  rref_kohm,
bool  hfs 
)
inline

Construct BoardConfig from RREF resistor value.

IFS = KFS × 1000 / RREF (KFS = 15 kΩ full-scale, 7.5 kΩ half-scale).

Parameters
rref_kohmRREF resistor value in kΩ (e.g., 15.0 for 15kΩ)
hfstrue if HFS=1 (half-scale), false if HFS=0 (full-scale)
Example
// RREF = 30kΩ, HFS = 0 → IFS = 15k × 1000 / 30k = 500 mA
BoardConfig config(30.0f, false);
Board/scale configuration for unit-based APIs.
Definition max22200_types.hpp:1089

Member Function Documentation

◆ getFullScaleCurrentMa()

uint32_t max22200::BoardConfig::getFullScaleCurrentMa ( ) const
inline

Full-scale current in mA (IFS from RREF)

◆ getMaxCurrentLimitMa()

uint32_t max22200::BoardConfig::getMaxCurrentLimitMa ( ) const
inline

Max current limit in mA (0 = no limit)

◆ getMaxDutyLimitPercent()

uint8_t max22200::BoardConfig::getMaxDutyLimitPercent ( ) const
inline

Max duty limit in percent (0 = no limit)

◆ hasIfsConfigured()

bool max22200::BoardConfig::hasIfsConfigured ( ) const
inline

True if IFS is configured (non-zero)

◆ hasMaxCurrentLimit()

bool max22200::BoardConfig::hasMaxCurrentLimit ( ) const
inline

True if a max current limit is configured (0 = no limit)

◆ hasMaxDutyLimit()

bool max22200::BoardConfig::hasMaxDutyLimit ( ) const
inline

True if a max duty limit is configured (0 = no limit)

Member Data Documentation

◆ full_scale_current_ma

uint32_t max22200::BoardConfig::full_scale_current_ma

Full-scale current in mA (from RREF: IFS = KFS×1000/RREF)

◆ max_current_ma

uint32_t max22200::BoardConfig::max_current_ma

Max current limit in mA (0 = no limit, applies to all channels)

◆ max_duty_percent

uint8_t max22200::BoardConfig::max_duty_percent

Max duty limit in percent (0 = no limit, applies to VDR mode)


The documentation for this struct was generated from the following file: