pub struct AHT20<I> where
    I: Read + Write
{ /* private fields */ }
Expand description

An AHT20 sensor on the I2C bus I.

The address of the sensor will be SENSOR_ADDRESS from this package, unless there is some kind of special address translating hardware in use.

Implementations

Initializes the SCD30 driver.

This consumes the I2C bus I. Before you can get temperature and humidity measurements, you must call the init method which calibrates the sensor. The address will almost always be SENSOR_ADDRESS from this crate.

Run the AHT20 init and calibration routines.

This must be called before any other methods except check_status. This method will take at least 40ms to return.

         Start (Power on)
                │
                ▼
            Wait 40 ms
                │
                ▼
 Command::CheckStatus (0x71)   ◄───    Wait 10 ms
                │                           ▲
                ▼                           │
        Status::Calibrated ──► No ──► Command::Initialize (0xBE)
                │
                ▼
               Yes

Destroys this driver and releases the I2C bus I

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.