Trait shtcx::LowPower

source ·
pub trait LowPower<E: Error> {
    const WAKEUP_TIME_US: u32;

    // Required methods
    fn sleep(&mut self) -> Result<(), Error<E>>;
    fn start_wakeup(&mut self) -> Result<(), Error<E>>;
    fn wakeup(&mut self, delay: &mut impl DelayNs) -> Result<(), Error<E>>;
}
Expand description

Low power functionality (sleep and wakeup).

This functionality is only present on some of the sensors (e.g. the SHTC3, but not the SHTC1).

Required Associated Constants§

source

const WAKEUP_TIME_US: u32

Time the sensor needs until it is ready after a wakeup call.

Required Methods§

source

fn sleep(&mut self) -> Result<(), Error<E>>

Set sensor to sleep mode.

When in sleep mode, the sensor consumes around 0.3-0.6 µA. It requires a dedicated wakeup command to enable further I2C communication.

source

fn start_wakeup(&mut self) -> Result<(), Error<E>>

Wake up sensor from sleep mode.

source

fn wakeup(&mut self, delay: &mut impl DelayNs) -> Result<(), Error<E>>

Wake up sensor from sleep mode and wait until it is ready.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<I2C> LowPower<<I2C as ErrorType>::Error> for ShtCx<Sht2Gen, I2C>
where I2C: I2c<SevenBitAddress>, I2C::Error: Into<Error<I2C::Error>>,

source§

const WAKEUP_TIME_US: u32 = 240u32

source§

impl<I2C> LowPower<<I2C as ErrorType>::Error> for ShtCx<ShtGeneric, I2C>
where I2C: I2c<SevenBitAddress>, I2C::Error: Into<Error<I2C::Error>>,

source§

const WAKEUP_TIME_US: u32 = 240u32