Skip to main content

pamoja_ina219_init

Function pamoja_ina219_init 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_ina219_init( sensor: *mut PamojaIna219, ) -> PamojaStatus
Expand description

Resets the part, writes the configuration and the calibration, and reads the calibration back, which is the identity check a part with no id register allows.

§Arguments

  • sensor - the driver.

§Returns

PamojaStatus::Ok; PamojaStatus::InvalidArgument for a null driver; PamojaStatus::Io when the bus fails; or PamojaStatus::Codec when the calibration register does not hold what was written.

§Safety

sensor must be a live handle or null.