pub struct AHT10<I2C> { /* private fields */ }
Implementations§
Source§impl<I2C, E> AHT10<I2C>
impl<I2C, E> AHT10<I2C>
pub fn new(i2c: I2C) -> Self
Sourcepub fn initialize(&mut self) -> Result<(), AhtError<E>>
pub fn initialize(&mut self) -> Result<(), AhtError<E>>
Initialize the sensor.
Sourcepub fn read_status(&mut self) -> Result<Aht10Status, AhtError<E>>
pub fn read_status(&mut self) -> Result<Aht10Status, AhtError<E>>
Read the internal status register.
Sourcepub fn read_data<Delay: DelayMs<u16>>(
&mut self,
delay: &mut Delay,
) -> Result<Aht10Data, AhtError<E>>
pub fn read_data<Delay: DelayMs<u16>>( &mut self, delay: &mut Delay, ) -> Result<Aht10Data, AhtError<E>>
Triggers and waits for measurements. This is a blocking function, which takes at least 70 ms (3 retries of 75ms each).
Sourcepub fn soft_reset<Delay: DelayMs<u16>>(
&mut self,
delay: &mut Delay,
) -> Result<(), AhtError<E>>
pub fn soft_reset<Delay: DelayMs<u16>>( &mut self, delay: &mut Delay, ) -> Result<(), AhtError<E>>
Reset the sensor. This is a blocking function, the reset takes 20ms. WARNING: You must re-initialize the sensor after the reset !
Auto Trait Implementations§
impl<I2C> Freeze for AHT10<I2C>where
I2C: Freeze,
impl<I2C> RefUnwindSafe for AHT10<I2C>where
I2C: RefUnwindSafe,
impl<I2C> Send for AHT10<I2C>where
I2C: Send,
impl<I2C> Sync for AHT10<I2C>where
I2C: Sync,
impl<I2C> Unpin for AHT10<I2C>where
I2C: Unpin,
impl<I2C> UnwindSafe for AHT10<I2C>where
I2C: 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