HF-MAX22200 Driver 0.1.0-dev
HF-MAX22200 C++ Driver
Loading...
Searching...
No Matches
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)
 
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:

  • IFS (mA) = KFS × 1000 / RREF (Ω)
  • KFS = 15k when HFS = 0 (full-scale, IFS up to 1000 mA)
  • KFS = 7.5k when HFS = 1 (half-scale, IFS up to 500 mA)
  • RREF range: 15kΩ to 100kΩ recommended

Safety Limits

  • max_current_ma: Maximum allowed current in mA (0 = no limit). All current-setting APIs clamp to this value.
  • max_duty_percent: Maximum allowed duty cycle in percent (0 = no limit). All duty-setting APIs clamp to this value (in addition to δMIN/δMAX).
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

Member Function Documentation

◆ getFullScaleCurrentMa()

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

Full-scale current in mA (IFS from RREF)

Examples
/home/runner/work/hf-max22200-driver/hf-max22200-driver/inc/max22200_types.hpp.

◆ getMaxCurrentLimitMa()

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

◆ getMaxDutyLimitPercent()

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

Max duty limit in percent (0 = no limit)

Examples
/home/runner/work/hf-max22200-driver/hf-max22200-driver/inc/max22200_types.hpp.

◆ hasIfsConfigured()

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

◆ hasMaxCurrentLimit()

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

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

Examples
/home/runner/work/hf-max22200-driver/hf-max22200-driver/inc/max22200_types.hpp.

◆ hasMaxDutyLimit()

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

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

Examples
/home/runner/work/hf-max22200-driver/hf-max22200-driver/inc/max22200_types.hpp.

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)

Examples
/home/runner/work/hf-max22200-driver/hf-max22200-driver/inc/max22200_types.hpp.

◆ max_current_ma

uint32_t max22200::BoardConfig::max_current_ma

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

Examples
/home/runner/work/hf-max22200-driver/hf-max22200-driver/inc/max22200_types.hpp.

◆ max_duty_percent

uint8_t max22200::BoardConfig::max_duty_percent

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

Examples
/home/runner/work/hf-max22200-driver/hf-max22200-driver/inc/max22200_types.hpp.

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