Skip to main content

Aht40

Struct Aht40 

Source
pub struct Aht40<I: I2c, D: DelayNs> { /* private fields */ }
Expand description

AHT40 sensor.

Implementations§

Source§

impl<I: I2c, D: DelayNs> Aht40<I, D>

Source

pub fn new(addr: u8, i2c: I, delay: D) -> Self

Requires >= 5ms (datasheet says this, but I recommend 100ms like AHT30) after power-up, this function includes no delay, callers must ensure this timing.

Source

pub fn read(&mut self, checksum: bool) -> Result<Aht40Measurement, SensorError>

Measure then read sensor, takes >= 80ms to be done. Enable checksum is recommended.

Auto Trait Implementations§

§

impl<I, D> Freeze for Aht40<I, D>
where I: Freeze, D: Freeze,

§

impl<I, D> RefUnwindSafe for Aht40<I, D>

§

impl<I, D> Send for Aht40<I, D>
where I: Send, D: Send,

§

impl<I, D> Sync for Aht40<I, D>
where I: Sync, D: Sync,

§

impl<I, D> Unpin for Aht40<I, D>
where I: Unpin, D: Unpin,

§

impl<I, D> UnsafeUnpin for Aht40<I, D>
where I: UnsafeUnpin, D: UnsafeUnpin,

§

impl<I, D> UnwindSafe for Aht40<I, D>
where I: UnwindSafe, D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.