Crate ina219

Crate ina219 

Source
Expand description

§ina219

crates.io

Blocking and async driver for the INA219 current/power monitor by Texas Instruments.

§Features

This crate has the following feature flags (default features in bold):

NameDescription
syncProvide a blocking driver implementation
asyncProvide an async driver implementation
paranoidPerform extra checks
no_transactionDisable use of transactions and perform individual system calls
stdUse the standard library and impl std::error::Error on all error types

For more detailed descriptions see Cargo.toml.

§Calibration

This driver includes ways to use the calibration feature of the INA219. However, the errors introduced by the calculations can be unintuitive. So it can make sense to just compute the current and power in software.

§Examples

The examples folder contains code that demonstrates how this driver can be used. They were tested on a Raspberry Pi with an INA219 that was configured for address 0x42.

Modules§

address
I2C address of the INA219 on the bus
calibration
Types and trait to calibrate the INA219
configuration
Types used to set the configuration for the INA219
errors
Errors that can be returned by the different functions
measurements
Types wrapping the measurements of the INA219

Structs§

AsyncIna219
Embedded HAL compatible driver for the INA219
SyncIna219
Embedded HAL compatible driver for the INA219