...
solar_fsm keeps track of the state of the module. It transitions on fault events (and possibly commands from centre console, if those exist) and dispatches “action” events to interface with relay and calls the SPV1020 driver mppt to turn on/off the MPPTs. (This could be split off into multiple FSMs to handle specific fault sequences. Also, we could just call relay from solar_fsm instead of raising an action event if the relay logic is simple enough.)
relay will handle opening and closing the relay when it receives an appropriate action event. It will interface with the DRV120 driver.
Other:
mppt is a thin wrapper over the spv1020_mppt driver which handles dealing with the demux to support addressing multiple SPV1020s. It should provide the same functions as spv1020_mppt, but with an extra argument specifying which MPPT the command should go to; it’ll then set the demux to address that MPPT, then call the corresponding spv1020_mppt function. It should use the existing generic
mux
driver.This isn’t a driver because the fact that our SPV1020s are behind a demux is an implementation detail of the board which isn’t appropriate for a generic driver to deal with. This module encapsulates the interaction between the MPPTs and the demux.
Drivers
mcp3427_adc - driver for the MCP3427 analog-digital converter. Reportedly already exists in the MSXII codebase (project
solar_slave
) and can be reused.spv1020_mppt - driver for the SPV1020 maximum power point tracker and DC-DC converter. Communicates over SPI with the SPV1020s and issues commands (a list can be found in the SPV1020 datasheet). Should provide a separate function for calling each command.
drv120_relay - driver for the DRV120PWR relay driver.
...