Interface for drivers.

class mpf.platforms.interfaces.driver_platform_interface.DriverPlatformInterface(config, number)

Interface for drivers in hardware platforms.

DriverPlatformInterface is an abstract base class that should be overridden for all driver interface classes on supported platforms. This class ensures the proper required methods are implemented to support driver operations in MPF.

Initialise driver.


Disable the driver.


Enable this driver, which means it’s held “on” indefinitely until it’s explicitly disabled.


Return the name of the board of this driver.

pulse(coil, milliseconds)

Pulse a driver.

Pulse this driver for a pre-determined amount of time, after which this driver is turned off automatically. Note that on most platforms, pulse times are a max of 255ms. (Beyond that MPF will send separate enable() and disable() commands.

Parameters:milliseconds – The number of ms to pulse this driver for. You should raise a ValueError if the value is out of range for your platform.
Returns:A integer of the actual time this driver is going to be pulsed for. MPF uses this for timing in certain situations to make sure too many drivers aren’t activated at once.