MAX22200 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Public Attributes | Friends | List of all members
max22200::ChannelConfig Struct Reference

One channel's CFG_CHn register, as codes (Table 11). ChannelConfig{} is the reset value: CDR, low side, every code 0 (no current), 25 kHz, every diagnostic off. More...

#include <max22200_types.hpp>

Public Attributes

DriveMode drive {DriveMode::Cdr}
 VDRnCDR. Changes only with every channel off.
 
Side side {Side::Low}
 
uint8_t hit {0}
 
uint8_t hold {0}
 HOLD[6:0], as hit. Can change on the fly (SetHoldCode()).
 
uint8_t hit_time {0}
 HIT_T[7:0]: 0 none, 1 to 254 (HitTimeUs()), 255 continuous (Table 5).
 
ChopDivider chop {ChopDivider::Div4}
 FREQ_CFG.
 
bool half_scale {false}
 HFS: IFS halved, RON doubled; low side only.
 
bool trigger_pin {false}
 TRGnSPI: switched by TRIGA (even) or TRIGB (odd), not ONCH.
 
bool slew_rate_control {false}
 SRC: low side, fCHOP below 50 kHz only.
 
bool open_load_detect {false}
 OL_EN.
 
bool plunger_detect {false}
 DPM_EN: low side only; settings in DpmConfig.
 
bool hit_current_check {false}
 HHF_EN: CDR only.
 

Friends

constexpr bool operator== (const ChannelConfig &lhs, const ChannelConfig &rhs) noexcept=default
 

Detailed Description

One channel's CFG_CHn register, as codes (Table 11). ChannelConfig{} is the reset value: CDR, low side, every code 0 (no current), 25 kHz, every diagnostic off.

The codes are the datasheet's, so nothing is rounded behind your back; the conversions below (CurrentCode(), HitTimeCode()) turn milliamps and microseconds into them and refuse what the chip cannot do.

Friends And Related Symbol Documentation

◆ operator==

constexpr bool operator== ( const ChannelConfig &  lhs,
const ChannelConfig &  rhs 
)
friend
Parameters
lhsThe first value.
rhsThe value to compare it with.
Returns
true when every field of lhs equals rhs's.

Member Data Documentation

◆ hit

uint8_t max22200::ChannelConfig::hit {0}

HIT[6:0]. CDR: peak current code/128 x IFS, 1 to kMaxCdrCode, 0 = no current (Table 4). VDR: duty cycle in percent, 0 to kMaxVdrCode; the chip raises 1 to δMIN-1 to δMIN and lowers δMAX+1 to 99 to δMAX (Tables 2, 3).

◆ side

Side max22200::ChannelConfig::side {Side::Low}

HSnLS. Changes only with every channel off.


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