Struct rustduino::sensors::AHT10[][src]

#[repr(C, packed)]
pub struct AHT10<'a> { /* fields omitted */ }
Expand description

Used to control the AHT10 Arduino sensor

Elements

  • address - a u8, used to store the address to control the functioning AHT10 sensor.
  • i2c - a twi struct object, which would be used to interface the functioning of sensor with communication protocol I2C.
  • vec - a vector with u8 objects, It would be used to store the data read through the sensors.

Implementations

Creates a new memory mapped IO at the correct location including a 20ms reset delay for wake-up.

Returns

  • a reference to AHT10 structure - Which would be used to control the sensor.

Returns reference to the structure without any reset delay.

Returns

  • a reference to AHT10 structure - Which would be used to control the sensor.

Initiates the transmission by self initiating the sensor.

Returns

  • a boolean - Which is true if transmission initiated otherwise false.

Restart sensor, without power off in around ~20ms with all registers restored to default.

Reads data from slave mode using the I2C protocol.

Triggers the AHT10 to read temperature/humidity.

Adds a delay of 5ms when the sensor is already busy with some processing.

Performs measurement of temperature using the functions trigger_slave() and read_to_buffer().

Reads value returned by the slave.

Returns

  • a u8 - The read value.

Reads 20 bit raw humidity data.

Returns

  • a f64 - The relative humidity in percentage.

Reads 20 bit raw temperature data.

Returns

  • a f64 - The temperature in degree celsius.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.