Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the MPU-60X0 using I2C. More...
#include "std.h"
#include "math/pprz_algebra_int.h"
#include "mcu_periph/i2c.h"
#include "peripherals/mpu60x0.h"
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 |
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... | |
Driver for the MPU-60X0 using I2C.
Definition in file mpu60x0_i2c.h.
struct Mpu60x0_I2c |
Definition at line 54 of file mpu60x0_i2c.h.
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 |
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 |
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 |
#define MPU60X0_BUFFER_EXT_LEN 16 |
Definition at line 39 of file mpu60x0_i2c.h.
Definition at line 41 of file mpu60x0_i2c.h.
void mpu60x0_i2c_event | ( | struct Mpu60x0_I2c * | mpu | ) |
Definition at line 82 of file mpu60x0_i2c.c.
References i2c_transaction::buf, Mpu60x0_I2c::config, Mpu60x0_I2c::data_accel, Mpu60x0_I2c::data_available, Mpu60x0_I2c::data_ext, Mpu60x0_I2c::data_rates, FALSE, Mpu60x0Config::i2c_bypass, Mpu60x0_I2c::i2c_trans, I2CTransDone, I2CTransFailed, I2CTransSuccess, Mpu60x0Config::init_status, Mpu60x0Config::initialized, Int16FromBuf, MPU60X0_CONF_UNINIT, mpu60x0_i2c_write_to_reg(), mpu60x0_send_config(), Mpu60x0Config::nb_bytes, Mpu60x0Config::nb_slaves, i2c_transaction::status, and Mpu60x0_I2c::temp.
Referenced by imu_apogee_event(), imu_bebop_event(), imu_disco_event(), imu_drotek2_event(), imu_krooz_event(), imu_mpu_i2c_event(), imu_navstik_event(), and imu_swing_event().
void mpu60x0_i2c_init | ( | struct Mpu60x0_I2c * | mpu, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr | ||
) |
Definition at line 31 of file mpu60x0_i2c.c.
References Mpu60x0_I2c::config, Mpu60x0_I2c::data_available, Mpu60x0_I2c::i2c_p, Mpu60x0_I2c::i2c_trans, I2CTransDone, Mpu60x0Config::init_status, Mpu60x0Config::initialized, MPU60X0_CONF_UNINIT, MPU60X0_I2C_CONF_UNINIT, mpu60x0_set_default_config(), i2c_transaction::slave_addr, Mpu60x0_I2c::slave_init_status, and i2c_transaction::status.
Referenced by imu_apogee_init(), imu_bebop_init(), imu_disco_init(), imu_drotek2_init(), imu_krooz_init(), imu_mpu_i2c_init(), imu_navstik_init(), and imu_swing_init().
|
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().
void mpu60x0_i2c_read | ( | struct Mpu60x0_I2c * | mpu | ) |
Definition at line 71 of file mpu60x0_i2c.c.
References i2c_transaction::buf, Mpu60x0_I2c::config, Mpu60x0_I2c::i2c_p, Mpu60x0_I2c::i2c_trans, i2c_transceive(), I2CTransDone, Mpu60x0Config::initialized, MPU60X0_REG_INT_STATUS, Mpu60x0Config::nb_bytes, i2c_transaction::slave_addr, and i2c_transaction::status.
Referenced by imu_krooz_event(), and mpu60x0_i2c_periodic().
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().