1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright Claudio Mattera 2024.
//
// Distributed under the MIT License or the Apache 2.0 License at your option.
// See the accompanying files License-MIT.txt and License-Apache-2.0.txt, or
// online at
// https://opensource.org/licenses/MIT
// https://opensource.org/licenses/Apache-2.0

#![cfg_attr(not(doctest), doc = include_str!("../README.md"))]
#![cfg_attr(all(not(test), not(feature = "std")), no_std)]

#[cfg(feature = "async")]
mod r#async;
#[cfg(feature = "async")]
pub use self::r#async::Scd4x as AsyncScd4x;

#[cfg(feature = "blocking")]
mod blocking;
#[cfg(feature = "blocking")]
pub use self::blocking::Scd4x;

#[cfg(any(feature = "async", feature = "blocking"))]
mod checksum;
#[cfg(any(feature = "async", feature = "blocking"))]
use self::checksum::compute as compute_checksum;
#[cfg(any(feature = "async", feature = "blocking"))]
use self::checksum::verify as verify_checksum;

#[cfg(any(feature = "async", feature = "blocking"))]
mod constants;
#[cfg(any(feature = "async", feature = "blocking"))]
pub use self::constants::DEFAULT_ADDRESS;

#[cfg(any(feature = "async", feature = "blocking"))]
mod conversion;

#[cfg(any(feature = "async", feature = "blocking"))]
mod error;
#[cfg(any(feature = "async", feature = "blocking"))]
pub use self::error::Error;

#[cfg(any(feature = "async", feature = "blocking"))]
mod sample;
#[cfg(any(feature = "async", feature = "blocking"))]
pub use self::sample::{Altitude, Co2, Humidity, Pressure, Sample, Temperature};

#[cfg(any(feature = "async", feature = "blocking"))]
mod util;

#[cfg(any(feature = "async", feature = "blocking"))]
mod state;
#[cfg(any(feature = "async", feature = "blocking"))]
pub use self::state::{Idle, Measuring, State};