Struct bmp280_rs::BMP280

source ·
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,

source

pub fn into_reset(self, i2c: &mut I2C) -> Result<BMP280<I2C, ModeSleep>, Error>

Reset the chip into sleep mode and reconfigure it with the current config.

source§

impl<I2C, E> BMP280<I2C, ModeNormal>where I2C: WriteRead<Error = E> + Write<Error = E>, E: Debug,

source

pub fn into_sleep_mode( self, i2c: &mut I2C ) -> Result<BMP280<I2C, ModeSleep>, Error>

Change into sleep mode

source

pub fn read_raw_pressure(&mut self, i2c: &mut I2C) -> Result<u32, Error>

Read the uncompensated pressure data. 20 bit value.

source

pub fn read_raw_temperature(&mut self, i2c: &mut I2C) -> Result<u32, Error>

Read the uncompensated temperature data. 20 bit value.

source

pub fn read_pressure(&mut self, i2c: &mut I2C) -> Result<i32, Error>

Read the compensated pressure.

source

pub fn read_temperature(&mut self, i2c: &mut I2C) -> Result<i32, Error>

Read the compensated temperature.

source§

impl<I2C, E> BMP280<I2C, ModeSleep>where I2C: WriteRead<Error = E> + Write<Error = E>, E: Debug,

source

pub fn new( i2c: &mut I2C, i2c_address: I2CAddress, config: Config ) -> Result<Self, Error>

source

pub fn into_normal_mode( self, i2c: &mut I2C ) -> Result<BMP280<I2C, ModeNormal>, Error>

Convert into normal mode.

Normal mode continuously samples.

source

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.

source

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!

source

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!

source

pub fn read_pressure(&mut self, i2c: &mut I2C) -> Result<i32, Error>

Read the compensated pressure.

Call trigger_measurement before calling this. NB You need to allow time for the measurement to complete!

source

pub fn read_temperature(&mut self, i2c: &mut I2C) -> Result<i32, Error>

Read the compensated temperature.

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.