pub struct DPS422<I2C> { /* private fields */ }Implementations§
Source§impl<I2C, E> DPS422<I2C>
impl<I2C, E> DPS422<I2C>
pub fn new(i2c: I2C, address: u8, config: &Config) -> Result<Self, E>
Sourcepub fn get_product_id(&mut self) -> Result<u8, E>
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
Sourcepub fn read_status(&mut self) -> Result<u8, E>
pub fn read_status(&mut self) -> Result<u8, E>
Read status bits from MEAS_CFG reg. MEAS_CFG register is maskedd with 0xF0
Sourcepub fn trigger_measurement(
&mut self,
temp: bool,
pres: bool,
continuous: bool,
) -> Result<(), E>
pub fn trigger_measurement( &mut self, temp: bool, pres: bool, continuous: bool, ) -> Result<(), E>
Start a single or continuous measurement for pressure or temperature
Sourcepub fn init_complete(&mut self) -> Result<bool, E>
pub fn init_complete(&mut self) -> Result<bool, E>
returns the init_complete bit from the status register
Sourcepub fn data_ready(&mut self) -> Result<bool, E>
pub fn data_ready(&mut self) -> Result<bool, E>
returns the data_ready bit from the status register
Sourcepub fn read_temp_calibrated(&mut self) -> Result<f32, E>
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
Sourcepub fn read_pressure_raw(&mut self) -> Result<i32, E>
pub fn read_pressure_raw(&mut self) -> Result<i32, E>
Read raw pressure contents
Sourcepub fn read_pressure_calibrated(&mut self) -> Result<f32, E>
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
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> 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