Nordic Thingy:52 v2.2.0
MPU-9250 motion sensor

MPU-9250 motion sensor. More...

Data Structures

struct  drv_mpu9250_init_t
 TWI communication initialization struct. More...
 

Functions

uint32_t drv_mpu9250_enable (bool enable)
 Function for enabling or disabling the MPU-9250 driver. More...
 
uint32_t drv_mpu9250_init (drv_mpu9250_init_t *p_params)
 Function for initializing the MPU-9250 driver. More...
 
int drv_mpu9250_int_register (struct int_param_s *p_int_param)
 Function for enabling and registering the MPU-9250 interrupt callback. More...
 
int drv_mpu9250_ms_get (unsigned long *p_count)
 Function for getting a timestamp in milliseconds. More...
 
int drv_mpu9250_read (unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char *p_data)
 Function for reading a MPU-9250 register. More...
 
int drv_mpu9250_write (unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char const *p_data)
 Function for writing to a MPU-9250 register. More...
 

Detailed Description

MPU-9250 motion sensor.

Function Documentation

◆ drv_mpu9250_enable()

uint32_t drv_mpu9250_enable ( bool  enable)

Function for enabling or disabling the MPU-9250 driver.

Parameters
[in]enableEnables the device.
Return values
NRF_SUCCESS.

◆ drv_mpu9250_init()

uint32_t drv_mpu9250_init ( drv_mpu9250_init_t p_params)

Function for initializing the MPU-9250 driver.

Parameters
[in]p_paramsPointer to the init paramter structure.
Return values
NRF_SUCCESS.

◆ drv_mpu9250_int_register()

int drv_mpu9250_int_register ( struct int_param_s *  p_int_param)

Function for enabling and registering the MPU-9250 interrupt callback.

Parameters
[in]p_int_paramPointer to the interrupt parameter structure.
Return values
0if success. Else -1.

◆ drv_mpu9250_ms_get()

int drv_mpu9250_ms_get ( unsigned long *  p_count)

Function for getting a timestamp in milliseconds.

Parameters
[out]p_countPointer to the timestamp.
Return values
0if success. Else -1.

◆ drv_mpu9250_read()

int drv_mpu9250_read ( unsigned char  slave_addr,
unsigned char  reg_addr,
unsigned char  length,
unsigned char *  p_data 
)

Function for reading a MPU-9250 register.

Parameters
[in]slave_addrSlave address on the TWI bus.
[in]reg_addrRegister address to read.
[in]lengthLength of the data to read.
[out]p_dataPointer to where the data should be stored.
Return values
0if success. Else -1.

◆ drv_mpu9250_write()

int drv_mpu9250_write ( unsigned char  slave_addr,
unsigned char  reg_addr,
unsigned char  length,
unsigned char const *  p_data 
)

Function for writing to a MPU-9250 register.

Parameters
[in]slave_addrSlave address on the TWI bus.
[in]reg_addrRegister address to write.
[in]lengthLength of the data to write.
[in]p_dataPointer to the data to write.
Return values
0if success. Else -1.