32 PRINT_CONFIG_VAR(IMU_MPU_SPI_SLAVE_IDX)
33 PRINT_CONFIG_VAR(IMU_MPU_SPI_DEV)
37 #if !defined IMU_MPU_LOWPASS_FILTER && !defined IMU_MPU_SMPLRT_DIV
38 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
42 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_42HZ
43 #define IMU_MPU_SMPLRT_DIV 9
44 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
45 #elif PERIODIC_FREQUENCY == 512
49 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_256HZ
50 #define IMU_MPU_SMPLRT_DIV 3
53 #error Non-default PERIODIC_FREQUENCY: please define MPU_HMC_LOWPASS_FILTER and MPU_HMC_SMPLRT_DIV.
56 PRINT_CONFIG_VAR(IMU_MPU_LOWPASS_FILTER)
57 PRINT_CONFIG_VAR(IMU_MPU_SMPLRT_DIV)
59 #ifndef IMU_MPU_GYRO_RANGE
60 #define IMU_MPU_GYRO_RANGE MPU60X0_GYRO_RANGE_2000
64 #ifndef IMU_MPU_ACCEL_RANGE
65 #define IMU_MPU_ACCEL_RANGE MPU60X0_ACCEL_RANGE_16G
void imu_impl_init(void)
must be defined by underlying hardware
void mpu60x0_spi_init(struct Mpu60x0_Spi *mpu, struct spi_periph *spi_p, uint8_t slave_idx)
#define IMU_MPU_GYRO_RANGE
void imu_scale_gyro(struct Imu *_imu)
void imu_scale_accel(struct Imu *_imu)
volatile bool_t data_available
data ready flag
struct Mpu60x0Config config
void imu_mpu_spi_event(void)
void mpu60x0_spi_event(struct Mpu60x0_Spi *mpu)
#define VECT3_COPY(_a, _b)
Main include for ABI (AirBorneInterface).
uint8_t smplrt_div
Sample rate divider.
void imu_periodic(void)
optional.
enum Mpu60x0GyroRanges gyro_range
deg/s Range
union Mpu60x0_Spi::@43 data_accel
enum Mpu60x0AccelRanges accel_range
g Range
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Architecture independent SPI (Serial Peripheral Interface) API.
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
static void mpu60x0_spi_periodic(struct Mpu60x0_Spi *mpu)
convenience function: read or start configuration if not already initialized
struct Imu imu
global IMU state
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
Inertial Measurement Unit interface.
#define IMU_MPU_ACCEL_RANGE
union Mpu60x0_Spi::@44 data_rates
struct Int32Vect3 accel_unscaled
unscaled accelerometer measurements
#define RATES_COPY(_a, _b)
struct ImuMpu6000 imu_mpu_spi
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC