Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mpu9250.h File Reference

MPU-60X0 driver common interface (I2C and SPI). More...

#include "std.h"
#include "peripherals/mpu9250_regs.h"
+ Include dependency graph for mpu9250.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Mpu9250I2cSlave
 
struct  Mpu9250Config
 

Macros

#define MPU9250_DEFAULT_SMPLRT_DIV   0
 Default sample rate divider. More...
 
#define MPU9250_DEFAULT_FS_SEL   MPU9250_GYRO_RANGE_1000
 Default gyro full scale range +- 2000°/s. More...
 
#define MPU9250_DEFAULT_AFS_SEL   MPU9250_ACCEL_RANGE_8G
 Default accel full scale range +- 16g. More...
 
#define MPU9250_DEFAULT_DLPF_ACCEL_CFG   MPU9250_DLPF_ACCEL_41HZ
 Default internal sampling (1kHz, 42Hz LP Bandwidth) More...
 
#define MPU9250_DEFAULT_DLPF_GYRO_CFG   MPU9250_DLPF_GYRO_41HZ
 Default internal sampling (1kHz, 42Hz LP Bandwidth) More...
 
#define MPU9250_DEFAULT_INT_CFG   1
 Default interrupt config: DATA_RDY_EN. More...
 
#define MPU9250_DEFAULT_CLK_SEL   1
 Default clock: PLL with X gyro reference. More...
 

Typedefs

typedef void(* Mpu9250ConfigSet )(void *mpu, uint8_t _reg, uint8_t _val)
 Configuration function prototype. More...
 
typedef bool_t(* Mpu9250I2cSlaveConfigure )(Mpu9250ConfigSet mpu_set, void *mpu)
 function prototype for configuration of a single I2C slave More...
 

Enumerations

enum  Mpu9250ConfStatus {
  MPU9250_CONF_UNINIT, MPU9250_CONF_RESET, MPU9250_CONF_USER_RESET, MPU9250_CONF_PWR,
  MPU9250_CONF_SD, MPU9250_CONF_DLPF_ACCEL, MPU9250_CONF_DLPF_GYRO, MPU9250_CONF_GYRO,
  MPU9250_CONF_ACCEL, MPU9250_CONF_I2C_SLAVES, MPU9250_CONF_INT_ENABLE, MPU9250_CONF_DONE
}
 

Functions

void mpu9250_set_default_config (struct Mpu9250Config *c)
 
void mpu9250_send_config (Mpu9250ConfigSet mpu_set, void *mpu, struct Mpu9250Config *config)
 Configuration sequence called once before normal use. More...
 
bool_t mpu9250_configure_i2c_slaves (Mpu9250ConfigSet mpu_set, void *mpu)
 Configure I2C slaves of the MPU. More...
 

Detailed Description

MPU-60X0 driver common interface (I2C and SPI).

Definition in file mpu9250.h.


Data Structure Documentation

struct Mpu9250I2cSlave

Definition at line 71 of file mpu9250.h.

Data Fields
Mpu9250I2cSlaveConfigure configure
struct Mpu9250Config

Definition at line 75 of file mpu9250.h.

+ Collaboration diagram for Mpu9250Config:
Data Fields
enum Mpu9250AccelRanges accel_range g Range
uint8_t clk_sel Clock select.
enum Mpu9250DLPFAccel dlpf_accel_cfg Digital Low Pass Filter for accelerometer.
enum Mpu9250DLPFGyro dlpf_gyro_cfg Digital Low Pass Filter for gyroscope.
bool_t drdy_int_enable Enable Data Ready Interrupt.
enum Mpu9250GyroRanges gyro_range deg/s Range
bool_t i2c_bypass Bypass MPU I2C.

Only effective if using the I2C implementation.

enum Mpu9250MstClk i2c_mst_clk MPU I2C master clock speed.
uint8_t i2c_mst_delay MPU I2C slaves delayed sample rate.
enum Mpu9250ConfStatus init_status init status
bool_t initialized config done flag
uint8_t nb_bytes number of bytes to read starting with MPU9250_REG_INT_STATUS
uint8_t nb_slaves number of used I2C slaves
struct Mpu9250I2cSlave slaves[5] I2C slaves.
uint8_t smplrt_div Sample rate divider.

Macro Definition Documentation

#define MPU9250_DEFAULT_AFS_SEL   MPU9250_ACCEL_RANGE_8G

Default accel full scale range +- 16g.

Definition at line 40 of file mpu9250.h.

Referenced by mpu9250_set_default_config().

#define MPU9250_DEFAULT_CLK_SEL   1

Default clock: PLL with X gyro reference.

Definition at line 48 of file mpu9250.h.

Referenced by mpu9250_set_default_config().

#define MPU9250_DEFAULT_DLPF_ACCEL_CFG   MPU9250_DLPF_ACCEL_41HZ

Default internal sampling (1kHz, 42Hz LP Bandwidth)

Definition at line 42 of file mpu9250.h.

Referenced by mpu9250_set_default_config().

#define MPU9250_DEFAULT_DLPF_GYRO_CFG   MPU9250_DLPF_GYRO_41HZ

Default internal sampling (1kHz, 42Hz LP Bandwidth)

Definition at line 44 of file mpu9250.h.

Referenced by mpu9250_set_default_config().

#define MPU9250_DEFAULT_FS_SEL   MPU9250_GYRO_RANGE_1000

Default gyro full scale range +- 2000°/s.

Definition at line 38 of file mpu9250.h.

Referenced by mpu9250_set_default_config().

#define MPU9250_DEFAULT_INT_CFG   1

Default interrupt config: DATA_RDY_EN.

Definition at line 46 of file mpu9250.h.

#define MPU9250_DEFAULT_SMPLRT_DIV   0

Default sample rate divider.

Definition at line 36 of file mpu9250.h.

Referenced by mpu9250_set_default_config().

Typedef Documentation

typedef void(* Mpu9250ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)

Configuration function prototype.

Definition at line 66 of file mpu9250.h.

typedef bool_t(* Mpu9250I2cSlaveConfigure)(Mpu9250ConfigSet mpu_set, void *mpu)

function prototype for configuration of a single I2C slave

Definition at line 69 of file mpu9250.h.

Enumeration Type Documentation

Enumerator
MPU9250_CONF_UNINIT 
MPU9250_CONF_RESET 
MPU9250_CONF_USER_RESET 
MPU9250_CONF_PWR 
MPU9250_CONF_SD 
MPU9250_CONF_DLPF_ACCEL 
MPU9250_CONF_DLPF_GYRO 
MPU9250_CONF_GYRO 
MPU9250_CONF_ACCEL 
MPU9250_CONF_I2C_SLAVES 
MPU9250_CONF_INT_ENABLE 
MPU9250_CONF_DONE 

Definition at line 50 of file mpu9250.h.

Function Documentation