Skip to main content

pamoja_ina226_new

Function pamoja_ina226_new 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_ina226_new( bus: *const PamojaI2cBus, address: u8, settings: PamojaIna226Settings, out_sensor: *mut *mut PamojaIna226, ) -> PamojaStatus
Expand description

Creates an INA226 driver on a bus. Nothing is sent until pamoja_ina226_init or the first pamoja_ina226_measure.

§Arguments

  • bus - the bus the part is on; the driver holds its own share.
  • address - the address A1 and A0 select, which crate::sensors::pamoja_ina226_address works out.
  • settings - the shunt, the current it is sized for, and the register settings.
  • out_sensor - receives the driver.

§Returns

PamojaStatus::Ok with the driver in out_sensor, or PamojaStatus::InvalidArgument for a null argument.

§Safety

bus must be a live handle or null, and out_sensor a writable pointer or null.