Struct bsec::bme::bme680::Bme680Sensor[][src]

pub struct Bme680Sensor<I2C, D> where
    I2C: Read + Write,
    D: DelayMs<u8>, 
{ /* fields omitted */ }

Implementation of the BmeSensor trait for the BME680 sensor.

For the gas resistance measurement, the last reading of the temperature sensor will be used as ambient temperature.

Example

use bme680::{Bme680, I2CAddress};
use bsec::bme::bme680::Bme680Sensor;
use linux_embedded_hal::{Delay, I2cdev};

let i2c = I2cdev::new("/dev/i2c")?;
let bme680 = Bme680::init(i2c, Delay {}, I2CAddress::Primary)?;
let sensor = Bme680Sensor::new(bme680, 20.);

Implementations

impl<I2C, D> Bme680Sensor<I2C, D> where
    I2C: Read + Write,
    D: DelayMs<u8>, 
[src]

pub fn new(
    bme680: Bme680<I2C, D>,
    initial_ambient_temperature_celsius: f32
) -> Self
[src]

Create a new instance reading measurement from bme680.

initial_ambient_temperature_celsius sets the ambient temperature for the first gas resistance reading. All subsequent readings use the respective last temperature reading.

Trait Implementations

impl<I2C, D> BmeSensor for Bme680Sensor<I2C, D> where
    D: DelayMs<u8>,
    I2C: Read + Write,
    <I2C as Read>::Error: Debug,
    <I2C as Write>::Error: Debug
[src]

type Error = Error<<I2C as Read>::Error, <I2C as Write>::Error>

Error type if an operation with the sensor fails.

Auto Trait Implementations

impl<I2C, D> RefUnwindSafe for Bme680Sensor<I2C, D> where
    D: RefUnwindSafe,
    I2C: RefUnwindSafe

impl<I2C, D> Send for Bme680Sensor<I2C, D> where
    D: Send,
    I2C: Send

impl<I2C, D> Sync for Bme680Sensor<I2C, D> where
    D: Sync,
    I2C: Sync

impl<I2C, D> Unpin for Bme680Sensor<I2C, D> where
    D: Unpin,
    I2C: Unpin

impl<I2C, D> UnwindSafe for Bme680Sensor<I2C, D> where
    D: UnwindSafe,
    I2C: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.