Pyro Drivers¶
The pyrotechnic ignition driver class provides a hardware-agnostic API for
arming, triggering, and sensing pyro channels. Two implementations exist:
cap_pyro (capacitor-based) and mini_pyro.
Operations¶
-
int pyro_arm(const struct device *dev, uint32_t channel)¶
Arm a pyro channel.
- Parameters:
dev – Pyro device instance.
channel – Number of the channel to arm.
- Return values:
0 – if successful.
-errno – Other negative errno code on failure.
-
int pyro_disarm(const struct device *dev, uint32_t channel)¶
Disarm a pyro channel.
- Parameters:
dev – Pyro device instance.
channel – Number of the channel to disarm.
- Return values:
0 – if successful.
-errno – Other negative errno code on failure.
-
int pyro_secure(const struct device *dev, uint32_t channel)¶
Secure a pyro channel.
- Parameters:
dev – Pyro device instance.
channel – Number of the channel to secure.
- Return values:
0 – if successful.
-errno – Other negative errno code on failure.
-
int pyro_trigger_channel(const struct device *dev, uint32_t channel)¶
Trigger a pyro channel.
- Parameters:
dev – Pyro device instance.
channel – Number of the channel to trigger.
- Return values:
0 – if successful.
-EINVAL – if
channelcan not be set.-errno – Other negative errno code on failure.
-
int pyro_charge_channel(const struct device *dev, uint32_t channel)¶
Charge a pyro channel’s capacitor.
- Parameters:
dev – Pyro device instance.
channel – Number of the channel to charge.
- Return values:
0 – if successful.
-EINVAL – if
channelcan not be set.-errno – Other negative errno code on failure.
-
int pyro_sense_channel(const struct device *dev, uint32_t channel, uint32_t *val)¶
Read a pyro channel’s “health”.
- Parameters:
dev – Pyro device instance.
channel – Number of the channel to read the “sense”.
val – [out] Read value.
- Return values:
0 – if successful.
-EINVAL – if
channelis invalid.-errno – Other negative errno code on failure.
-
int pyro_read_cap_channel(const struct device *dev, uint32_t channel, uint32_t *val)¶
Read a pyro channel’s capacitor charge.
- Parameters:
dev – Pyro device instance.
channel – Number of the channel to read the capacitor voltage of.
val – [out] Read value.
- Return values:
0 – if successful.
-EINVAL – if
channelis invalid.-errno – Other negative errno code on failure.
-
int pyro_get_nchannels(const struct device *dev)¶
Get the number of pyro channels on this module.
- Parameters:
dev – Pyro device instance.
- Return values:
-errno – Negative errno code on failure.
- Returns:
Number of channels on success.
-
PYRO_DEVICE_DT_DEFINE(node_id, init_fn, pm_device, data_ptr, cfg_ptr, level, prio, api_ptr, ...)¶
Like DEVICE_DT_DEFINE() with pyro specifics.
Defines a device which implements the pyro API.
- Parameters:
node_id – The devicetree node identifier.
init_fn – Name of the init function of the driver.
pm_device – PM device resources reference (NULL if device does not use PM).
data_ptr – Pointer to the device’s private data.
cfg_ptr – The address to the structure containing the configuration information for this instance of the driver.
level – The initialization level. See SYS_INIT() for details.
prio – Priority within the selected initialization level. See SYS_INIT() for details.
api_ptr – Provides an initial pointer to the API function struct used by the driver. Can be NULL.
-
PYRO_DEVICE_DT_INST_DEFINE(inst, ...)¶
Like PYRO_DEVICE_DT_DEFINE() for an instance of a DT_DRV_COMPAT compatible.
- Parameters:
inst – instance number. This is replaced by
DT_DRV_COMPAT(inst)in the call to PYRO_DEVICE_DT_DEFINE().... – other parameters as expected by PYRO_DEVICE_DT_DEFINE().
-
struct pyro_driver_api¶
- #include <pyro.h>
Pyro driver class operations.