Struct bmp280_ehal::BMP280

source ·
pub struct BMP280<I2C: WriteRead> { /* private fields */ }
Expand description

BMP280 driver

Implementations§

source§

impl<I2C: WriteRead> BMP280<I2C>

source

pub fn new_with_address<E>(i2c: I2C, addr: u8) -> Result<BMP280<I2C>, E>where I2C: WriteRead<Error = E>,

Creates new BMP280 driver with the specified address

source

pub fn new<E>(i2c: I2C) -> Result<BMP280<I2C>, E>where I2C: WriteRead<Error = E>,

Create a new BMP280 driver with the default address

source§

impl<I2C: WriteRead> BMP280<I2C>

source

pub fn pressure(&mut self) -> f64

Reads and returns pressure

source

pub fn pressure_one_shot(&mut self) -> f64

Reads and returns pressure and resets con

source

pub fn temp(&mut self) -> f64

Reads and returns temperature

source

pub fn config(&mut self) -> Config

Returns current config

source

pub fn set_config(&mut self, new: Config)

Sets configuration

source

pub fn set_control(&mut self, new: Control)

Sets control

source

pub fn control(&mut self) -> Control

Returns control

source

pub fn status(&mut self) -> Status

Returns device status

source

pub fn id(&mut self) -> u8

Returns device id

source

pub fn reset(&mut self)

Software reset, emulates POR

Auto Trait Implementations§

§

impl<I2C> RefUnwindSafe for BMP280<I2C>where I2C: RefUnwindSafe,

§

impl<I2C> Send for BMP280<I2C>where I2C: Send,

§

impl<I2C> Sync for BMP280<I2C>where I2C: Sync,

§

impl<I2C> Unpin for BMP280<I2C>where I2C: Unpin,

§

impl<I2C> UnwindSafe for BMP280<I2C>where I2C: 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.