| Nordic Thingy:52 v2.0.0

Modules | Data Structures | Typedefs | Enumerations | Functions
Motion sensor
Drivers

Motion sensor API. More...

## Modules

| MPU-9250 motion sensor
| MPU-9250 motion sensor.

## Data Structures

struct | drv_motion_cfg_t
| Motion configuration struct. More...
struct | drv_motion_twi_init_t
| Motion initialization struct. More...

## Typedefs

typedef void(* | drv_motion_evt_handler_t) (drv_motion_evt_t const *p_evt, void *p_data, uint32_t size)
| Motion driver event handler callback type.

## Enumerations

enum | drv_motion_evt_t
| Motion event types.
enum | drv_motion_feature_t
| Motion features.

## Functions

uint32_t | drv_motion_config (drv_motion_cfg_t *p_cfg)
| Function for configuring the motion driver. More...
uint32_t | drv_motion_disable (drv_motion_feature_mask_t feature_mask)
| Function for disabling features in the motion driver. More...
uint32_t | drv_motion_enable (drv_motion_feature_mask_t feature_mask)
| Function for enabling features in the motion driver. More...
uint32_t | drv_motion_init (drv_motion_evt_handler_t evt_handler, drv_motion_twi_init_t *p_params_mpu, drv_motion_twi_init_t *p_params_lis)
| Function for initializing the motion driver. More...
uint32_t | drv_motion_sleep_prepare (bool wakeup)
| Function for preparing for sleep mode. More...

## Detailed Description

Motion sensor API.

## Function Documentation

## ◆ drv_motion_config()

uint32_t drv_motion_config | ( | drv_motion_cfg_t * | p_cfg | ) |

Function for configuring the motion driver.

Parameters

  [in] | p_cfg | Configuration structure.

Return values

  NRF_SUCCESS. |

## ◆ drv_motion_disable()

uint32_t drv_motion_disable | ( | drv_motion_feature_mask_t | feature_mask | ) |

Function for disabling features in the motion driver.

Parameters

  [in] | feature_mask | Feature mask indicating what features to disable.

Return values

  NRF_SUCCESS. |

## ◆ drv_motion_enable()

uint32_t drv_motion_enable | ( | drv_motion_feature_mask_t | feature_mask | ) |

Function for enabling features in the motion driver.

Parameters

  [in] | feature_mask | Feature mask indicating what features to enable.

Return values

  NRF_SUCCESS. |

## ◆ drv_motion_init()

uint32_t drv_motion_init | ( | drv_motion_evt_handler_t | evt_handler,
|  | drv_motion_twi_init_t * | p_params_mpu,
|  | drv_motion_twi_init_t * | p_params_lis
| ) |  |

Function for initializing the motion driver.

Parameters

  [in] | evt_handler | The motion event handler.
  [in] | p_params_mpu | Pointer to the init parameter structure for the MPU9250.
  [in] | p_params_lis | Pointer to the init parameter structure for the LIS2DH12.

Return values

  NRF_SUCCESS. |

## ◆ drv_motion_sleep_prepare()

uint32_t drv_motion_sleep_prepare | ( | bool | wakeup | ) |

Function for preparing for sleep mode.

Parameters

  [in] | wakeup | Boolean indicating either wakeup or sleep forever.

Return values

  NRF_SUCCESS. |