Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
|
IMU driver for the MPU9250 using SPI. More...
#include "std.h"
#include "generated/airframe.h"
#include "subsystems/imu.h"
#include "peripherals/mpu9250_spi.h"
Go to the source code of this file.
Data Structures | |
struct | ImuMpu9250 |
Functions | |
void | imu_mpu9250_init (void) |
void | imu_mpu9250_periodic (void) |
void | imu_mpu9250_event (void) |
Variables | |
struct ImuMpu9250 | imu_mpu9250 |
IMU driver for the MPU9250 using SPI.
Definition in file imu_mpu9250_spi.h.
struct ImuMpu9250 |
Definition at line 73 of file imu_mpu9250_i2c.h.
Data Fields | ||
---|---|---|
struct Mpu9250_I2c | mpu | |
struct Mpu9250_Spi | mpu | |
volatile bool | slave4_ready | |
volatile uint8_t | wait_slave4_rx_buf[2] | |
struct spi_transaction | wait_slave4_trans | |
volatile uint8_t | wait_slave4_tx_buf[1] |
#define IMU_ACCEL_X_SENS MPU9250_ACCEL_SENS[IMU_MPU9250_ACCEL_RANGE] |
Definition at line 61 of file imu_mpu9250_spi.h.
#define IMU_ACCEL_X_SENS_DEN MPU9250_ACCEL_SENS_FRAC[IMU_MPU9250_ACCEL_RANGE][1] |
Definition at line 63 of file imu_mpu9250_spi.h.
#define IMU_ACCEL_X_SENS_NUM MPU9250_ACCEL_SENS_FRAC[IMU_MPU9250_ACCEL_RANGE][0] |
Definition at line 62 of file imu_mpu9250_spi.h.
#define IMU_ACCEL_Y_SENS MPU9250_ACCEL_SENS[IMU_MPU9250_ACCEL_RANGE] |
Definition at line 64 of file imu_mpu9250_spi.h.
#define IMU_ACCEL_Y_SENS_DEN MPU9250_ACCEL_SENS_FRAC[IMU_MPU9250_ACCEL_RANGE][1] |
Definition at line 66 of file imu_mpu9250_spi.h.
#define IMU_ACCEL_Y_SENS_NUM MPU9250_ACCEL_SENS_FRAC[IMU_MPU9250_ACCEL_RANGE][0] |
Definition at line 65 of file imu_mpu9250_spi.h.
#define IMU_ACCEL_Z_SENS MPU9250_ACCEL_SENS[IMU_MPU9250_ACCEL_RANGE] |
Definition at line 67 of file imu_mpu9250_spi.h.
#define IMU_ACCEL_Z_SENS_DEN MPU9250_ACCEL_SENS_FRAC[IMU_MPU9250_ACCEL_RANGE][1] |
Definition at line 69 of file imu_mpu9250_spi.h.
#define IMU_ACCEL_Z_SENS_NUM MPU9250_ACCEL_SENS_FRAC[IMU_MPU9250_ACCEL_RANGE][0] |
Definition at line 68 of file imu_mpu9250_spi.h.
#define IMU_GYRO_P_SENS MPU9250_GYRO_SENS[IMU_MPU9250_GYRO_RANGE] |
Definition at line 48 of file imu_mpu9250_spi.h.
#define IMU_GYRO_P_SENS_DEN MPU9250_GYRO_SENS_FRAC[IMU_MPU9250_GYRO_RANGE][1] |
Definition at line 50 of file imu_mpu9250_spi.h.
#define IMU_GYRO_P_SENS_NUM MPU9250_GYRO_SENS_FRAC[IMU_MPU9250_GYRO_RANGE][0] |
Definition at line 49 of file imu_mpu9250_spi.h.
#define IMU_GYRO_Q_SENS MPU9250_GYRO_SENS[IMU_MPU9250_GYRO_RANGE] |
Definition at line 51 of file imu_mpu9250_spi.h.
#define IMU_GYRO_Q_SENS_DEN MPU9250_GYRO_SENS_FRAC[IMU_MPU9250_GYRO_RANGE][1] |
Definition at line 53 of file imu_mpu9250_spi.h.
#define IMU_GYRO_Q_SENS_NUM MPU9250_GYRO_SENS_FRAC[IMU_MPU9250_GYRO_RANGE][0] |
Definition at line 52 of file imu_mpu9250_spi.h.
#define IMU_GYRO_R_SENS MPU9250_GYRO_SENS[IMU_MPU9250_GYRO_RANGE] |
Definition at line 54 of file imu_mpu9250_spi.h.
#define IMU_GYRO_R_SENS_DEN MPU9250_GYRO_SENS_FRAC[IMU_MPU9250_GYRO_RANGE][1] |
Definition at line 56 of file imu_mpu9250_spi.h.
#define IMU_GYRO_R_SENS_NUM MPU9250_GYRO_SENS_FRAC[IMU_MPU9250_GYRO_RANGE][0] |
Definition at line 55 of file imu_mpu9250_spi.h.
#define IMU_MPU9250_ACCEL_RANGE MPU9250_ACCEL_RANGE_8G |
Definition at line 43 of file imu_mpu9250_spi.h.
#define IMU_MPU9250_GYRO_RANGE MPU9250_GYRO_RANGE_1000 |
Definition at line 39 of file imu_mpu9250_spi.h.
void imu_mpu9250_event | ( | void | ) |
Definition at line 47 of file imu_mpu9250.c.
References Imu::accel, Imu::accel_unscaled, Mpu9250_I2c::akm, Ak8963::data, Mpu9250_I2c::data_accel, Ak8963::data_available, Mpu9250_I2c::data_available, Mpu9250_I2c::data_ext, Mpu9250_I2c::data_rates, get_sys_time_usec(), Imu::gyro, Imu::gyro_unscaled, imu, imu_mpu9250, IMU_MPU9250_CHAN_X, IMU_MPU9250_CHAN_Y, IMU_MPU9250_CHAN_Z, IMU_MPU9250_ID, IMU_MPU9250_X_SIGN, IMU_MPU9250_Y_SIGN, IMU_MPU9250_Z_SIGN, imu_scale_accel(), imu_scale_gyro(), imu_scale_mag(), Int16FromBuf, Imu::mag, Imu::mag_unscaled, ImuMpu9250::mpu, mpu9250, mpu9250_i2c_event(), mpu9250_spi_event(), RATES_COPY, VECT3_COPY, Int32Vect3::x, Int32Vect3::y, and Int32Vect3::z.
void imu_mpu9250_init | ( | void | ) |
Definition at line 37 of file imu_mpu9250.c.
References Mpu9250Config::accel_range, spi_transaction::after_cb, spi_transaction::before_cb, spi_transaction::bitorder, spi_transaction::cdiv, Mpu9250_I2c::config, Mpu9250I2cSlave::configure, spi_transaction::cpha, spi_transaction::cpol, Mpu9250Config::dlpf_accel_cfg, Mpu9250Config::dlpf_gyro_cfg, spi_transaction::dss, Mpu9250Config::gyro_range, Mpu9250Config::i2c_mst_clk, Mpu9250Config::i2c_mst_delay, imu_mpu9250, IMU_MPU9250_ACCEL_LOWPASS_FILTER, IMU_MPU9250_ACCEL_RANGE, IMU_MPU9250_ADDR, imu_mpu9250_configure_mag_slave(), IMU_MPU9250_GYRO_LOWPASS_FILTER, IMU_MPU9250_GYRO_RANGE, IMU_MPU9250_I2C_ADDR, IMU_MPU9250_SMPLRT_DIV, spi_transaction::input_buf, spi_transaction::input_length, ImuMpu9250::mpu, mpu9250, mpu9250_i2c_init(), MPU9250_MST_CLK_400KHZ, mpu9250_spi_init(), mpu_wait_slave4_ready_cb(), Mpu9250Config::nb_bytes, Mpu9250Config::nb_slaves, spi_transaction::output_buf, spi_transaction::output_length, spi_transaction::select, ImuMpu9250::slave4_ready, spi_transaction::slave_idx, Mpu9250Config::slaves, Mpu9250Config::smplrt_div, SPICphaEdge2, SPICpolIdleHigh, SPIDiv64, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, spi_transaction::status, ImuMpu9250::wait_slave4_rx_buf, ImuMpu9250::wait_slave4_trans, and ImuMpu9250::wait_slave4_tx_buf.
void imu_mpu9250_periodic | ( | void | ) |
Definition at line 42 of file imu_mpu9250.c.
References imu_mpu9250, ImuMpu9250::mpu, mpu9250, mpu9250_i2c_periodic(), and mpu9250_spi_periodic().
struct ImuMpu9250 imu_mpu9250 |
Definition at line 100 of file imu_mpu9250_i2c.c.
Referenced by imu_mpu9250_event(), imu_mpu9250_init(), imu_mpu9250_periodic(), mpu_set_and_wait(), mpu_wait_slave4_ready(), and mpu_wait_slave4_ready_cb().