scd4x/
lib.rs

1//! This library provides an embedded `no_std` driver for the [Sensirion SCD4x series](https://www.sensirion.com/de/umweltsensoren/evaluationskit-sek-environmental-sensing/evaluationskit-sek-scd41/).
2//! This driver was built using [`embedded-hal`](https://docs.rs/embedded-hal/) traits.
3//! The implementaion are based on [embedded-i2c-scd4x](https://github.com/Sensirion/embedded-i2c-scd4x) and [sgpc3-rs](https://github.com/mjaakkol/sgpc3-rs).
4//!
5//! ## `embedded-hal-async` Support
6//!
7//! This crate has optional support for the [`embedded-hal-async`] crate. The
8//! [`Scd4xAsync`] type provides a driver for a SCD4x sensor which uses
9//! [`embedded-hal-async`]'s asynchronous versions of the `I2c` and `DelayNs`
10//! traits, rather than the blocking versions from [`embedded-hal`].
11//!
12//! The [`embedded-hal-async`] support is feature flagged, so that users who
13//! don't need the asynchronous versions of these traits don't have to depend on
14//! `embedded-hal-async`. To use it, enable the `embedded-hal-async` feature
15//! flag in your `Cargo.toml`:
16//!
17//! ```toml
18//! [dependencies]
19//! scd4x = { version = "0.3", features = ["embedded-hal-async"] }
20//! ```
21
22#![deny(unsafe_code)]
23#![cfg_attr(not(any(test, feature = "std")), no_std)]
24
25mod scd4x;
26pub use crate::scd4x::Scd4x;
27
28#[cfg(feature = "embedded-hal-async")]
29pub use crate::scd4x::Scd4xAsync;
30
31mod error;
32pub use error::Error;
33
34pub mod commands;
35
36pub mod types;