Skip to main content

dht22_sensor/
lib.rs

1//! DHT22 Sensor Driver for Embedded Rust
2//!
3//! This crate provides a platform-agnostic driver for the DHT22 (AM2302) temperature
4//! and humidity sensor, built on top of the [`embedded-hal`] traits.
5//!
6//! # Features
7//! - Blocking synchronous API using `embedded-hal` traits
8//! - Designed for `no_std` environments
9//! - Optional logging support via `defmt`
10//!
11//! # Dependencies
12//! This driver depends on the following `embedded-hal` traits:
13//! - [`InputPin`] and [`OutputPin`] for GPIO access
14//! - [`DelayNs`] for accurate timing
15//!
16//! # Optional Features
17//! - `defmt`: Implements `defmt::Format` for logging support
18//!
19//! [`embedded-hal`]: https://docs.rs/embedded-hal
20//! [`InputPin`]: embedded_hal::digital::InputPin
21//! [`OutputPin`]: embedded_hal::digital::OutputPin
22//! [`DelayNs`]: embedded_hal::delay::DelayNs
23
24#![cfg_attr(not(test), no_std)]
25
26pub mod dht22;
27pub mod error;
28
29pub use dht22::{Dht22, Reading};
30pub use error::DhtError;