MAX22200 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Functions | Variables
Register map

Banks, fields, reset values and timing. More...

Functions

constexpr uint8_t max22200::reg::CfgChannel (uint8_t channel) noexcept
 The bank of a channel's configuration register.
 
constexpr uint8_t max22200::reg::Command (uint8_t bank, bool write, bool eight_bit) noexcept
 The Command Register byte for one access.
 
constexpr uint32_t max22200::reg::PairModeShift (uint8_t pair) noexcept
 Shift of a channel pair's CMxy field in STATUS.
 
constexpr uint32_t max22200::reg::FaultClearSdi (uint32_t mask) noexcept
 The register-aligned clear mask as SDI must carry it, for kFaultClearLsbByteFirst.
 

Variables

constexpr uint8_t max22200::reg::kStatus = 0x00
 STATUS: ONCH, fault masks, FREQM, CMxy, flags, ACTIVE.
 
constexpr uint8_t max22200::reg::kCfgCh0 = 0x01
 CFG_CH0; CFG_CHn is at 0x01 + n, up to 0x08.
 
constexpr uint8_t max22200::reg::kFault = 0x09
 FAULT (read only): OCP, HHF, OLF, DPM per channel.
 
constexpr uint8_t max22200::reg::kCfgDpm = 0x0A
 CFG_DPM: the plunger-movement detection settings.
 
constexpr uint8_t max22200::reg::kCmdWrite = 0x80
 RB/W = 1: the next transfer writes.
 
constexpr uint8_t max22200::reg::kCmdBankShift = 1
 A_BNK is bits 4:1; bits 6:5 (RFU) stay 0.
 
constexpr uint8_t max22200::reg::kCmdBankMask = 0x0F
 A_BNK width.
 
constexpr uint8_t max22200::reg::kCmd8Bit = 0x01
 8bit/n32bits = 1: the next transfer is bits 31:24.
 
constexpr uint32_t max22200::reg::kOnchShift = 24
 ONCH[7:0]: bit 24 + n switches channel n on.
 
constexpr uint32_t max22200::reg::kMaskOvt = uint32_t{1} << 23U
 M_OVT: OVT does not assert FAULT.
 
constexpr uint32_t max22200::reg::kMaskOcp = uint32_t{1} << 22U
 M_OCP.
 
constexpr uint32_t max22200::reg::kMaskOlf = uint32_t{1} << 21U
 M_OLF.
 
constexpr uint32_t max22200::reg::kMaskHhf = uint32_t{1} << 20U
 M_HHF.
 
constexpr uint32_t max22200::reg::kMaskDpm = uint32_t{1} << 19U
 M_DPM.
 
constexpr uint32_t max22200::reg::kMaskComf = uint32_t{1} << 18U
 M_COMF; 1 at reset (COMER masked).
 
constexpr uint32_t max22200::reg::kMaskUvm = uint32_t{1} << 17U
 M_UVM.
 
constexpr uint32_t max22200::reg::kFreqm
 FREQM: 0 = 100 kHz, 1 = 80 kHz oscillator.
 
constexpr uint32_t max22200::reg::kPairModeShift = 8
 
constexpr uint32_t max22200::reg::kOvt = uint32_t{1} << 7U
 OVT flag; a STATUS read clears it.
 
constexpr uint32_t max22200::reg::kOcp
 OCP flag: some channel has an OCP bit in FAULT.
 
constexpr uint32_t max22200::reg::kOlf
 OLF flag: some channel has an OLF bit in FAULT.
 
constexpr uint32_t max22200::reg::kHhf
 HHF flag: some channel has an HHF bit in FAULT.
 
constexpr uint32_t max22200::reg::kDpm
 DPM flag: some channel has a DPM bit in FAULT.
 
constexpr uint32_t max22200::reg::kComer
 COMER: a write had the wrong number of clocks.
 
constexpr uint32_t max22200::reg::kUvm = uint32_t{1} << 1U
 
constexpr uint32_t max22200::reg::kActive
 ACTIVE: 0 = low-power, channels Hi-Z (reset).
 
constexpr uint32_t max22200::reg::kFlagsMask = 0xFEU
 The seven read-only flags, bits 7:1.
 
constexpr uint32_t max22200::reg::kWritableMask = 0xFFFFFF01U
 Every bit a write sets.
 
constexpr uint32_t max22200::reg::kStatusReset = kMaskComf | kUvm
 0x00040002 after power-up.
 
constexpr uint32_t max22200::reg::kHfs
 HFS: half full-scale (KFS 7.5k instead of 15k).
 
constexpr uint32_t max22200::reg::kHoldShift = 24
 HOLD[6:0] at bits 30:24.
 
constexpr uint32_t max22200::reg::kTrgnspi
 TRGnSPI: the TRIGA/TRIGB pin switches it.
 
constexpr uint32_t max22200::reg::kHitShift = 16
 HIT[6:0] at bits 22:16.
 
constexpr uint32_t max22200::reg::kHitTimeShift = 8
 HIT_T[7:0] at bits 15:8.
 
constexpr uint32_t max22200::reg::kVdrncdr
 VDRnCDR: 1 = voltage drive, 0 = current drive.
 
constexpr uint32_t max22200::reg::kHsnls = uint32_t{1} << 6U
 HSnLS: 1 = high side (VDR only).
 
constexpr uint32_t max22200::reg::kFreqCfgShift = 4
 FREQ_CFG[1:0] at bits 5:4.
 
constexpr uint32_t max22200::reg::kSrc = uint32_t{1} << 3U
 SRC: slew-rate controlled edges.
 
constexpr uint32_t max22200::reg::kOlEn = uint32_t{1} << 2U
 OL_EN: open-load detection.
 
constexpr uint32_t max22200::reg::kDpmEn = uint32_t{1} << 1U
 DPM_EN: plunger-movement detection.
 
constexpr uint32_t max22200::reg::kHhfEn = uint32_t{1} << 0U
 HHF_EN: HIT-current check.
 
constexpr uint32_t max22200::reg::kCodeMask = 0x7FU
 Width of HIT and HOLD.
 
constexpr uint8_t max22200::reg::kHfsByte = 0x80
 HFS in the 8-bit (bits 31:24) access.
 
constexpr uint32_t max22200::reg::kFaultOcpShift = 24
 OCP[7:0]; channel 0 is the LSB of each byte.
 
constexpr uint32_t max22200::reg::kFaultHhfShift = 16
 HHF[7:0].
 
constexpr uint32_t max22200::reg::kFaultOlfShift = 8
 OLF[7:0].
 
constexpr uint32_t max22200::reg::kFaultDpmShift = 0
 DPM[7:0].
 
constexpr bool max22200::reg::kFaultClearLsbByteFirst = true
 
constexpr uint32_t max22200::reg::kDpmIstartShift = 8
 DPM_ISTART[6:0] at bits 14:8.
 
constexpr uint32_t max22200::reg::kDpmIstartMask = 0x7FU
 DPM_ISTART width.
 
constexpr uint32_t max22200::reg::kDpmTdebShift = 4
 DPM_TDEB[3:0] at bits 7:4.
 
constexpr uint32_t max22200::reg::kDpmTdebMask = 0x0FU
 DPM_TDEB width.
 
constexpr uint32_t max22200::reg::kDpmIpthShift = 0
 DPM_IPTH[3:0] at bits 3:0.
 
constexpr uint32_t max22200::reg::kDpmIpthMask = 0x0FU
 DPM_IPTH width.
 
constexpr uint32_t max22200::reg::kDpmUsedMask = 0x7FFFU
 Bits 31:15 "must be set at zero".
 
constexpr uint32_t max22200::reg::kEnableUs = 500
 tEN max: ENABLE rising edge to SPI ready.
 
constexpr uint32_t max22200::reg::kWakeUpUs = 2500
 tWU max: ACTIVE = 1 to outputs active.
 
constexpr uint32_t max22200::reg::kDisableUs = 2500
 tDIS max: ENABLE falling edge to outputs Hi-Z.
 

Detailed Description

Banks, fields, reset values and timing.

Function Documentation

◆ CfgChannel()

constexpr uint8_t max22200::reg::CfgChannel ( uint8_t  channel)
constexprnoexcept

The bank of a channel's configuration register.

Parameters
channel0 to 7.
Returns
0x01 to 0x08.

◆ Command()

constexpr uint8_t max22200::reg::Command ( uint8_t  bank,
bool  write,
bool  eight_bit 
)
constexprnoexcept

The Command Register byte for one access.

Parameters
bankThe register bank (kStatus, CfgChannel(), kFault, kCfgDpm).
writetrue for a write, false for a read.
eight_bittrue for the most significant byte only, false for all 32 bits.
Returns
The command byte; RFU bits 6:5 are 0.

◆ FaultClearSdi()

constexpr uint32_t max22200::reg::FaultClearSdi ( uint32_t  mask)
constexprnoexcept

The register-aligned clear mask as SDI must carry it, for kFaultClearLsbByteFirst.

Parameters
maskBit n of FAULT set to clear it.
Returns
The value to shift out LSB byte first.

◆ PairModeShift()

constexpr uint32_t max22200::reg::PairModeShift ( uint8_t  pair)
constexprnoexcept

Shift of a channel pair's CMxy field in STATUS.

Parameters
pair0 (channels 0 and 1) to 3 (channels 6 and 7).
Returns
8, 10, 12 or 14.

Variable Documentation

◆ kActive

constexpr uint32_t max22200::reg::kActive
inlineconstexpr
Initial value:
= uint32_t{1}
<< 0U

ACTIVE: 0 = low-power, channels Hi-Z (reset).

◆ kComer

constexpr uint32_t max22200::reg::kComer
inlineconstexpr
Initial value:
= uint32_t{1}
<< 2U

COMER: a write had the wrong number of clocks.

◆ kDpm

constexpr uint32_t max22200::reg::kDpm
inlineconstexpr
Initial value:
= uint32_t{1}
<< 3U

DPM flag: some channel has a DPM bit in FAULT.

◆ kFaultClearLsbByteFirst

constexpr bool max22200::reg::kFaultClearLsbByteFirst = true
inlineconstexpr

The SDI byte order of a selective FAULT clear (MAX22200A). true: LSB byte first, as a 32-bit write (Figure 10) and as Figure 8 draws OCP[4] in the fourth byte, so the DPM byte leads. false: MSB byte first (OCP byte first), the other reading. Not verified on hardware: the one place to change if a bench check shows the other order.

◆ kFreqm

constexpr uint32_t max22200::reg::kFreqm
inlineconstexpr
Initial value:
= uint32_t{1}
<< 16U

FREQM: 0 = 100 kHz, 1 = 80 kHz oscillator.

◆ kHfs

constexpr uint32_t max22200::reg::kHfs
inlineconstexpr
Initial value:
= uint32_t{1}
<< 31U

HFS: half full-scale (KFS 7.5k instead of 15k).

◆ kHhf

constexpr uint32_t max22200::reg::kHhf
inlineconstexpr
Initial value:
= uint32_t{1}
<< 4U

HHF flag: some channel has an HHF bit in FAULT.

◆ kOcp

constexpr uint32_t max22200::reg::kOcp
inlineconstexpr
Initial value:
= uint32_t{1}
<< 6U

OCP flag: some channel has an OCP bit in FAULT.

◆ kOlf

constexpr uint32_t max22200::reg::kOlf
inlineconstexpr
Initial value:
= uint32_t{1}
<< 5U

OLF flag: some channel has an OLF bit in FAULT.

◆ kPairModeShift

constexpr uint32_t max22200::reg::kPairModeShift = 8
inlineconstexpr

CM10 at bits 9:8, CM32 11:10, CM54 13:12, CM76 15:14.

◆ kTrgnspi

constexpr uint32_t max22200::reg::kTrgnspi
inlineconstexpr
Initial value:
= uint32_t{1}
<< 23U

TRGnSPI: the TRIGA/TRIGB pin switches it.

◆ kUvm

constexpr uint32_t max22200::reg::kUvm = uint32_t{1} << 1U
inlineconstexpr

UVM: VM undervoltage; set at power-up, a STATUS read clears it.

◆ kVdrncdr

constexpr uint32_t max22200::reg::kVdrncdr
inlineconstexpr
Initial value:
= uint32_t{1}
<< 7U

VDRnCDR: 1 = voltage drive, 0 = current drive.