Nordic Thingy:52 v2.2.0
Pressure sensor

Pressure sensor API. More...

Modules

 LPS22HB pressure sensor
 LPS22HB pressure sensor API.
 

Data Structures

struct  drv_pressure_evt_t
 Pressure event struct. More...
 
struct  drv_pressure_init_t
 Initialization struct for pressure driver. More...
 

Typedefs

typedef void(* drv_pressure_evt_handler_t) (drv_pressure_evt_t const *p_evt)
 Pressure driver event handler callback type.
 

Enumerations

enum  drv_pressure_evt_type_t { DRV_PRESSURE_EVT_DATA, DRV_PRESSURE_EVT_ERROR }
 Pressure driver event types. More...
 
enum  drv_pressure_mode_t
 Pressure modes of operation.
 

Functions

uint32_t drv_pressure_disable (void)
 Function for disabling the pressure sensor. More...
 
uint32_t drv_pressure_enable (void)
 Function for enabling the pressure sensor. More...
 
float drv_pressure_get (void)
 Function for getting the pressure data [hPa]. More...
 
uint32_t drv_pressure_init (drv_pressure_init_t *p_params)
 Function for initializing the pressure driver. More...
 
uint32_t drv_pressure_mode_set (drv_pressure_mode_t mode)
 Function for changing the mode of the pressure sensor. More...
 
uint32_t drv_pressure_reset (void)
 Function for resetting the chip to all default register values. More...
 
uint32_t drv_pressure_sample (void)
 Function for starting the sampling. More...
 
uint32_t drv_pressure_sleep (void)
 Function for putting the sensor to sleep. More...
 

Detailed Description

Pressure sensor API.

Enumeration Type Documentation

◆ drv_pressure_evt_type_t

Pressure driver event types.

Enumerator
DRV_PRESSURE_EVT_DATA 

Converted value ready to be read.

DRV_PRESSURE_EVT_ERROR 

HW error on the communication bus.

Function Documentation

◆ drv_pressure_disable()

uint32_t drv_pressure_disable ( void  )

Function for disabling the pressure sensor.

Return values
NRF_SUCCESSIf initialization was successful.

◆ drv_pressure_enable()

uint32_t drv_pressure_enable ( void  )

Function for enabling the pressure sensor.

Return values
NRF_SUCCESSIf initialization was successful.

◆ drv_pressure_get()

float drv_pressure_get ( void  )

Function for getting the pressure data [hPa].

Return values
Pressuredata.

◆ drv_pressure_init()

uint32_t drv_pressure_init ( drv_pressure_init_t p_params)

Function for initializing the pressure driver.

Parameters
[in]p_paramsPointer to init parameters.
Return values
NRF_SUCCESSIf initialization was successful.
NRF_ERROR_INVALID_STATEIf the driver is in invalid state.

◆ drv_pressure_mode_set()

uint32_t drv_pressure_mode_set ( drv_pressure_mode_t  mode)

Function for changing the mode of the pressure sensor.

Parameters
[in]modeAltimeter or Barometer.
Return values
NRF_SUCCESSIf configuration was successful.
NRF_ERROR_BUSYIf the TWI drivers are busy.

◆ drv_pressure_reset()

uint32_t drv_pressure_reset ( void  )

Function for resetting the chip to all default register values.

Return values
NRF_SUCCESSIf operation was successful.
NRF_ERROR_BUSYIf TWI bus was busy.

◆ drv_pressure_sample()

uint32_t drv_pressure_sample ( void  )

Function for starting the sampling.

Return values
NRF_SUCCESSIf start sampling was successful.

◆ drv_pressure_sleep()

uint32_t drv_pressure_sleep ( void  )

Function for putting the sensor to sleep.

Return values
NRF_SUCCESSIf sleep was successful.