Drv::Ina219Manager
The INA219 Manager component interfaces with the INA219 current/power monitor to provide voltage, current, and power measurements.
Usage Examples
The INA219 Manager component is designed to be called periodically to collect and return sensor data. It operates as a passive component that responds to manager calls.
Typical Usage
- The component is instantiated and initialized during system startup
- A manager calls any of the input ports:
VoltageGet, CurrentGet, or PowerGet
- On each call, the component:
- Fetches fresh sensor samples from the sensor
- Converts sensor data to double precision floating point
- Writes telemetry data
- Returns data in SI units
Class Diagram
classDiagram
namespace Drv {
class Ina219ManagerComponentBase {
<<Auto-generated>>
}
class Ina219Manager {
- m_dev: const struct device*
+ Ina219Manager(const char* compName)
+ ~Ina219Manager()
+ configure(const struct device* dev)
- voltageGet_handler(const FwIndexType portNum): F64
- currentGet_handler(const FwIndexType portNum): F64
- powerGet_handler(const FwIndexType portNum): F64
}
}
Ina219ManagerComponentBase <|-- Ina219Manager : inherits
Port Descriptions
| Name |
Type |
Description |
| VoltageGet |
sync input |
Triggers voltage data collection and returns voltage in volts |
| CurrentGet |
sync input |
Triggers current data collection and returns current in amps |
| PowerGet |
sync input |
Triggers power data collection and returns power in watts |
Sequence Diagrams
VoltageGet
sequenceDiagram
participant Manager
participant INA219 Manager
participant Zephyr Sensor API
participant INA219 Sensor
Manager-->>INA219 Manager: Call VoltageGet synchronous input port
INA219 Manager->>Zephyr Sensor API: Fetch sensor data
Zephyr Sensor API->>INA219 Sensor: Read sensor
INA219 Sensor->>Zephyr Sensor API: Return sensor data
Zephyr Sensor API->>INA219 Manager: Return voltage sensor_value struct
INA219 Manager->>INA219 Manager: Write telemetry
INA219 Manager-->>Manager: Return F64 voltage in volts
CurrentGet
sequenceDiagram
participant Manager
participant INA219 Manager
participant Zephyr Sensor API
participant INA219 Sensor
Manager-->>INA219 Manager: Call CurrentGet synchronous input port
INA219 Manager->>Zephyr Sensor API: Fetch sensor data
Zephyr Sensor API->>INA219 Sensor: Read sensor
INA219 Sensor->>Zephyr Sensor API: Return sensor data
Zephyr Sensor API->>INA219 Manager: Return current sensor_value struct
INA219 Manager->>INA219 Manager: Write telemetry
INA219 Manager-->>Manager: Return F64 current in amps
PowerGet
sequenceDiagram
participant Manager
participant INA219 Manager
participant Zephyr Sensor API
participant INA219 Sensor
Manager-->>INA219 Manager: Call PowerGet synchronous input port
INA219 Manager->>Zephyr Sensor API: Fetch sensor data
Zephyr Sensor API->>INA219 Sensor: Read sensor
INA219 Sensor->>Zephyr Sensor API: Return sensor data
Zephyr Sensor API->>INA219 Manager: Return power sensor_value struct
INA219 Manager->>INA219 Manager: Write telemetry
INA219 Manager-->>Manager: Return F64 power in watts
Requirements
| Name |
Description |
Validation |
| VoltageGet Port |
The component shall provide access to voltage sensor data and return in volts |
Integration test |
| CurrentGet Port |
The component shall provide access to current sensor data and return in amps |
Integration test |
| PowerGet Port |
The component shall provide access to power sensor data and return in watts |
Integration test |
| DeviceNotReady Event |
The component shall emit a throttled warning event when the device is not ready |
Verify event is emitted and throttled to 5 occurrences |
Change Log
| Date |
Description |
| 2025-11-03 |
Initial INA219 Manager component |