[][src]Struct dht_hal::Dht

pub struct Dht<P, T, K> { /* fields omitted */ }

A generic DHT-series sensor.

Currently, this supports the DHT11 and DHT22/AM2302.

Methods

impl<P, T, K, E> Dht<P, T, K> where
    P: InputPin<Error = E> + OutputPin<Error = E>,
    K: DhtKind
[src]

pub fn new(pin: P, timer: T) -> Self[src]

Returns a new DHT sensor.

impl<P, T, K, E> Dht<P, T, K> where
    P: InputPin<Error = E> + OutputPin<Error = E>,
    T: DelayUs<u16> + DelayMs<u16>,
    K: DhtKind
[src]

pub fn read_blocking(&mut self) -> Result<Reading<K>, Error<E>>[src]

Read from the DHT sensor using blocking delays.

Note that this is timing-critical, and should be run with interrupts disabled.

Trait Implementations

impl<P: Debug, T: Debug, K: Debug> Debug for Dht<P, T, K>[src]

Auto Trait Implementations

impl<P, T, K> Send for Dht<P, T, K> where
    K: Send,
    P: Send,
    T: Send

impl<P, T, K> Sync for Dht<P, T, K> where
    K: Sync,
    P: Sync,
    T: Sync

impl<P, T, K> Unpin for Dht<P, T, K> where
    K: Unpin,
    P: Unpin,
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.