HF-MAX22200 Driver 0.1.0-dev
HF-MAX22200 C++ Driver
Loading...
Searching...
No Matches
Basic

Main driver class for MAX22200 IC.

Main driver class for MAX22200 ICThis class provides a high-level API for controlling the MAX22200 octal solenoid and motor driver. It handles the two-phase SPI protocol internally and provides convenient methods for channel configuration, control, and fault monitoring.

Template Parameters
SpiTypeThe SPI interface implementation type that inherits from max22200::SpiInterface<SpiType>. Must implement:
  • Transfer() for SPI data transfer
  • GpioSet() for CMD/ENABLE/FAULT pin control
  • GpioGet() for FAULT pin reading

usage (CDR mode):

MySPI spi;
MAX22200<MySPI> driver(spi);
driver.SetBoardConfig(BoardConfig(30.0f, false)); // IFS from RREF
if (driver.Initialize() == DriverStatus::OK) {
ChannelConfig config;
config.drive_mode = DriveMode::CDR;
config.side_mode = SideMode::LOW_SIDE;
config.hit_setpoint = 400.0f; // desired current, mA (IFS from SetBoardConfig above)
config.hold_setpoint = 200.0f; // mA
config.hit_time_ms = 10.0f;
config.chop_freq = ChopFreq::FMAIN_DIV2;
config.hit_current_check_enabled = true;
driver.ConfigureChannel(0, config);
driver.EnableChannel(0);
}