pub struct DHT11<PIN, STATE> { /* private fields */ }Implementations§
Source§impl<PIN, E> DHT11<PIN, Idle>
impl<PIN, E> DHT11<PIN, Idle>
pub fn new(pin: PIN) -> DHT11<PIN, Uninitialized>
Sourcepub fn new_and_initialized(
pin: PIN,
delay: &mut impl DelayNs,
) -> Result<DHT11<PIN, Initialized>, E>
pub fn new_and_initialized( pin: PIN, delay: &mut impl DelayNs, ) -> Result<DHT11<PIN, Initialized>, E>
Creates and initializes the sensor in one go. ⚠️ WARNING: This is a blocking call that takes ~3 seconds to complete.
Source§impl<PIN, E> DHT11<PIN, Uninitialized>
impl<PIN, E> DHT11<PIN, Uninitialized>
Sourcepub fn initialize(
self,
delay: &mut impl DelayNs,
) -> Result<DHT11<PIN, Initialized>, E>
pub fn initialize( self, delay: &mut impl DelayNs, ) -> Result<DHT11<PIN, Initialized>, E>
Initializes the sensor with required power-on delays ⚠️ WARNING: Wait at least 2 seconds after initialization before reading the sensor
Source§impl<PIN, E> DHT11<PIN, Initialized>
impl<PIN, E> DHT11<PIN, Initialized>
Sourcepub fn read_temp_and_hum(
&mut self,
delay: &mut impl DelayNs,
) -> Result<Measurement, E>
pub fn read_temp_and_hum( &mut self, delay: &mut impl DelayNs, ) -> Result<Measurement, E>
Reads temperature and humidity from the sensor
Auto Trait Implementations§
impl<PIN, STATE> Freeze for DHT11<PIN, STATE>where
PIN: Freeze,
impl<PIN, STATE> RefUnwindSafe for DHT11<PIN, STATE>where
PIN: RefUnwindSafe,
STATE: RefUnwindSafe,
impl<PIN, STATE> Send for DHT11<PIN, STATE>
impl<PIN, STATE> Sync for DHT11<PIN, STATE>
impl<PIN, STATE> Unpin for DHT11<PIN, STATE>
impl<PIN, STATE> UnwindSafe for DHT11<PIN, STATE>where
PIN: UnwindSafe,
STATE: 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