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
-
| SpiType | The 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));
if (driver.Initialize() == DriverStatus::OK) {
ChannelConfig config;
config.drive_mode = DriveMode::CDR;
config.side_mode = SideMode::LOW_SIDE;
config.hit_setpoint = 400.0f;
config.hold_setpoint = 200.0f;
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);
}