33#include "generated/modules.h"
35#if !defined IMU_MPU9250_GYRO_LOWPASS_FILTER && !defined IMU_MPU9250_ACCEL_LOWPASS_FILTER && !defined IMU_MPU9250_SMPLRT_DIV
36#if PERIODIC_FREQUENCY <= 120
41#define IMU_MPU9250_GYRO_LOWPASS_FILTER MPU9250_DLPF_GYRO_41HZ
42#define IMU_MPU9250_ACCEL_LOWPASS_FILTER MPU9250_DLPF_ACCEL_41HZ
43#define IMU_MPU9250_SMPLRT_DIV 9
46#elif PERIODIC_FREQUENCY < 500
51#define IMU_MPU9250_GYRO_LOWPASS_FILTER MPU9250_DLPF_GYRO_92HZ
52#define IMU_MPU9250_ACCEL_LOWPASS_FILTER MPU9250_DLPF_ACCEL_92HZ
53#define IMU_MPU9250_SMPLRT_DIV 1
61#define IMU_MPU9250_GYRO_LOWPASS_FILTER MPU9250_DLPF_GYRO_250HZ
62#define IMU_MPU9250_ACCEL_LOWPASS_FILTER MPU9250_DLPF_ACCEL_184HZ
63#define IMU_MPU9250_SMPLRT_DIV 3
75#ifndef IMU_MPU9250_I2C_ADDR
76#define IMU_MPU9250_I2C_ADDR MPU9250_ADDR_ALT
81#ifndef IMU_MPU9250_CHAN_X
82#define IMU_MPU9250_CHAN_X 0
85#ifndef IMU_MPU9250_CHAN_Y
86#define IMU_MPU9250_CHAN_Y 1
89#ifndef IMU_MPU9250_CHAN_Z
90#define IMU_MPU9250_CHAN_Z 2
94#ifndef IMU_MPU9250_X_SIGN
95#define IMU_MPU9250_X_SIGN 1
98#ifndef IMU_MPU9250_Y_SIGN
99#define IMU_MPU9250_Y_SIGN 1
102#ifndef IMU_MPU9250_Z_SIGN
103#define IMU_MPU9250_Z_SIGN 1
152 AbiSendMsgIMU_GYRO_RAW(
IMU_MPU9250_ID, now_ts, &rates, 1, IMU_MPU9250_PERIODIC_FREQ, NAN);
153 AbiSendMsgIMU_ACCEL_RAW(
IMU_MPU9250_ID, now_ts, &accel, 1, IMU_MPU9250_PERIODIC_FREQ, NAN);
155#if IMU_MPU9250_READ_MAG
Main include for ABI (AirBorneInterface).
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
void imu_set_defaults_gyro(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Rates *neutral, const struct FloatRates *scale_f)
Set the defaults for a gyro sensor WARNING: Should be called before sensor is publishing messages to ...
void imu_set_defaults_accel(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Vect3 *neutral, const struct FloatVect3 *scale_f)
Set the defaults for a accel sensor WARNING: Should be called before sensor is publishing messages to...
Inertial Measurement Unit interface.
void imu_mpu9250_init(void)
#define IMU_MPU9250_GYRO_LOWPASS_FILTER
#define IMU_MPU9250_X_SIGN
#define IMU_MPU9250_CHAN_X
void imu_mpu9250_periodic(void)
#define IMU_MPU9250_Y_SIGN
#define IMU_MPU9250_ACCEL_LOWPASS_FILTER
#define IMU_MPU9250_Z_SIGN
#define IMU_MPU9250_SMPLRT_DIV
#define IMU_MPU9250_I2C_ADDR
#define IMU_MPU9250_CHAN_Z
#define IMU_MPU9250_CHAN_Y
struct ImuMpu9250 imu_mpu9250
void imu_mpu9250_event(void)
IMU driver for the MPU9250 using I2C.
#define IMU_MPU9250_ACCEL_RANGE
#define IMU_MPU9250_GYRO_RANGE
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
const struct FloatRates MPU9250_GYRO_SENS_F[4]
const struct FloatVect3 MPU9250_ACCEL_SENS_F[4]
void mpu9250_i2c_event(struct Mpu9250_I2c *mpu)
void mpu9250_i2c_init(struct Mpu9250_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
static void mpu9250_i2c_periodic(struct Mpu9250_I2c *mpu)
convenience function: read or start configuration if not already initialized
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
Architecture independent timing functions.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.