Skip to main content

pamoja_scd4x_new

Function pamoja_scd4x_new 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_scd4x_new( bus: *const PamojaI2cBus, out_sensor: *mut *mut PamojaScd4x, ) -> PamojaStatus
Expand description

Creates an SCD40 or SCD41 driver on a bus; the part has one address. Nothing is sent until pamoja_scd4x_init or the first pamoja_scd4x_measure.

§Arguments

  • bus - the bus the part is on; the driver holds its own share.
  • 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.