Bme680

Struct Bme680 

Source
#[repr(C)]
pub struct Bme680<I2C, D> { /* private fields */ }
Expand description

Driver for the BME680 environmental sensor

Implementations§

Source§

impl<I2C, D> Bme680<I2C, D>
where D: DelayMs<u8>, I2C: Read + Write,

Source

pub fn soft_reset( i2c: &mut I2C, delay: &mut D, dev_id: I2CAddress, ) -> Result<(), <I2C as Read>::Error, <I2C as Write>::Error>

Source

pub fn init( i2c: I2C, delay: &mut D, dev_id: I2CAddress, ) -> Result<Bme680<I2C, D>, <I2C as Read>::Error, <I2C as Write>::Error>

Source

pub fn set_sensor_settings( &mut self, delay: &mut D, settings: Settings, ) -> Result<(), <I2C as Read>::Error, <I2C as Write>::Error>

Set the settings to be used during the sensor measurements

Source

pub fn get_sensor_settings( &mut self, desired_settings: DesiredSensorSettings, ) -> Result<SensorSettings, <I2C as Read>::Error, <I2C as Write>::Error>

Retrieve settings from sensor registers

§Arguments
  • desired_settings - Settings to be retrieved. Setting values may stay None if not retrieved.
Source

pub fn set_sensor_mode( &mut self, delay: &mut D, target_power_mode: PowerMode, ) -> Result<(), <I2C as Read>::Error, <I2C as Write>::Error>

Set the sensor into a certain power mode

§Arguments
  • target_power_mode - Desired target power mode
Source

pub fn get_sensor_mode( &mut self, ) -> Result<PowerMode, <I2C as Read>::Error, <I2C as Write>::Error>

Retrieve current sensor power mode via registers

Source

pub fn bme680_set_profile_dur(&mut self, tph_sett: TphSett, duration: Duration)

Source

pub fn get_profile_dur( &self, sensor_settings: &SensorSettings, ) -> Result<Duration, <I2C as Read>::Error, <I2C as Write>::Error>

Source

pub fn get_sensor_data( &mut self, delay: &mut D, ) -> Result<(FieldData, FieldDataCondition), <I2C as Read>::Error, <I2C as Write>::Error>

Retrieve the current sensor informations

Auto Trait Implementations§

§

impl<I2C, D> Freeze for Bme680<I2C, D>
where I2C: Freeze,

§

impl<I2C, D> RefUnwindSafe for Bme680<I2C, D>

§

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

§

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

§

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

§

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

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.