Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the MPU-9250 using I2C. More...
#include "peripherals/mpu9250_i2c.h"
Go to the source code of this file.
Macros | |
#define | Int16FromBuf(_buf, _idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1])) |
Functions | |
bool | imu_mpu9250_configure_mag_slave (Mpu9250ConfigSet mpu_set, void *mpu) |
callback function to configure ak8963 mag More... | |
void | mpu9250_i2c_init (struct Mpu9250_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr) |
static void | mpu9250_i2c_write_to_reg (void *mpu, uint8_t _reg, uint8_t _val) |
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) |
bool | mpu9250_configure_i2c_slaves (Mpu9250ConfigSet mpu_set, void *mpu) |
configure the registered I2C slaves More... | |
Driver for the MPU-9250 using I2C.
Definition in file mpu9250_i2c.c.
#define Int16FromBuf | ( | _buf, | |
_idx | |||
) | ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1])) |
Definition at line 104 of file mpu9250_i2c.c.
bool imu_mpu9250_configure_mag_slave | ( | Mpu9250ConfigSet | mpu_set, |
void * | mpu | ||
) |
callback function to configure ak8963 mag
Definition at line 162 of file mpu9250_i2c.c.
References ak8963_configure(), Mpu9250_I2c::akm, and Ak8963::initialized.
Referenced by mpu9250_i2c_init().
bool mpu9250_configure_i2c_slaves | ( | Mpu9250ConfigSet | mpu_set, |
void * | mpu | ||
) |
configure the registered I2C slaves
Configure I2C slaves of the MPU.
Definition at line 175 of file mpu9250_i2c.c.
void mpu9250_i2c_event | ( | struct Mpu9250_I2c * | mpu | ) |
Definition at line 106 of file mpu9250_i2c.c.
References ak8963_event(), Mpu9250_I2c::akm, i2c_transaction::buf, Mpu9250_I2c::config, Mpu9250_I2c::data_accel, Mpu9250_I2c::data_available, Mpu9250_I2c::data_ext, Mpu9250_I2c::data_rates, FALSE, Mpu9250Config::i2c_bypass, Mpu9250_I2c::i2c_trans, I2CTransDone, I2CTransFailed, I2CTransSuccess, Mpu9250Config::init_status, Mpu9250Config::initialized, Int16FromBuf, MPU9250_CONF_UNINIT, mpu9250_i2c_write_to_reg(), mpu9250_send_config(), Mpu9250Config::nb_bytes, Mpu9250Config::nb_slaves, and i2c_transaction::status.
Referenced by imu_mpu9250_event().
void mpu9250_i2c_init | ( | struct Mpu9250_I2c * | mpu, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr | ||
) |
Definition at line 33 of file mpu9250_i2c.c.
References ak8963_init(), Mpu9250_I2c::akm, Mpu9250_I2c::config, Mpu9250I2cSlave::configure, Mpu9250_I2c::data_available, Mpu9250Config::i2c_bypass, Mpu9250_I2c::i2c_p, Mpu9250_I2c::i2c_trans, I2CTransDone, imu_mpu9250_configure_mag_slave(), Mpu9250Config::init_status, Mpu9250Config::initialized, MPU9250_CONF_UNINIT, MPU9250_I2C_CONF_UNINIT, MPU9250_MAG_ADDR, mpu9250_set_default_config(), Mpu9250Config::nb_slaves, i2c_transaction::slave_addr, Mpu9250_I2c::slave_init_status, Mpu9250Config::slaves, and i2c_transaction::status.
Referenced by imu_mpu9250_init().
void mpu9250_i2c_read | ( | struct Mpu9250_I2c * | mpu | ) |
Definition at line 87 of file mpu9250_i2c.c.
References ak8963_read(), Mpu9250_I2c::akm, i2c_transaction::buf, Mpu9250_I2c::config, Mpu9250_I2c::i2c_p, Mpu9250_I2c::i2c_trans, i2c_transceive(), I2CTransDone, Mpu9250Config::initialized, MPU9250_REG_INT_STATUS, Mpu9250Config::nb_bytes, i2c_transaction::slave_addr, and i2c_transaction::status.
Referenced by mpu9250_i2c_periodic().
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().
Definition at line 68 of file mpu9250_i2c.c.
References i2c_transaction::buf, Mpu9250_I2c::i2c_p, Mpu9250_I2c::i2c_trans, i2c_transmit(), and i2c_transaction::slave_addr.
Referenced by mpu9250_i2c_event(), and mpu9250_i2c_start_configure().