33 #if !defined IMU_MPU9250_GYRO_LOWPASS_FILTER && !defined IMU_MPU9250_ACCEL_LOWPASS_FILTER && !defined IMU_MPU9250_SMPLRT_DIV
34 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
39 #define IMU_MPU9250_GYRO_LOWPASS_FILTER MPU9250_DLPF_GYRO_41HZ
40 #define IMU_MPU9250_ACCEL_LOWPASS_FILTER MPU9250_DLPF_ACCEL_41HZ
41 #define IMU_MPU9250_SMPLRT_DIV 9
42 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
43 #elif PERIODIC_FREQUENCY == 512
48 #define IMU_MPU9250_GYRO_LOWPASS_FILTER MPU9250_DLPF_GYRO_250HZ
49 #define IMU_MPU9250_ACCEL_LOWPASS_FILTER MPU9250_DLPF_ACCEL_184HZ
50 #define IMU_MPU9250_SMPLRT_DIV 3
54 #define IMU_MPU9250_SMPLRT_DIV 9
55 #define IMU_MPU9250_GYRO_LOWPASS_FILTER MPU9250_DLPF_GYRO_41HZ
56 #define IMU_MPU9250_ACCEL_LOWPASS_FILTER MPU9250_DLPF_ACCEL_41HZ
57 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
67 #ifndef IMU_MPU9250_I2C_ADDR
68 #define IMU_MPU9250_I2C_ADDR MPU9250_ADDR_ALT
73 #ifndef IMU_MPU9250_CHAN_X
74 #define IMU_MPU9250_CHAN_X 0
77 #ifndef IMU_MPU9250_CHAN_Y
78 #define IMU_MPU9250_CHAN_Y 1
81 #ifndef IMU_MPU9250_CHAN_Z
82 #define IMU_MPU9250_CHAN_Z 2
86 #ifndef IMU_MPU9250_X_SIGN
87 #define IMU_MPU9250_X_SIGN 1
90 #ifndef IMU_MPU9250_Y_SIGN
91 #define IMU_MPU9250_Y_SIGN 1
94 #ifndef IMU_MPU9250_Z_SIGN
95 #define IMU_MPU9250_Z_SIGN 1
enum Mpu9250DLPFGyro dlpf_gyro_cfg
Digital Low Pass Filter for gyroscope.
union Mpu9250_I2c::@318 data_rates
void imu_mpu9250_periodic(void)
struct ImuMpu9250 imu_mpu9250
struct Mpu9250Config config
volatile bool data_available
data ready flag
enum Mpu9250GyroRanges gyro_range
deg/s Range
#define IMU_MPU9250_Y_SIGN
#define VECT3_COPY(_a, _b)
void imu_mpu9250_event(void)
#define IMU_MPU9250_I2C_ADDR
Main include for ABI (AirBorneInterface).
#define IMU_MPU9250_X_SIGN
void mpu9250_i2c_init(struct Mpu9250_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
union Mpu9250_I2c::@317 data_accel
struct Imu imu
global IMU state
void mpu9250_i2c_event(struct Mpu9250_I2c *mpu)
enum Mpu9250DLPFAccel dlpf_accel_cfg
Digital Low Pass Filter for accelerometer.
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
#define IMU_MPU9250_ACCEL_LOWPASS_FILTER
struct Ak8963 akm
"internal" magnetometer
Architecture independent timing functions.
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
struct Int32Vect3 mag
magnetometer measurements scaled to 1 in BFP with INT32_MAG_FRAC
#define IMU_MPU9250_CHAN_Y
Inertial Measurement Unit interface.
void imu_scale_gyro(struct Imu *_imu)
#define IMU_MPU9250_ACCEL_RANGE
#define IMU_MPU9250_Z_SIGN
enum Mpu9250AccelRanges accel_range
g Range
void imu_scale_mag(struct Imu *_imu)
static void mpu9250_i2c_periodic(struct Mpu9250_I2c *mpu)
convenience function: read or start configuration if not already initialized
#define IMU_MPU9250_GYRO_RANGE
void imu_mpu9250_init(void)
struct Int32Vect3 accel_unscaled
unscaled accelerometer measurements
void imu_scale_accel(struct Imu *_imu)
#define RATES_COPY(_a, _b)
uint8_t smplrt_div
Sample rate divider.
volatile bool data_available
data ready flag
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define IMU_MPU9250_SMPLRT_DIV
#define IMU_MPU9250_GYRO_LOWPASS_FILTER
#define IMU_MPU9250_CHAN_X
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
#define IMU_MPU9250_CHAN_Z
Architecture independent I2C (Inter-Integrated Circuit Bus) API.