Nordic Thingy:52
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
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 to start sampling. More...
 
uint32_t drv_pressure_sleep (void)
 Function to put sensor in sleep. More...
 

Detailed Description

Pressure sensor API.

Enumeration Type Documentation

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

uint32_t drv_pressure_disable ( void  )

Function for disabling the pressure sensor.

Return values
NRF_SUCCESSIf initialization was successful.
uint32_t drv_pressure_enable ( void  )

Function for enabling the pressure sensor.

Return values
NRF_SUCCESSIf initialization was successful.
float drv_pressure_get ( void  )

Function for getting the pressure data [hPa].

Return values
Pressuredata.
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.
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.
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.
uint32_t drv_pressure_sample ( void  )

Function to start sampling.

Return values
NRF_SUCCESSIf start sampling was successful.
uint32_t drv_pressure_sleep ( void  )

Function to put sensor in sleep.

Return values
NRF_SUCCESSIf sleep was successful.