Skip to main content

pamoja_tmp117_new

Function pamoja_tmp117_new 

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

Creates a TMP117 driver on a bus. Nothing is sent until pamoja_tmp117_init or the first pamoja_tmp117_measure.

§Arguments

  • bus - the bus the part is on; the driver holds its own share.
  • address - one of the PAMOJA_TMP117_ADDRESS_ constants, by where ADD0 is tied.
  • averaging - the averaging code, 0..=3, for 1, 8, 32, or 64 conversions per result; 1, eight, is the factory setting.
  • 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.