#i2c-driver #i2c #driver #bosch #embedded-hal-driver #bme280

no-std bme280-multibus

BME280 driver with support for SPI and I2C

7 releases (4 breaking)

0.5.0 Jan 10, 2024
0.4.0 Oct 30, 2023
0.3.0 Aug 4, 2023
0.2.2 Aug 13, 2022
0.1.0 Jan 1, 2022

#792 in Embedded development

26 downloads per month

MIT license

77KB
864 lines

crates.io docs.rs CI

bme280-multibus

BME280 driver with support for I2C and SPI buses.

Example

use bme280_multibus::{Address, Bme280, Sample, Standby};

const SETTINGS: bme280_multibus::Settings = bme280_multibus::Settings {
    config: bme280_multibus::Config::RESET
        .set_standby_time(bme280_multibus::Standby::Millis1000)
        .set_filter(bme280_multibus::Filter::X16),
    ctrl_meas: bme280_multibus::CtrlMeas::RESET
        .set_osrs_t(bme280_multibus::Oversampling::X8)
        .set_osrs_p(bme280_multibus::Oversampling::X8)
        .set_mode(bme280_multibus::Mode::Normal),
    ctrl_hum: bme280_multibus::Oversampling::X8,
};

let mut bme: Bme280<_> = Bme280::from_i2c0(i2c, Address::SdoGnd)?;
bme.settings(&SETTINGS)?;
let sample: Sample = bme.sample().unwrap();

Features

  • serde: Implement Serialize and Deserialize for Sample.

Dependencies

~91–275KB