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

STATUS register structure. More...

#include <max22200_types.hpp>

Public Member Functions

 StatusConfig ()
 Default constructor.
 
uint32_t toRegister () const
 Build 32-bit STATUS register value from writable fields.
 
void fromRegister (uint32_t val)
 Parse a 32-bit STATUS register value into this structure.
 
bool hasFault () const
 Check if any global fault flag in byte 0 is active.
 
bool hasOvertemperature () const
 
bool hasOvercurrent () const
 
bool hasOpenLoadFault () const
 
bool hasHitNotReached () const
 
bool hasPlungerMovementFault () const
 
bool hasCommunicationError () const
 
bool hasUndervoltage () const
 
bool isActive () const
 
bool isChannelOn (uint8_t ch) const
 
uint8_t channelCountOn () const
 
bool isOvertemperatureMasked () const
 
bool isOvercurrentMasked () const
 
bool isOpenLoadFaultMasked () const
 
bool isHitNotReachedMasked () const
 
bool isPlungerMovementFaultMasked () const
 
bool isCommunicationErrorMasked () const
 
bool isUndervoltageMasked () const
 
bool is80KHzBase () const
 
bool is100KHzBase () const
 
ChannelMode getChannelPairMode76 () const
 
ChannelMode getChannelPairMode54 () const
 
ChannelMode getChannelPairMode32 () const
 
ChannelMode getChannelPairMode10 () const
 
uint8_t getChannelsOnMask () const
 

Public Attributes

uint8_t channels_on_mask
 
bool overtemperature_masked
 OVT fault mask; when true OVT does not assert FAULT pin.
 
bool overcurrent_masked
 OCP fault mask; when true OCP does not assert FAULT pin.
 
bool open_load_fault_masked
 OLF fault mask; when true OLF does not assert FAULT pin.
 
bool hit_not_reached_masked
 HHF fault mask; when true HHF does not assert FAULT pin.
 
bool plunger_movement_fault_masked
 DPM fault mask; when true DPM does not assert FAULT pin.
 
bool communication_error_masked
 COMER mask (default=true); when true COMER does not assert FAULT pin.
 
bool undervoltage_masked
 UVM fault mask; when true UVM does not assert FAULT pin.
 
bool master_clock_80khz
 Master clock base (false=100kHz, true=80kHz); affects fCHOP.
 
ChannelMode channel_pair_mode_76
 CH6/CH7 pair mode; change only when both CH6 and CH7 are OFF.
 
ChannelMode channel_pair_mode_54
 CH4/CH5 pair mode.
 
ChannelMode channel_pair_mode_32
 CH2/CH3 pair mode.
 
ChannelMode channel_pair_mode_10
 CH0/CH1 pair mode.
 
bool active
 Global enable (0=low-power, 1=normal); set to 1 during init.
 
bool overtemperature
 OVT fault flag (read-only); die over temp.
 
bool overcurrent
 OCP fault flag (read-only); output exceeded OCP level.
 
bool open_load_fault
 OLF fault flag (read-only); load disconnected if OL enabled.
 
bool hit_not_reached
 HHF fault flag (read-only); IHIT not reached by end of tHIT.
 
bool plunger_movement_fault
 DPM fault flag (read-only); no valid plunger movement.
 
bool communication_error
 COMER flag (read-only); SPI error detected.
 
bool undervoltage
 UVM fault flag (read-only); clear by reading STATUS at init.
 

Detailed Description

STATUS register structure.

Maps directly to the 32-bit STATUS register (0x00). Contains channel activation, hardware configuration, fault masks, fault flags, and the global ACTIVE bit.

Register Layout

Byte Bits Field Description
3 31:24 ONCH[7:0] Channel on/off bits (1=on, 0=off)
2 23:16 M_OVT, M_OCP, etc. Fault mask bits + FREQM
1 15:8 CM76, CM54, etc. Channel-pair mode configuration
0 7:0 OVT, OCP, etc. Fault flags (read-only) + ACTIVE

Key Fields

Note
Fault flags (bits 7:1) are read-only. They are cleared by reading the STATUS register (UVM) or FAULT register (OCP, HHF, OLF, DPM).
Reading STATUS register clears UVM flag and deasserts nFAULT pin.

Constructor & Destructor Documentation

◆ StatusConfig()

max22200::StatusConfig::StatusConfig ( )
inline

Default constructor.

Member Function Documentation

◆ channelCountOn()

uint8_t max22200::StatusConfig::channelCountOn ( ) const
inline

◆ fromRegister()

void max22200::StatusConfig::fromRegister ( uint32_t  val)
inline

Parse a 32-bit STATUS register value into this structure.

Parameters
valRaw 32-bit value read from the device

◆ getChannelPairMode10()

ChannelMode max22200::StatusConfig::getChannelPairMode10 ( ) const
inline

◆ getChannelPairMode32()

ChannelMode max22200::StatusConfig::getChannelPairMode32 ( ) const
inline

◆ getChannelPairMode54()

ChannelMode max22200::StatusConfig::getChannelPairMode54 ( ) const
inline

◆ getChannelPairMode76()

ChannelMode max22200::StatusConfig::getChannelPairMode76 ( ) const
inline

◆ getChannelsOnMask()

uint8_t max22200::StatusConfig::getChannelsOnMask ( ) const
inline

◆ hasCommunicationError()

bool max22200::StatusConfig::hasCommunicationError ( ) const
inline

◆ hasFault()

bool max22200::StatusConfig::hasFault ( ) const
inline

Check if any global fault flag in byte 0 is active.

Returns
true if any of OVT, OCP, OLF, HHF, DPM, COMER, or UVM is set

◆ hasHitNotReached()

bool max22200::StatusConfig::hasHitNotReached ( ) const
inline

◆ hasOpenLoadFault()

bool max22200::StatusConfig::hasOpenLoadFault ( ) const
inline

◆ hasOvercurrent()

bool max22200::StatusConfig::hasOvercurrent ( ) const
inline

◆ hasOvertemperature()

bool max22200::StatusConfig::hasOvertemperature ( ) const
inline

◆ hasPlungerMovementFault()

bool max22200::StatusConfig::hasPlungerMovementFault ( ) const
inline

◆ hasUndervoltage()

bool max22200::StatusConfig::hasUndervoltage ( ) const
inline

◆ is100KHzBase()

bool max22200::StatusConfig::is100KHzBase ( ) const
inline

◆ is80KHzBase()

bool max22200::StatusConfig::is80KHzBase ( ) const
inline

◆ isActive()

bool max22200::StatusConfig::isActive ( ) const
inline

◆ isChannelOn()

bool max22200::StatusConfig::isChannelOn ( uint8_t  ch) const
inline

◆ isCommunicationErrorMasked()

bool max22200::StatusConfig::isCommunicationErrorMasked ( ) const
inline

◆ isHitNotReachedMasked()

bool max22200::StatusConfig::isHitNotReachedMasked ( ) const
inline

◆ isOpenLoadFaultMasked()

bool max22200::StatusConfig::isOpenLoadFaultMasked ( ) const
inline

◆ isOvercurrentMasked()

bool max22200::StatusConfig::isOvercurrentMasked ( ) const
inline

◆ isOvertemperatureMasked()

bool max22200::StatusConfig::isOvertemperatureMasked ( ) const
inline

◆ isPlungerMovementFaultMasked()

bool max22200::StatusConfig::isPlungerMovementFaultMasked ( ) const
inline

◆ isUndervoltageMasked()

bool max22200::StatusConfig::isUndervoltageMasked ( ) const
inline

◆ toRegister()

uint32_t max22200::StatusConfig::toRegister ( ) const
inline

Build 32-bit STATUS register value from writable fields.

Encodes ONCH, fault masks, CMxy, FREQM, and ACTIVE. Fault flag bits are read-only on the device and are not included in the output.

Member Data Documentation

◆ active

bool max22200::StatusConfig::active

Global enable (0=low-power, 1=normal); set to 1 during init.

◆ channel_pair_mode_10

ChannelMode max22200::StatusConfig::channel_pair_mode_10

CH0/CH1 pair mode.

◆ channel_pair_mode_32

ChannelMode max22200::StatusConfig::channel_pair_mode_32

CH2/CH3 pair mode.

◆ channel_pair_mode_54

ChannelMode max22200::StatusConfig::channel_pair_mode_54

CH4/CH5 pair mode.

◆ channel_pair_mode_76

ChannelMode max22200::StatusConfig::channel_pair_mode_76

CH6/CH7 pair mode; change only when both CH6 and CH7 are OFF.

◆ channels_on_mask

uint8_t max22200::StatusConfig::channels_on_mask

Channel on/off bitmask (bit N = channel N) Can be updated with fast 8-bit write to STATUS[31:24] For channels with trigger_from_pin=true, ONCH bit is ignored (TRIG pin controls)

◆ communication_error

bool max22200::StatusConfig::communication_error

COMER flag (read-only); SPI error detected.

◆ communication_error_masked

bool max22200::StatusConfig::communication_error_masked

COMER mask (default=true); when true COMER does not assert FAULT pin.

◆ hit_not_reached

bool max22200::StatusConfig::hit_not_reached

HHF fault flag (read-only); IHIT not reached by end of tHIT.

◆ hit_not_reached_masked

bool max22200::StatusConfig::hit_not_reached_masked

HHF fault mask; when true HHF does not assert FAULT pin.

◆ master_clock_80khz

bool max22200::StatusConfig::master_clock_80khz

Master clock base (false=100kHz, true=80kHz); affects fCHOP.

◆ open_load_fault

bool max22200::StatusConfig::open_load_fault

OLF fault flag (read-only); load disconnected if OL enabled.

◆ open_load_fault_masked

bool max22200::StatusConfig::open_load_fault_masked

OLF fault mask; when true OLF does not assert FAULT pin.

◆ overcurrent

bool max22200::StatusConfig::overcurrent

OCP fault flag (read-only); output exceeded OCP level.

◆ overcurrent_masked

bool max22200::StatusConfig::overcurrent_masked

OCP fault mask; when true OCP does not assert FAULT pin.

◆ overtemperature

bool max22200::StatusConfig::overtemperature

OVT fault flag (read-only); die over temp.

◆ overtemperature_masked

bool max22200::StatusConfig::overtemperature_masked

OVT fault mask; when true OVT does not assert FAULT pin.

◆ plunger_movement_fault

bool max22200::StatusConfig::plunger_movement_fault

DPM fault flag (read-only); no valid plunger movement.

◆ plunger_movement_fault_masked

bool max22200::StatusConfig::plunger_movement_fault_masked

DPM fault mask; when true DPM does not assert FAULT pin.

◆ undervoltage

bool max22200::StatusConfig::undervoltage

UVM fault flag (read-only); clear by reading STATUS at init.

◆ undervoltage_masked

bool max22200::StatusConfig::undervoltage_masked

UVM fault mask; when true UVM does not assert FAULT pin.


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