Cargo Features

[dependencies]
ina219 = { version = "0.2.0", default-features = false, features = ["sync", "async", "std", "paranoid", "no_transaction"] }
default = async, paranoid, sync

These default features are set whenever ina219 is added without default-features = false somewhere in the dependency tree.

sync default

Provide a blocking driver implementation

Enables embedded-hal

async default

Provide an async driver implementation

Enables embedded-hal-async

std

Use the standard library and impl std::error::Error on all error types

paranoid default

Perform checks to see if the INA219 reacts as expected such as:

  • All measurements are in the configured ranges
  • We can read back the configuration we have written without any changes

This does cause some overhead such as memorizing the last written configuration and performing more actions on the bus. So it can be disabled by setting default-features = false.

no_transaction

When using a raspberry pi and the I2C transaction an operation not supported error is raised. This feature replaces the usage of a single transaction with multiple write_read operations.