Nordic Thingy:52
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
LPS22HB pressure sensor

LPS22HB pressure sensor API. More...

Data Structures

struct  drv_lps22hb_cfg_t
 Configuration struct for lps22hb pressure sensor. More...
 
struct  drv_lps22hb_twi_cfg_t
 Initialization struct for lps22hb pressure sensor driver. More...
 

Macros

#define CTRL_REG1   0x10
 Control register 1.
 
#define CTRL_REG1_BDU_Pos   1
 Bitmasks for BDU.
 
#define CTRL_REG1_EN_LPFP_Pos   3
 Bitmasks for EN_LPFP.
 
#define CTRL_REG1_LPFP_CFG_Pos   2
 Bitmasks for LPFP_CFG.
 
#define CTRL_REG1_ODR_Pos   4
 Bitmasks for ODR.
 
#define CTRL_REG1_SIM_Pos   0
 Bitmasks for SIM.
 
#define CTRL_REG2   0x11
 Control register 2.
 
#define CTRL_REG2_BOOT_Pos   7
 Bitmasks for BOOT.
 
#define CTRL_REG2_FIFO_EN_Pos   6
 Bitmasks for FIFO_EN.
 
#define CTRL_REG2_I2C_DIS_Pos   3
 Bitmasks for I2C_DIS.
 
#define CTRL_REG2_IF_ADD_INC_Pos   4
 Bitmasks for IF_ADD_INC.
 
#define CTRL_REG2_ONE_SHOT_Pos   0
 Bitmasks for ONE_SHOT.
 
#define CTRL_REG2_STOP_ON_FTH_Pos   5
 Bitmasks for STOP_ON_FTH.
 
#define CTRL_REG2_SWRESET_Pos   2
 Bitmasks for SWRESET.
 
#define CTRL_REG3   0x12
 Control register 3 - INT_DRDY pin control register.
 
#define CTRL_REG3_DRDY_Pos   2
 Bitmasks for DRDY.
 
#define CTRL_REG3_F_FSS5_Pos   5
 Bitmasks for F_FSS5.
 
#define CTRL_REG3_F_FTH_Pos   4
 Bitmasks for F_FTH.
 
#define CTRL_REG3_F_OVR_Pos   3
 Bitmasks for F_OVR.
 
#define CTRL_REG3_INT_H_L_Pos   7
 Bitmasks for INT_H_L.
 
#define CTRL_REG3_INT_S_Pos   0
 Bitmasks for INT_S.
 
#define CTRL_REG3_PP_OD_Pos   6
 Bitmasks for PP_OD.
 
#define FIFO_CTRL_REG   0x14
 FIFO control register.
 
#define FIFO_CTRL_REG_F_MODE_Pos   5
 Bitmasks for F_MODE.
 
#define FIFO_STATUS_REG   0x26
 FIFO status.
 
#define INT_SOURCE_REG   0x25
 Interrupt source.
 
#define INTERRUPT_CFG_REG   0x0B
 Interrupt mode for pressure acquisition configuration register.
 
#define INTERRUPT_CFG_REG_AUTORIFP_Pos   7
 Bitmasks for AUTORIFP.
 
#define INTERRUPT_CFG_REG_AUTOZERO_Pos   5
 Bitmasks for AUTOZERO.
 
#define INTERRUPT_CFG_REG_DIFF_EN_Pos   3
 Bitmasks for DIFF_EN.
 
#define INTERRUPT_CFG_REG_LIR_Pos   2
 Bitmasks for LIR.
 
#define INTERRUPT_CFG_REG_PHE_Pos   0
 Bitmasks for PHE.
 
#define INTERRUPT_CFG_REG_PLE_Pos   1
 Bitmasks for PLE.
 
#define INTERRUPT_CFG_REG_RESET_ARP_Pos   6
 Bitmasks for RESET_ARP.
 
#define INTERRUPT_CFG_REG_RESET_AZ_Pos   4
 Bitmasks for RESET_AZ.
 
#define LPFP_RES_REG   0x33
 Low-pass filter reset register.
 
#define PRESS_OUT_H_REG   0x2A
 Pressure output value (MSB).
 
#define PRESS_OUT_L_REG   0x29
 Pressure output value (mid part).
 
#define PRESS_OUT_XL_REG   0x28
 Pressure output value (LSB).
 
#define REF_P_H_REG   0x17
 Reference pressure (MSB part).
 
#define REF_P_L_REG   0x16
 Reference pressure (middle part).
 
#define REF_P_XL_REG   0x15
 Reference pressure (LSB data).
 
#define RES_CONF_REG   0x1A
 Low-power mode configuration.
 
#define RES_CONF_REG_LC_EN_Pos   0
 Bitmasks for DRDY.
 
#define RPDS_H_REG   0x19
 Pressure offset (MSB data).
 
#define RPDS_L_REG   0x18
 Pressure offset (LSB data).
 
#define STATUS_REG   0x27
 Status register.
 
#define STATUS_REG_P_DA_Pos   0
 Bitmasks for P_DA.
 
#define STATUS_REG_P_OR_Pos   4
 Bitmasks for P_OR.
 
#define STATUS_REG_T_DA_Pos   1
 Bitmasks for T_DA.
 
#define STATUS_REG_T_OR_Pos   5
 Bitmasks for T_OR.
 
#define TEMP_OUT_H_REG   0x2C
 Temperature output value (MSB).
 
#define TEMP_OUT_L_REG   0x2B
 Temperature output value (LSB).
 
#define THS_P_H_REG   0x0D
 User defined threshold value for pressure interrupt event (Most significant bits).
 
#define THS_P_L_REG   0x0C
 User defined threshold value for pressure interrupt event (Least significant bits).
 
#define WHO_AM_I_REG   0x0F
 Device Who am I register.
 

Enumerations

enum  drv_lps22hb_odr_t
 Available data rates.
 

Functions

uint32_t drv_lps22hb_cfg_get (drv_lps22hb_cfg_t *p_cfg)
 Reads the configuration of the lps22hb sensor. More...
 
uint32_t drv_lps22hb_cfg_set (drv_lps22hb_cfg_t const *const p_cfg)
 Configures the lps22hb sensor according to the specified configuration. More...
 
uint32_t drv_lps22hb_close (void)
 Close the lps22hb driver. More...
 
uint32_t drv_lps22hb_fifo_status_get (uint8_t *p_status)
 Function to get the FIFO status. More...
 
uint32_t drv_lps22hb_init (void)
 Inits the lps22hb driver.
 
uint32_t drv_lps22hb_int_source_get (uint8_t *p_source)
 Function to get the interrupt source register. More...
 
uint32_t drv_lps22hb_low_pass_reset (void)
 Function to reset low-pass filter of the lps22hb. More...
 
uint32_t drv_lps22hb_odr_set (drv_lps22hb_odr_t odr)
 Function to output data rate of the lps22hb. More...
 
uint32_t drv_lps22hb_one_shot (void)
 Start One-Shot conversion of the lps22hb sensor data. More...
 
uint32_t drv_lps22hb_open (drv_lps22hb_twi_cfg_t const *const p_twi_cfg)
 Opens the lps22hb driver according to the specified configuration. More...
 
uint32_t drv_lps22hb_pressure_get (uint32_t *p_pressure)
 Function to get the pressure data. To calculate p(hPa) = *p_pressure(LSB) / 4096(LSB/hPa). More...
 
uint32_t drv_lps22hb_pressure_offset_get (uint16_t *p_offset)
 Function to get pressure offset. More...
 
uint32_t drv_lps22hb_pressure_offset_set (uint16_t offset)
 Function to set pressure offset. More...
 
uint32_t drv_lps22hb_reboot (void)
 Reboot the lps22hb memory content. More...
 
uint32_t drv_lps22hb_ref_pressure_get (uint32_t *p_ref_press)
 Function to get reference pressure. More...
 
uint32_t drv_lps22hb_ref_pressure_set (uint32_t ref_press)
 Function to set reference pressure. More...
 
uint32_t drv_lps22hb_status_get (uint8_t *p_status)
 Function to get the status. More...
 
uint32_t drv_lps22hb_sw_reset (void)
 Perform Software Reset of the lps22hb. More...
 
uint32_t drv_lps22hb_temperature_get (uint16_t *p_temperature)
 Function to get the temperature data. More...
 
uint32_t drv_lps22hb_verify (uint8_t *who_am_i)
 Read and check the WHO_AM_I register of the lps22hb sensor. More...
 

Detailed Description

LPS22HB pressure sensor API.

Function Documentation

uint32_t drv_lps22hb_cfg_get ( drv_lps22hb_cfg_t p_cfg)

Reads the configuration of the lps22hb sensor.

Parameters
[in]p_cfgPointer to the driver configuration for the session to be opened.
Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_cfg_set ( drv_lps22hb_cfg_t const *const  p_cfg)

Configures the lps22hb sensor according to the specified configuration.

Parameters
[in]p_cfgPointer to the sensor configuration.
Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_close ( void  )

Close the lps22hb driver.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_fifo_status_get ( uint8_t *  p_status)

Function to get the FIFO status.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_int_source_get ( uint8_t *  p_source)

Function to get the interrupt source register.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_low_pass_reset ( void  )

Function to reset low-pass filter of the lps22hb.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_odr_set ( drv_lps22hb_odr_t  odr)

Function to output data rate of the lps22hb.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_one_shot ( void  )

Start One-Shot conversion of the lps22hb sensor data.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_open ( drv_lps22hb_twi_cfg_t const *const  p_twi_cfg)

Opens the lps22hb driver according to the specified configuration.

Parameters
[in]p_twi_cfgPointer to the driver configuration for the session to be opened.
Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_pressure_get ( uint32_t *  p_pressure)

Function to get the pressure data. To calculate p(hPa) = *p_pressure(LSB) / 4096(LSB/hPa).

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_pressure_offset_get ( uint16_t *  p_offset)

Function to get pressure offset.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_pressure_offset_set ( uint16_t  offset)

Function to set pressure offset.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_reboot ( void  )

Reboot the lps22hb memory content.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_ref_pressure_get ( uint32_t *  p_ref_press)

Function to get reference pressure.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_ref_pressure_set ( uint32_t  ref_press)

Function to set reference pressure.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_status_get ( uint8_t *  p_status)

Function to get the status.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_sw_reset ( void  )

Perform Software Reset of the lps22hb.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_temperature_get ( uint16_t *  p_temperature)

Function to get the temperature data.

Returns
NRF_SUCCESS If the call was successful.
uint32_t drv_lps22hb_verify ( uint8_t *  who_am_i)

Read and check the WHO_AM_I register of the lps22hb sensor.

Parameters
[in]who_am_iPointer to store the data.
Returns
NRF_SUCCESS If the call was successful.