Skip to main content

pamoja_ina226_init

Function pamoja_ina226_init 

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

Resets the part, checks it is an INA226, writes the configuration and the calibration, and reads the calibration back.

§Arguments

  • sensor - the driver.

§Returns

PamojaStatus::Ok; PamojaStatus::InvalidArgument for a null driver; PamojaStatus::Io when the bus fails; or PamojaStatus::Codec when the id registers are not an INA226’s or the calibration does not read back.

§Safety

sensor must be a live handle or null.