Struct DPS422

Source
pub struct DPS422<I2C> { /* private fields */ }

Implementations§

Source§

impl<I2C, E> DPS422<I2C>
where I2C: WriteRead<Error = E> + Write<Error = E>,

Source

pub fn new(i2c: I2C, address: u8, config: &Config) -> Result<Self, E>

Source

pub fn get_product_id(&mut self) -> Result<u8, E>

Returns the product ID from PROD_ID register. This value is expected to be 0x1A

Source

pub fn read_status(&mut self) -> Result<u8, E>

Read status bits from MEAS_CFG reg. MEAS_CFG register is maskedd with 0xF0

Source

pub fn trigger_measurement( &mut self, temp: bool, pres: bool, continuous: bool, ) -> Result<(), E>

Start a single or continuous measurement for pressure or temperature

Source

pub fn init_complete(&mut self) -> Result<bool, E>

returns the init_complete bit from the status register

Source

pub fn data_ready(&mut self) -> Result<bool, E>

returns the data_ready bit from the status register

Source

pub fn read_temp_calibrated(&mut self) -> Result<f32, E>

Read calibrated temperature data in degrees Celsius This method uses the pre calculated constants based on the calibration coefficients See section 6.2 in the datasheet

Source

pub fn read_pressure_raw(&mut self) -> Result<i32, E>

Read raw pressure contents

Source

pub fn read_pressure_calibrated(&mut self) -> Result<f32, E>

Read calibrated pressure data in kPa This method uses the calibration coefficients See section 5.1 in the datasheet

Source

pub fn reset(&mut self) -> Result<(), E>

Issue a full reset and fifo flush

Auto Trait Implementations§

§

impl<I2C> Freeze for DPS422<I2C>
where I2C: Freeze,

§

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

§

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

§

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

§

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

§

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