34 #ifndef SWING_MPU_I2C_DEV
35 #define SWING_MPU_I2C_DEV i2c0
39 #if !defined SWING_LOWPASS_FILTER && !defined SWING_SMPLRT_DIV
40 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
44 #define SWING_LOWPASS_FILTER MPU60X0_DLPF_42HZ
45 #define SWING_SMPLRT_DIV 9
46 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
47 #elif PERIODIC_FREQUENCY == 512
51 #define SWING_LOWPASS_FILTER MPU60X0_DLPF_256HZ
52 #define SWING_SMPLRT_DIV 3
56 PRINT_CONFIG_VAR(SWING_SMPLRT_DIV)
57 PRINT_CONFIG_VAR(SWING_LOWPASS_FILTER)
#define SWING_ACCEL_RANGE
void imu_swing_periodic(void)
Handle all the periodic tasks of the Navstik IMU components.
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
#define SWING_MPU_I2C_DEV
void mpu60x0_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
struct Mpu60x0Config config
#define VECT3_ASSIGN(_a, _x, _y, _z)
#define RATES_ASSIGN(_ra, _p, _q, _r)
Main include for ABI (AirBorneInterface).
uint8_t smplrt_div
Sample rate divider.
struct Imu imu
global IMU state
enum Mpu60x0GyroRanges gyro_range
deg/s Range
enum Mpu60x0AccelRanges accel_range
g Range
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
Everything that is in the swing IMU.
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
struct ImuSwing imu_swing
Basic Navstik IMU data.
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
void imu_swing_event(void)
Handle all the events of the Navstik IMU components.
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
union Mpu60x0_I2c::@330 data_rates
Inertial Measurement Unit interface.
void imu_scale_gyro(struct Imu *_imu)
struct Mpu60x0_I2c mpu
The MPU gyro/accel device.
union Mpu60x0_I2c::@329 data_accel
void imu_swing_init(void)
Navstik IMU initializtion of the MPU-60x0 and HMC58xx.
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
void imu_scale_accel(struct Imu *_imu)
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
volatile bool data_available
data ready flag
Architecture independent I2C (Inter-Integrated Circuit Bus) API.