pub struct Bme680<I2C, STATE> { /* private fields */ }Expand description
The main BME680 driver structure.
Use Bme680::new(...) to start. The STATE generic tracks initialization.
Implementations§
Source§impl<I2C, E> Bme680<I2C, Idle>where
I2C: I2c<Error = E>,
impl<I2C, E> Bme680<I2C, Idle>where
I2C: I2c<Error = E>,
Sourcepub fn new(i2c: I2C, address: u8) -> Bme680<I2C, Uninitialized>
pub fn new(i2c: I2C, address: u8) -> Bme680<I2C, Uninitialized>
Creates a new driver instance in the Uninitialized state.
Source§impl<I2C, E> Bme680<I2C, Uninitialized>where
I2C: I2c<Error = E>,
impl<I2C, E> Bme680<I2C, Uninitialized>where
I2C: I2c<Error = E>,
Source§impl<I2C, E> Bme680<I2C, Ready>where
I2C: I2c<Error = E>,
impl<I2C, E> Bme680<I2C, Ready>where
I2C: I2c<Error = E>,
Sourcepub fn configure_sensor(&mut self, config: &mut Config) -> Result<(), E>
pub fn configure_sensor(&mut self, config: &mut Config) -> Result<(), E>
Applies a full sensor configuration.
Sourcepub fn set_gas_heater_profile(
&mut self,
config: GasProfile,
amb_temp: Celsius,
) -> Result<(), E>
pub fn set_gas_heater_profile( &mut self, config: GasProfile, amb_temp: Celsius, ) -> Result<(), E>
Configures heating duration and target temperature for a gas profile.
Sourcepub fn read_new_data(
&mut self,
delay: &mut impl DelayNs,
) -> Result<Measurement, E>
pub fn read_new_data( &mut self, delay: &mut impl DelayNs, ) -> Result<Measurement, E>
Triggers a measurement in ‘Forced Mode’, waits for completion, and returns compensated data.
Sourcepub fn read_chip_id(&mut self) -> Result<u8, E>
pub fn read_chip_id(&mut self) -> Result<u8, E>
Reads the Chip ID from the sensor (expected value: 0x61).
Sourcepub fn select_gas_profile(&mut self, profile: &GasProfile) -> Result<(), E>
pub fn select_gas_profile(&mut self, profile: &GasProfile) -> Result<(), E>
Selects one of the 10 available gas heater profiles.
Trait Implementations§
impl<I2C: Copy, STATE: Copy> Copy for Bme680<I2C, STATE>
Auto Trait Implementations§
impl<I2C, STATE> Freeze for Bme680<I2C, STATE>where
I2C: Freeze,
impl<I2C, STATE> RefUnwindSafe for Bme680<I2C, STATE>where
I2C: RefUnwindSafe,
STATE: RefUnwindSafe,
impl<I2C, STATE> Send for Bme680<I2C, STATE>
impl<I2C, STATE> Sync for Bme680<I2C, STATE>
impl<I2C, STATE> Unpin for Bme680<I2C, STATE>
impl<I2C, STATE> UnwindSafe for Bme680<I2C, STATE>where
I2C: UnwindSafe,
STATE: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more