pub struct Aht40<I: I2c, D: DelayNs> { /* private fields */ }Expand description
AHT40 sensor.
Implementations§
Source§impl<I: I2c, D: DelayNs> Aht40<I, D>
impl<I: I2c, D: DelayNs> Aht40<I, D>
Sourcepub fn new(addr: u8, i2c: I, delay: D) -> Self
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.
Sourcepub fn read(&mut self, checksum: bool) -> Result<Aht40Measurement, SensorError>
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>
impl<I, D> RefUnwindSafe for Aht40<I, D>where
I: RefUnwindSafe,
D: RefUnwindSafe,
impl<I, D> Send for Aht40<I, D>
impl<I, D> Sync for Aht40<I, D>
impl<I, D> Unpin for Aht40<I, D>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more