33 PRINT_CONFIG_VAR(IMU_MPU_SPI_SLAVE_IDX)
34 PRINT_CONFIG_VAR(IMU_MPU_SPI_DEV)
38 #if !defined IMU_MPU_LOWPASS_FILTER && !defined IMU_MPU_SMPLRT_DIV
39 #if (PERIODIC_FREQUENCY >= 60) && (PERIODIC_FREQUENCY <= 120)
43 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_42HZ
44 #define IMU_MPU_SMPLRT_DIV 9
45 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
46 #ifndef IMU_MPU_ACCEL_LOWPASS_FILTER
47 #define IMU_MPU_ACCEL_LOWPASS_FILTER MPU60X0_DLPF_ACC_44HZ // for ICM sensors
49 #elif (PERIODIC_FREQUENCY == 512) || (PERIODIC_FREQUENCY == 500)
53 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_256HZ
54 #define IMU_MPU_SMPLRT_DIV 3
56 #ifndef IMU_MPU_ACCEL_LOWPASS_FILTER
57 #define IMU_MPU_ACCEL_LOWPASS_FILTER MPU60X0_DLPF_ACC_218HZ // for ICM sensors
61 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_42HZ
62 #define IMU_MPU_SMPLRT_DIV 9
63 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
64 #ifndef IMU_MPU_ACCEL_LOWPASS_FILTER
65 #define IMU_MPU_ACCEL_LOWPASS_FILTER MPU60X0_DLPF_ACC_44HZ // for ICM sensors
67 INFO(
"Non-default PERIODIC_FREQUENCY: using default IMU_MPU_LOWPASS_FILTER and IMU_MPU_SMPLRT_DIV.")
78 #ifndef IMU_MPU_CHAN_X
79 #define IMU_MPU_CHAN_X 0
82 #ifndef IMU_MPU_CHAN_Y
83 #define IMU_MPU_CHAN_Y 1
86 #ifndef IMU_MPU_CHAN_Z
87 #define IMU_MPU_CHAN_Z 2
92 #ifndef IMU_MPU_X_SIGN
93 #define IMU_MPU_X_SIGN 1
96 #ifndef IMU_MPU_Y_SIGN
97 #define IMU_MPU_Y_SIGN 1
100 #ifndef IMU_MPU_Z_SIGN
101 #define IMU_MPU_Z_SIGN 1
void mpu60x0_spi_init(struct Mpu60x0_Spi *mpu, struct spi_periph *spi_p, uint8_t slave_idx)
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.
enum Mpu60x0ACCDLPF dlpf_cfg_acc
Digital Low Pass Filter for acceleremoter (ICM devices only)
struct Imu imu
global IMU state
enum Mpu60x0GyroRanges gyro_range
deg/s Range
void imu_mpu_spi_periodic(void)
enum Mpu60x0AccelRanges accel_range
g Range
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
#define IMU_MPU_ACCEL_LOWPASS_FILTER
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
union Mpu60x0_Spi::@331 data_accel
#define IMU_MPU_SMPLRT_DIV
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
Inertial Measurement Unit interface.
void imu_scale_gyro(struct Imu *_imu)
volatile bool data_available
data ready flag
struct Int32Vect3 accel_unscaled
unscaled accelerometer measurements
#define IMU_MPU_GYRO_RANGE
void imu_scale_accel(struct Imu *_imu)
#define IMU_MPU_LOWPASS_FILTER
#define RATES_COPY(_a, _b)
struct ImuMpu6000 imu_mpu_spi
void imu_mpu_spi_init(void)
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define IMU_MPU_ACCEL_RANGE
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
union Mpu60x0_Spi::@332 data_rates