Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
mpu60x0_i2c.h File Reference
#include "std.h"
#include "math/pprz_algebra_int.h"
#include "mcu_periph/i2c.h"
#include "peripherals/mpu60x0.h"
+ Include dependency graph for mpu60x0_i2c.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Mpu60x0_I2c
 
union  Mpu60x0_I2c.data_accel
 
union  Mpu60x0_I2c.data_rates
 

Macros

#define MPU60X0_BUFFER_EXT_LEN   16
 

Enumerations

enum  Mpu60x0I2cSlaveInitStatus {
  MPU60X0_I2C_CONF_UNINIT, MPU60X0_I2C_CONF_I2C_MST_DIS, MPU60X0_I2C_CONF_I2C_BYPASS_EN, MPU60X0_I2C_CONF_SLAVES_CONFIGURE,
  MPU60X0_I2C_CONF_I2C_BYPASS_DIS, MPU60X0_I2C_CONF_I2C_MST_CLK, MPU60X0_I2C_CONF_I2C_MST_DELAY, MPU60X0_I2C_CONF_I2C_SMPLRT,
  MPU60X0_I2C_CONF_I2C_MST_EN, MPU60X0_I2C_CONF_DONE
}
 

Functions

void mpu60x0_i2c_init (struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
 
void mpu60x0_i2c_start_configure (struct Mpu60x0_I2c *mpu)
 
void mpu60x0_i2c_read (struct Mpu60x0_I2c *mpu)
 
void mpu60x0_i2c_event (struct Mpu60x0_I2c *mpu)
 
static void mpu60x0_i2c_periodic (struct Mpu60x0_I2c *mpu)
 convenience function: read or start configuration if not already initialized More...
 

Detailed Description

Driver for the MPU-60X0 using I2C.

Definition in file mpu60x0_i2c.h.


Data Structure Documentation

◆ Mpu60x0_I2c

struct Mpu60x0_I2c

Definition at line 54 of file mpu60x0_i2c.h.

+ Collaboration diagram for Mpu60x0_I2c:
Data Fields
struct Mpu60x0Config config
union Mpu60x0_I2c data_accel
volatile bool data_available data ready flag
uint8_t data_ext[MPU60X0_BUFFER_EXT_LEN]
union Mpu60x0_I2c data_rates
struct i2c_periph * i2c_p
struct i2c_transaction i2c_trans
enum Mpu60x0I2cSlaveInitStatus slave_init_status
float temp temperature in degrees Celcius

◆ Mpu60x0_I2c.data_accel

union Mpu60x0_I2c.data_accel

Definition at line 58 of file mpu60x0_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

◆ Mpu60x0_I2c.data_rates

union Mpu60x0_I2c.data_rates

Definition at line 62 of file mpu60x0_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

◆ MPU60X0_BUFFER_EXT_LEN

#define MPU60X0_BUFFER_EXT_LEN   16

Definition at line 39 of file mpu60x0_i2c.h.

Enumeration Type Documentation

◆ Mpu60x0I2cSlaveInitStatus

Enumerator
MPU60X0_I2C_CONF_UNINIT 
MPU60X0_I2C_CONF_I2C_MST_DIS 
MPU60X0_I2C_CONF_I2C_BYPASS_EN 
MPU60X0_I2C_CONF_SLAVES_CONFIGURE 
MPU60X0_I2C_CONF_I2C_BYPASS_DIS 
MPU60X0_I2C_CONF_I2C_MST_CLK 
MPU60X0_I2C_CONF_I2C_MST_DELAY 
MPU60X0_I2C_CONF_I2C_SMPLRT 
MPU60X0_I2C_CONF_I2C_MST_EN 
MPU60X0_I2C_CONF_DONE 

Definition at line 41 of file mpu60x0_i2c.h.

Function Documentation

◆ mpu60x0_i2c_event()

◆ mpu60x0_i2c_init()

◆ mpu60x0_i2c_periodic()

static void mpu60x0_i2c_periodic ( struct Mpu60x0_I2c mpu)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 79 of file mpu60x0_i2c.h.

References Mpu60x0_I2c::config, Mpu60x0Config::initialized, mpu60x0_i2c_read(), and mpu60x0_i2c_start_configure().

Referenced by imu_apogee_periodic(), imu_bebop_periodic(), imu_disco_periodic(), imu_drotek2_periodic(), imu_mpu_i2c_periodic(), imu_navstik_periodic(), and imu_swing_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mpu60x0_i2c_read()

void mpu60x0_i2c_read ( struct Mpu60x0_I2c mpu)

◆ mpu60x0_i2c_start_configure()

void mpu60x0_i2c_start_configure ( struct Mpu60x0_I2c mpu)

Definition at line 61 of file mpu60x0_i2c.c.

References Mpu60x0_I2c::config, Mpu60x0_I2c::i2c_trans, I2CTransDone, I2CTransSuccess, Mpu60x0Config::init_status, MPU60X0_CONF_UNINIT, mpu60x0_i2c_write_to_reg(), mpu60x0_send_config(), and i2c_transaction::status.

Referenced by imu_krooz_periodic(), and mpu60x0_i2c_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: