Skip to main content

bme280_rs/
lib.rs

1// Copyright Claudio Mattera 2022-2026.
2//
3// Distributed under the MIT License or the Apache 2.0 License at your option.
4// See the accompanying files LICENSE-MIT.txt and LICENSE-APACHE-2.0.txt, or
5// online at
6// https://opensource.org/licenses/MIT
7// https://opensource.org/licenses/Apache-2.0
8
9#![cfg_attr(not(doctest), doc = include_str!("../README.md"))]
10#![no_std]
11
12#[cfg(test)]
13extern crate alloc;
14
15#[cfg(feature = "async")]
16mod r#async;
17#[cfg(feature = "async")]
18pub use self::r#async::Bme280 as AsyncBme280;
19
20#[cfg(feature = "blocking")]
21mod blocking;
22#[cfg(feature = "blocking")]
23pub use self::blocking::Bme280;
24
25#[cfg(any(feature = "async", feature = "blocking"))]
26mod calibration;
27#[cfg(any(feature = "async", feature = "blocking"))]
28use self::calibration::CalibrationData;
29
30#[cfg(any(feature = "async", feature = "blocking"))]
31mod configuration;
32#[cfg(any(feature = "async", feature = "blocking"))]
33pub use self::configuration::Configuration;
34#[cfg(any(feature = "async", feature = "blocking"))]
35pub use self::configuration::Filter;
36#[cfg(any(feature = "async", feature = "blocking"))]
37pub use self::configuration::Oversampling;
38#[cfg(any(feature = "async", feature = "blocking"))]
39pub use self::configuration::SensorMode;
40#[cfg(any(feature = "async", feature = "blocking"))]
41pub use self::configuration::StandbyTime;
42#[cfg(any(feature = "async", feature = "blocking"))]
43pub use self::configuration::Status;
44
45#[cfg(any(feature = "async", feature = "blocking"))]
46mod constants;
47#[cfg(any(feature = "async", feature = "blocking"))]
48pub use self::constants::CHIP_ID;
49#[cfg(any(feature = "async", feature = "blocking"))]
50pub use self::constants::DEFAULT_ADDRESS;
51
52#[cfg(any(feature = "async", feature = "blocking"))]
53mod macros;
54
55#[cfg(any(feature = "async", feature = "blocking"))]
56mod sample;
57#[cfg(any(feature = "async", feature = "blocking"))]
58pub use self::sample::Humidity;
59#[cfg(any(feature = "async", feature = "blocking"))]
60pub use self::sample::Pressure;
61#[cfg(any(feature = "async", feature = "blocking"))]
62pub use self::sample::Sample;
63#[cfg(any(feature = "async", feature = "blocking"))]
64pub use self::sample::Temperature;