[−][src]Struct hal_sensor_dht::DHTSensor
Interface for the DHT sensor.
Implementations
impl<P, T, I> DHTSensor<P, T, I> where
P: OutputPin + InputPin + IoPin,
T: DelayUs<u16> + DelayMs<u16>,
I: InterruptCtrl,
[src]
P: OutputPin + InputPin + IoPin,
T: DelayUs<u16> + DelayMs<u16>,
I: InterruptCtrl,
pub fn new(sensor: SensorType, p: P, t: T, i: I) -> DHTSensor<P, T, I>
[src]
Constructs a new DHTSensor
.
The following arguments need to be provided:
sensor
the DHT sensor type.p
- a pin which can act asInputPin
,OutputPin
andIoPin
t
- a timer which implementsDelayMs
andDelayUs
.i
- an interrupt controller, which is used to disable the interrupt while reading the input line.
pub fn read(&mut self) -> Result<Reading, DhtError>
[src]
Reads the input line and returns the temperature and humidity.
Note that the calling function should obey the timing requirements for the used sensor. So do not call this function without any delay between the readings.
Auto Trait Implementations
impl<P, T, I> Send for DHTSensor<P, T, I> where
I: Send,
P: Send,
T: Send,
I: Send,
P: Send,
T: Send,
impl<P, T, I> Sync for DHTSensor<P, T, I> where
I: Sync,
P: Sync,
T: Sync,
I: Sync,
P: Sync,
T: Sync,
impl<P, T, I> Unpin for DHTSensor<P, T, I> where
I: Unpin,
P: Unpin,
T: Unpin,
I: Unpin,
P: Unpin,
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,