MAX22200 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
max22200_registers.hpp File Reference

MAX22200 register map: the Command Register, the 32-bit register banks, their fields, reset values and the chip's timing. More...

#include <cstddef>
#include <cstdint>
#include "max22200_detail.hpp"

Go to the source code of this file.

Namespaces

namespace  max22200
 The MAX22200 driver: everything it declares lives here; internals in detail.
 
namespace  max22200::reg
 The MAX22200 register map.
 

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

MAX22200 register map: the Command Register, the 32-bit register banks, their fields, reset values and the chip's timing.

Section, table and figure names refer to the datasheet, Analog Devices 19-100531 Rev 1 (3/25).

Every access is two SPI transfers (Programming Information, "Command Register Description"): first the 8-bit Command Register, written with CMD high, which selects a bank, the direction and the length of what follows; then, with CMD low, the data: 32 bits, or only the most significant byte when bit 0 of the command is set. While the command is clocked in, SDO carries STATUS[7:0] (the Fault Flag Byte, Figure 7). Data written in 32-bit mode goes LSB byte first (Figure 10), data read comes MSB byte first (Figure 11); an 8-bit access touches bits 31:24 (Figures 12, 13).