Struct lps22hb::LPS22HB [−][src]
pub struct LPS22HB<T> { /* fields omitted */ }
Expand description
Holds the driver instance with the selected interface
Implementations
Read the device ID (“who am I”)
Calculated pressure reading in hPa
Calculated temperaure reading in degrees Celsius
Calculated reference pressure reading in hPa
Read pressure offset value, 16-bit data that can be used to implement One-Point Calibration (OPC) after soldering.
Set the pressure offset value (VALUE IN hPA!)
Get all the flags from the STATUS_REG register
Triggers the one-shot mode, and a new acquisition starts when it is required. Enabling this mode is possible only if the device was previously in power-down mode. Once the acquisition is completed and the output registers updated, the device automatically enters in power-down mode. ONE_SHOT bit self-clears itself.
Enable or disable block data update
AUTOZERO: when set to ‘1’, the measured pressure is used as the reference in REF_P (0x15, 0x16, 0x17). From that point on the output pressure registers are updated and the same value is also used for interrupt generation. The register content of REF_P is subtracted from the measured pressure. PRESS_OUT = measured pressure - REF_P P_DIFF_IN = measured pressure - REF_P
Resets the Autozero function. Self-cleared.
Disables I2C interface (default 0, I2C enabled)
Sets SPI Mode (default 4-wire)
Register address automatically incremented during a multiple byte access with a serial interface (I2C or SPI). Default value: enabled
Reboot. Refreshes the content of the internal registers stored in the Flash memory block. At device power-up the content of the Flash memory block is transferred to the internal registers related to the trimming functions to allow correct behavior of the device itself. If for any reason the content of the trimming registers is modified, it is sufficient to use this bit to restore the correct values. At the end of the boot process the BOOT bit is set again to ‘0’ by hardware. The BOOT bit takes effect after one ODR clock cycle.
Is reboot phase running?
Run software reset (resets the device to the power-on configuration, takes 4 usec)
Enable low-power mode (must be done only with the device in power-down mode)
Enable and configure low-pass filter on pressure data in Continuous mode
Reset low-pass filter. If the LPFP is active, in order to avoid the transitory phase, the filter can be reset by reading this register before generating pressure measurements.
Enable and configure FIFO
Get flags and FIFO level from the FIFO_STATUS register
pub fn enable_interrupts(
&mut self,
flag: bool,
config: InterruptConfig
) -> Result<(), T::Error>
pub fn enable_interrupts(
&mut self,
flag: bool,
config: InterruptConfig
) -> Result<(), T::Error>
Enable interrupts and configure the interrupt pin
Get all the flags from the INT_SOURCE register (NOTE: INT_SOURCE register is cleared by reading it)