pub struct BMP280<I2C, Mode> { /* private fields */ }
Implementations§
source§impl<I2C, E, Mode> BMP280<I2C, Mode>where
I2C: WriteRead<Error = E> + Write<Error = E>,
E: Debug,
impl<I2C, E, Mode> BMP280<I2C, Mode>where I2C: WriteRead<Error = E> + Write<Error = E>, E: Debug,
source§impl<I2C, E> BMP280<I2C, ModeNormal>where
I2C: WriteRead<Error = E> + Write<Error = E>,
E: Debug,
impl<I2C, E> BMP280<I2C, ModeNormal>where I2C: WriteRead<Error = E> + Write<Error = E>, E: Debug,
sourcepub fn into_sleep_mode(
self,
i2c: &mut I2C
) -> Result<BMP280<I2C, ModeSleep>, Error>
pub fn into_sleep_mode( self, i2c: &mut I2C ) -> Result<BMP280<I2C, ModeSleep>, Error>
Change into sleep mode
sourcepub fn read_raw_pressure(&mut self, i2c: &mut I2C) -> Result<u32, Error>
pub fn read_raw_pressure(&mut self, i2c: &mut I2C) -> Result<u32, Error>
Read the uncompensated pressure data. 20 bit value.
sourcepub fn read_raw_temperature(&mut self, i2c: &mut I2C) -> Result<u32, Error>
pub fn read_raw_temperature(&mut self, i2c: &mut I2C) -> Result<u32, Error>
Read the uncompensated temperature data. 20 bit value.
source§impl<I2C, E> BMP280<I2C, ModeSleep>where
I2C: WriteRead<Error = E> + Write<Error = E>,
E: Debug,
impl<I2C, E> BMP280<I2C, ModeSleep>where I2C: WriteRead<Error = E> + Write<Error = E>, E: Debug,
pub fn new( i2c: &mut I2C, i2c_address: I2CAddress, config: Config ) -> Result<Self, Error>
sourcepub fn into_normal_mode(
self,
i2c: &mut I2C
) -> Result<BMP280<I2C, ModeNormal>, Error>
pub fn into_normal_mode( self, i2c: &mut I2C ) -> Result<BMP280<I2C, ModeNormal>, Error>
Convert into normal mode.
Normal mode continuously samples.
sourcepub fn trigger_measurement(&self, i2c: &mut I2C) -> Result<(), Error>
pub fn trigger_measurement(&self, i2c: &mut I2C) -> Result<(), Error>
Trigger a “forced” mode single measurement.
Device internally returns to sleep mode after measurement is complete and then the pressure / temperature can be read.
sourcepub fn read_raw_pressure(&mut self, i2c: &mut I2C) -> Result<u32, Error>
pub fn read_raw_pressure(&mut self, i2c: &mut I2C) -> Result<u32, Error>
Read the uncompensated pressure data. 20 bit value.
Call trigger_measurement
before calling this.
NB You need to allow time for the measurement to complete!
sourcepub fn read_raw_temperature(&mut self, i2c: &mut I2C) -> Result<u32, Error>
pub fn read_raw_temperature(&mut self, i2c: &mut I2C) -> Result<u32, Error>
Read the uncompensated temperature data. 20 bit value.
Call trigger_measurement
before calling this.
NB You need to allow time for the measurement to complete!
Auto Trait Implementations§
impl<I2C, Mode> RefUnwindSafe for BMP280<I2C, Mode>where I2C: RefUnwindSafe, Mode: RefUnwindSafe,
impl<I2C, Mode> Send for BMP280<I2C, Mode>where I2C: Send, Mode: Send,
impl<I2C, Mode> Sync for BMP280<I2C, Mode>where I2C: Sync, Mode: Sync,
impl<I2C, Mode> Unpin for BMP280<I2C, Mode>where I2C: Unpin, Mode: Unpin,
impl<I2C, Mode> UnwindSafe for BMP280<I2C, Mode>where I2C: UnwindSafe, Mode: 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