Paparazzi UAS  v5.15_devel-109-gee85905
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mpu9250_i2c.h File Reference

Driver for the MPU-9250 using I2C. More...

#include "std.h"
#include "math/pprz_algebra_int.h"
#include "mcu_periph/i2c.h"
#include "peripherals/mpu9250.h"
#include "peripherals/ak8963.h"
+ Include dependency graph for mpu9250_i2c.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Mpu9250_I2c
 
union  Mpu9250_I2c.data_accel
 
union  Mpu9250_I2c.data_rates
 

Macros

#define IMU_MPU9250_READ_MAG   TRUE
 
#define MPU9250_BUFFER_EXT_LEN   16
 

Enumerations

enum  Mpu9250I2cSlaveInitStatus {
  MPU9250_I2C_CONF_UNINIT, MPU9250_I2C_CONF_I2C_MST_DIS, MPU9250_I2C_CONF_I2C_BYPASS_EN, MPU9250_I2C_CONF_SLAVES_CONFIGURE,
  MPU9250_I2C_CONF_I2C_BYPASS_DIS, MPU9250_I2C_CONF_I2C_MST_CLK, MPU9250_I2C_CONF_I2C_MST_DELAY, MPU9250_I2C_CONF_I2C_SMPLRT,
  MPU9250_I2C_CONF_I2C_MST_EN, MPU9250_I2C_CONF_DONE
}
 

Functions

void mpu9250_i2c_init (struct Mpu9250_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
 
void mpu9250_i2c_start_configure (struct Mpu9250_I2c *mpu)
 
void mpu9250_i2c_read (struct Mpu9250_I2c *mpu)
 
void mpu9250_i2c_event (struct Mpu9250_I2c *mpu)
 
static void mpu9250_i2c_periodic (struct Mpu9250_I2c *mpu)
 convenience function: read or start configuration if not already initialized More...
 

Detailed Description

Driver for the MPU-9250 using I2C.

Definition in file mpu9250_i2c.h.


Data Structure Documentation

struct Mpu9250_I2c

Definition at line 59 of file mpu9250_i2c.h.

+ Collaboration diagram for Mpu9250_I2c:
Data Fields
struct Ak8963 akm "internal" magnetometer
struct Mpu9250Config config
union Mpu9250_I2c data_accel
volatile bool data_available data ready flag
uint8_t data_ext[MPU9250_BUFFER_EXT_LEN]
union Mpu9250_I2c data_rates
struct i2c_periph * i2c_p
struct i2c_transaction i2c_trans
enum Mpu9250I2cSlaveInitStatus slave_init_status
union Mpu9250_I2c.data_accel

Definition at line 63 of file mpu9250_i2c.h.

Data Fields
int16_t value[3] accel data values accessible by channel index
struct Int16Vect3 vect accel data vector in accel coordinate system
union Mpu9250_I2c.data_rates

Definition at line 67 of file mpu9250_i2c.h.

Data Fields
struct Int16Rates rates rates data as angular rates in gyro coordinate system
int16_t value[3] rates data values accessible by channel index

Macro Definition Documentation

#define IMU_MPU9250_READ_MAG   TRUE

Definition at line 40 of file mpu9250_i2c.h.

#define MPU9250_BUFFER_EXT_LEN   16

Definition at line 44 of file mpu9250_i2c.h.

Enumeration Type Documentation

Enumerator
MPU9250_I2C_CONF_UNINIT 
MPU9250_I2C_CONF_I2C_MST_DIS 
MPU9250_I2C_CONF_I2C_BYPASS_EN 
MPU9250_I2C_CONF_SLAVES_CONFIGURE 
MPU9250_I2C_CONF_I2C_BYPASS_DIS 
MPU9250_I2C_CONF_I2C_MST_CLK 
MPU9250_I2C_CONF_I2C_MST_DELAY 
MPU9250_I2C_CONF_I2C_SMPLRT 
MPU9250_I2C_CONF_I2C_MST_EN 
MPU9250_I2C_CONF_DONE 

Definition at line 46 of file mpu9250_i2c.h.

Function Documentation

static void mpu9250_i2c_periodic ( struct Mpu9250_I2c mpu)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 86 of file mpu9250_i2c.h.

References Mpu9250_I2c::config, Mpu9250Config::initialized, mpu9250_i2c_read(), and mpu9250_i2c_start_configure().

Referenced by imu_mpu9250_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mpu9250_i2c_read ( struct Mpu9250_I2c mpu)
void mpu9250_i2c_start_configure ( struct Mpu9250_I2c mpu)

Definition at line 77 of file mpu9250_i2c.c.

References Mpu9250_I2c::config, Mpu9250_I2c::i2c_trans, I2CTransDone, I2CTransSuccess, Mpu9250Config::init_status, MPU9250_CONF_UNINIT, mpu9250_i2c_write_to_reg(), mpu9250_send_config(), and i2c_transaction::status.

Referenced by mpu9250_i2c_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: