embedded_dht_rs/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#![no_std]

mod dht;

#[cfg(feature = "dht11")]
pub mod dht11;

#[cfg(feature = "dht20")]
pub mod dht20;

#[cfg(feature = "dht22")]
pub mod dht22;

/// Represents a reading from the sensor.
pub struct SensorReading<T> {
    pub humidity: T,
    pub temperature: T,
}

/// Possible errors when interacting with the sensor.
#[derive(Debug)]
pub enum SensorError {
    ChecksumMismatch,
}