Nordic Thingy:52
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
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 to enable/disable the mpu9250 driver. More...
 
uint32_t drv_mpu9250_init (drv_mpu9250_init_t *p_params)
 Function for initializing the mpu9250 driver. More...
 
int drv_mpu9250_int_register (struct int_param_s *p_int_param)
 Function for enabling and registering the mpu9250 interrupt calback. 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 mpu9250 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 mpu9250 register. More...
 

Detailed Description

MPU-9250 motion sensor.

Function Documentation

uint32_t drv_mpu9250_enable ( bool  enable)

Function to enable/disable the mpu9250 driver.

Parameters
[in]enableEnables the device.
Return values
NRF_SUCCESS.
uint32_t drv_mpu9250_init ( drv_mpu9250_init_t p_params)

Function for initializing the mpu9250 driver.

Parameters
[in]p_paramsPointer to the init paramter structure.
Return values
NRF_SUCCESS.
int drv_mpu9250_int_register ( struct int_param_s *  p_int_param)

Function for enabling and registering the mpu9250 interrupt calback.

Parameters
[in]int_paramPointer to the interrup parameter structure.
Return values
0if success. Else -1.
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.
int drv_mpu9250_read ( unsigned char  slave_addr,
unsigned char  reg_addr,
unsigned char  length,
unsigned char *  p_data 
)

Function for reading a mpu9250 register.

Parameters
[in]slave_addrSlave address on the TWI bus.
[in]reg_addrRegister address to read.
[in]lengthLength of the data to read.
[out]dataPointer to where the data should be read.
Return values
0if success. Else -1.
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 mpu9250 register.

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