embedded_dht_rs/lib.rs
1#![doc = include_str!("../README.md")]
2#![no_std]
3
4mod dht;
5
6#[cfg(feature = "dht11")]
7pub mod dht11;
8
9#[cfg(feature = "dht20")]
10pub mod dht20;
11
12#[cfg(feature = "dht22")]
13pub mod dht22;
14
15/// Represents a reading from the sensor.
16pub struct SensorReading<T> {
17 pub humidity: T,
18 pub temperature: T,
19}
20
21/// Possible errors when interacting with the sensor.
22#[derive(Debug)]
23pub enum SensorError {
24 ChecksumMismatch,
25 Timeout,
26 PinError
27}