33 #include "generated/modules.h"
36 #if !defined IMU_MPU60X0_LOWPASS_FILTER && !defined IMU_MPU60X0_SMPLRT_DIV
37 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
41 #define IMU_MPU60X0_LOWPASS_FILTER MPU60X0_DLPF_42HZ
42 #define IMU_MPU60X0_SMPLRT_DIV 9
43 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
44 #elif PERIODIC_FREQUENCY == 512
48 #define IMU_MPU60X0_LOWPASS_FILTER MPU60X0_DLPF_256HZ
49 #define IMU_MPU60X0_SMPLRT_DIV 3
52 #error Non-default PERIODIC_FREQUENCY: please define IMU_MPU60X0_LOWPASS_FILTER and IMU_MPU60X0_SMPLRT_DIV.
61 #ifndef IMU_MPU60X0_I2C_ADDR
62 #define IMU_MPU60X0_I2C_ADDR MPU60X0_ADDR
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_accel(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Vect3 *neutral, const struct Int32Vect3 *scale)
Set the defaults for a accel sensor WARNING: Should be called before sensor is publishing messages to...
void imu_set_defaults_gyro(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Rates *neutral, const struct Int32Rates *scale)
Set the defaults for a gyro sensor WARNING: Should be called before sensor is publishing messages to ...
Inertial Measurement Unit interface.
void imu_mpu_i2c_init(void)
void imu_mpu_i2c_periodic(void)
#define IMU_MPU60X0_I2C_ADDR
void imu_mpu_i2c_event(void)
struct ImuMpu60x0 imu_mpu_i2c
Driver for IMU with only MPU60x0 via I2C.
#define IMU_MPU60X0_ACCEL_RANGE
#define IMU_MPU60X0_GYRO_RANGE
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
arch independent LED (Light Emitting Diodes) API
const struct Int32Rates MPU60X0_GYRO_SENS_FRAC[4][2]
const struct Int32Vect3 MPU60X0_ACCEL_SENS_FRAC[4][2]
uint8_t smplrt_div
Sample rate divider.
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
enum Mpu60x0AccelRanges accel_range
g Range
enum Mpu60x0GyroRanges gyro_range
deg/s Range
void mpu60x0_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
union Mpu60x0_I2c::@341 data_accel
volatile bool data_available
data ready flag
static void mpu60x0_i2c_periodic(struct Mpu60x0_I2c *mpu)
convenience function: read or start configuration if not already initialized
union Mpu60x0_I2c::@342 data_rates
float temp
temperature in degrees Celcius
struct Mpu60x0Config config
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.