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