Nordic Thingy:52 v2.2.0
Accelerometer

Low power accelerometer driver API. More...

Modules

 LIS3DH accelerometer
 Definitions of LIS3DH constants.
 

Data Structures

struct  drv_acc_cfg_t
 LIS3DH accelerometer configuration struct. More...
 

Enumerations

enum  { DRV_ACC_STATUS_CODE_SUCCESS, DRV_ACC_STATUS_CODE_INVALID_PARAM, DRV_ACC_STATUS_WRONG_DEVICE, DRV_ACC_STATUS_UNINITALIZED }
 Return status codes. More...
 

Functions

ret_code_t drv_acc_init (drv_acc_cfg_t const *const p_cfg)
 Function for initializing the accelerometer driver. More...
 
ret_code_t drv_acc_wakeup_prepare (bool p_wakeup)
 Function for preparing for sleep and subsequent wakeup. More...
 

Detailed Description

Low power accelerometer driver API.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Return status codes.

Enumerator
DRV_ACC_STATUS_CODE_SUCCESS 

Successful.

DRV_ACC_STATUS_CODE_INVALID_PARAM 

Invalid parameters.

DRV_ACC_STATUS_WRONG_DEVICE 

Wrong device at I2C (TWI) address.

DRV_ACC_STATUS_UNINITALIZED 

The driver is unitialized, please initialize.

Function Documentation

◆ drv_acc_init()

ret_code_t drv_acc_init ( drv_acc_cfg_t const *const  p_cfg)

Function for initializing the accelerometer driver.

Parameters
[in]p_cfgInitialization struct.
Return values
DRV_ACC_STATUS_CODE_SUCCESS
DRV_ACC_STATUS_WRONG_DEVICE
NRF_ERROR_NULL
Returns
Other codes from the underlying drivers.

◆ drv_acc_wakeup_prepare()

ret_code_t drv_acc_wakeup_prepare ( bool  p_wakeup)

Function for preparing for sleep and subsequent wakeup.

Parameters
[in]p_wakeupIf false, go to deepest sleep and do not prepare to wake up the system.
Note
When the nRF prepares for sleep, the LIS3DH will wake up.
Return values
DRV_ACC_STATUS_CODE_SUCCESS
DRV_ACC_STATUS_CODE_INVALID_PARAM
DRV_ACC_STATUS_UNINITALIZED
Returns
Other codes from the underlying drivers.