[][src]Crate drogue_bme680

drogue-bme680 is a crate to interface with the BME680 sensor.

The BME680 sensor is a "low power gas, pressure, temperature & humidity sensor" from Bosch Sensortec.

The crate provides two layers of access to the sensor. Bme680Sensor provides general purpose access to the sensor. While Bme680Controller takes care of most steps of the default sensor workflow for taking measurements, providing a simpler, more user-friendly interface.

Example

use drogue_bme680::*;

fn main() -> ! {
  let i2c = mock::blocking_i2c();
  let mut timer = mock::create_timer();

  let bme680 = Bme680Sensor::from(i2c, Address::Secondary).unwrap();

  let mut controller = Bme680Controller::new(
    bme680,
    &mut timer,
    Configuration::standard(),
    || 25,  // fixed 25 degrees Celsius ambient temperature
  ).unwrap();
   
  loop {
    let result = controller.measure_default().unwrap();
    log::info!("Measured: {:?}", result);
  }
}

Known limitations

  • Currently, the crate only provide access to the sensor using I2C.

Structs

Bme680Controller

Controller for taking measurements with the sensor.

Bme680Sensor

General purpose sensor access.

CalibrationInformation

Sensor calibration information.

Config
Configuration

Configuration for the controller.

ControlGas

Control gas measurement.

ControlGasHeater

Control gas sensor heater.

ControlHumidity

Control humidity oversampling.

ControlMeasurement

Control measurement and temperature, pressure oversampling.

Data

Processes measurement data.

GasResistance
GasWaitTime
Measurement
ParameterH1
ParameterH2
RawData

The raw sensor data.

State

Current state.

SwapU16

Enums

Address
Error

Error for sensor operations.

Filter
HeaterProfile
Mode
Multiplier
Oversampling

Functions

calc_profile_duration

Calculate how a measurement will take, based on the provided settings.

from_raw

Convert the raw sensor data into actual measurements, using the calibration information.