MAX22200 Driver
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
max22200.hpp File Reference

Main driver class for MAX22200 octal solenoid and motor driver. More...

#include "max22200_registers.hpp"
#include "max22200_types.hpp"
#include "max22200_spi_interface.hpp"
#include "max22200_version.h"
#include <cstdint>
#include "max22200.ipp"

Go to the source code of this file.

Classes

class  max22200::MAX22200< SpiType >
 Main driver class for MAX22200 IC. More...
 

Namespaces

namespace  max22200
 

Functions

const char * max22200::GetDriverVersion () noexcept
 Get the compiled driver version string (namespace-level convenience)
 

Detailed Description

Main driver class for MAX22200 octal solenoid and motor driver.

This file provides the main MAX22200 driver class template that implements the two-phase SPI protocol per MAX22200 datasheet (Rev 1, 3/25, Document 19-100531).

Two-Phase SPI Protocol

The MAX22200 uses a two-phase SPI protocol for all register access:

Phase 1: Command Register Write

Phase 2: Data Transfer

Initialization Sequence

Per datasheet Figure 6 (Programming Flow Chart):

  1. Power-up: Set ENABLE pin HIGH, wait 0.5ms (tEN)
  2. Read STATUS: Clear UVM flag and deassert nFAULT pin
  3. Write STATUS: Set ACTIVE=1, configure HW (CMxy bits), set fault masks
  4. Configure Channels: Write CFG_CHx for each channel (HIT/HOLD currents, timing, etc.)
  5. Read STATUS: Verify UVM cleared and no faults
  6. Ready: Channels can now be activated via ONCH bits

Timing Specifications

Restrictions and Limitations

Fast 8-Bit Updates

For low-latency control, certain operations can use 8-bit MSB-only transfers:

Note
All SPI transfers must use Mode 0 (CPOL=0, CPHA=0).
The CMD pin must be held HIGH during the rising edge of CSB for Command Register writes.
Communication errors (COMER) are detected by checking STATUS[7:0] = 0x04 after Command Register write.