Crates.io | bme280-multibus |
lib.rs | bme280-multibus |
version | 0.5.0 |
source | src |
created_at | 2022-01-01 20:01:42.194893 |
updated_at | 2024-01-10 02:39:09.147456 |
description | BME280 driver with support for SPI and I2C |
homepage | |
repository | https://github.com/newAM/bme280-multibus |
max_upload_size | |
id | 506293 |
size | 95,778 |
BME280 driver with support for I2C and SPI buses.
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();
serde
: Implement Serialize
and Deserialize
for Sample
.