Skip to main content

pamoja_sht3x_sim_reporting

Function pamoja_sht3x_sim_reporting 

Source
#[unsafe(no_mangle)]
pub extern "C" fn pamoja_sht3x_sim_reporting( address: u8, celsius: f32, relative_humidity: f32, ) -> *mut PamojaI2cPart
Expand description

Creates a simulated SHT3x that reads what it is asked to. It answers every single-shot command, a periodic fetch, and the status command with the replies a real part gives.

§Arguments

  • address - the address it answers to.
  • celsius - the temperature it reports.
  • relative_humidity - the humidity it reports, as a percentage.

§Returns

The part, which the caller releases with crate::hal::pamoja_i2c_part_free. Its readings land within three thousandths of a degree and two thousandths of a percent.