34 #if !defined IMU_MPU60X0_LOWPASS_FILTER && !defined IMU_MPU60X0_SMPLRT_DIV
35 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
39 #define IMU_MPU60X0_LOWPASS_FILTER MPU60X0_DLPF_42HZ
40 #define IMU_MPU60X0_SMPLRT_DIV 9
41 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
42 #elif PERIODIC_FREQUENCY == 512
46 #define IMU_MPU60X0_LOWPASS_FILTER MPU60X0_DLPF_256HZ
47 #define IMU_MPU60X0_SMPLRT_DIV 3
50 #error Non-default PERIODIC_FREQUENCY: please define MPU60X0_HMC_LOWPASS_FILTER and MPU60X0_HMC_SMPLRT_DIV.
53 PRINT_CONFIG_VAR(IMU_MPU60X0_LOWPASS_FILTER)
54 PRINT_CONFIG_VAR(IMU_MPU60X0_SMPLRT_DIV)
56 #ifndef IMU_MPU60X0_GYRO_RANGE
57 #define IMU_MPU60X0_GYRO_RANGE MPU60X0_GYRO_RANGE_2000
61 #ifndef IMU_MPU60X0_ACCEL_RANGE
62 #define IMU_MPU60X0_ACCEL_RANGE MPU60X0_ACCEL_RANGE_16G
66 #ifndef IMU_MPU60X0_I2C_ADDR
67 #define IMU_MPU60X0_I2C_ADDR MPU60X0_ADDR
struct ImuMpu60x0 imu_mpu_i2c
void imu_mpu_i2c_event(void)
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
void imu_scale_gyro(struct Imu *_imu)
void mpu60x0_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
void imu_scale_accel(struct Imu *_imu)
struct Mpu60x0Config config
union Mpu60x0_I2c::@41 data_accel
#define VECT3_COPY(_a, _b)
Main include for ABI (AirBorneInterface).
uint8_t smplrt_div
Sample rate divider.
enum Mpu60x0GyroRanges gyro_range
deg/s Range
enum Mpu60x0AccelRanges accel_range
g Range
union Mpu60x0_I2c::@42 data_rates
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void imu_impl_init(void)
must be defined by underlying hardware
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
struct Imu imu
global IMU state
#define IMU_MPU60X0_ACCEL_RANGE
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
Inertial Measurement Unit interface.
#define IMU_MPU60X0_GYRO_RANGE
void imu_periodic(void)
optional.
#define IMU_MPU60X0_I2C_ADDR
arch independent LED (Light Emitting Diodes) API
struct Int32Vect3 accel_unscaled
unscaled accelerometer measurements
static void mpu60x0_i2c_periodic(struct Mpu60x0_I2c *mpu)
convenience function: read or start configuration if not already initialized
#define RATES_COPY(_a, _b)
volatile bool_t data_available
data ready flag
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
Architecture independent I2C (Inter-Integrated Circuit Bus) API.