Skip to main content

pamoja_sht3x_new

Function pamoja_sht3x_new 

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

Creates an SHT3x driver on a bus. Nothing is sent until pamoja_sht3x_init or the first pamoja_sht3x_measure.

§Arguments

  • bus - the bus the part is on; the driver holds its own share.
  • address - PAMOJA_SHT3X_I2C_ADDRESS_A with ADDR low, PAMOJA_SHT3X_I2C_ADDRESS_B with ADDR high.
  • repeatability - 0 low, 1 medium, or 2 high, which trades noise against measurement time.
  • out_sensor - receives the driver.

§Returns

PamojaStatus::Ok with the driver in out_sensor, or PamojaStatus::InvalidArgument for a null argument or a repeatability code the part does not have.

§Safety

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