Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the MPU-60X0 using I2C. More...
#include "peripherals/mpu60x0_i2c.h"
Go to the source code of this file.
Macros | |
#define | Int16FromBuf(_buf, _idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1])) |
Functions | |
void | mpu60x0_i2c_init (struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr) |
static void | mpu60x0_i2c_write_to_reg (void *mpu, uint8_t _reg, uint8_t _val) |
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) |
bool | mpu60x0_configure_i2c_slaves (Mpu60x0ConfigSet mpu_set, void *mpu) |
configure the registered I2C slaves More... | |
Driver for the MPU-60X0 using I2C.
Definition in file mpu60x0_i2c.c.
#define Int16FromBuf | ( | _buf, | |
_idx | |||
) | ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1])) |
Definition at line 80 of file mpu60x0_i2c.c.
Referenced by mpu60x0_i2c_event().
bool mpu60x0_configure_i2c_slaves | ( | Mpu60x0ConfigSet | mpu_set, |
void * | mpu | ||
) |
configure the registered I2C slaves
Configure I2C slaves of the MPU.
Definition at line 135 of file mpu60x0_i2c.c.
References Mpu60x0_I2c::config, Mpu60x0I2cSlave::configure, Mpu60x0Config::i2c_bypass, Mpu60x0Config::i2c_mst_clk, Mpu60x0Config::i2c_mst_delay, MPU60X0_I2C_CONF_DONE, MPU60X0_I2C_CONF_I2C_BYPASS_DIS, MPU60X0_I2C_CONF_I2C_BYPASS_EN, MPU60X0_I2C_CONF_I2C_MST_CLK, MPU60X0_I2C_CONF_I2C_MST_DELAY, MPU60X0_I2C_CONF_I2C_MST_DIS, MPU60X0_I2C_CONF_I2C_MST_EN, MPU60X0_I2C_CONF_I2C_SMPLRT, MPU60X0_I2C_CONF_SLAVES_CONFIGURE, MPU60X0_I2C_CONF_UNINIT, MPU60X0_I2C_MST_EN, MPU60X0_I2C_NB_SLAVES, MPU60X0_REG_I2C_MST_CTRL, MPU60X0_REG_I2C_MST_DELAY, MPU60X0_REG_I2C_SLV4_CTRL, MPU60X0_REG_INT_PIN_CFG, MPU60X0_REG_USER_CTRL, Mpu60x0Config::nb_slave_init, Mpu60x0Config::nb_slaves, Mpu60x0_I2c::slave_init_status, and Mpu60x0Config::slaves.
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().
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().
Definition at line 52 of file mpu60x0_i2c.c.
References i2c_transaction::buf, Mpu60x0_I2c::i2c_p, Mpu60x0_I2c::i2c_trans, i2c_transmit(), and i2c_transaction::slave_addr.
Referenced by mpu60x0_i2c_event(), and mpu60x0_i2c_start_configure().