34 PRINT_CONFIG_VAR(IMU_MPU_SPI_SLAVE_IDX)
35 PRINT_CONFIG_VAR(IMU_MPU_SPI_DEV)
36 PRINT_CONFIG_VAR(IMU_HMC_I2C_DEV)
40 #if !defined IMU_MPU_LOWPASS_FILTER && !defined IMU_MPU_SMPLRT_DIV
41 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
45 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_42HZ
46 #define IMU_MPU_SMPLRT_DIV 9
47 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
48 #elif PERIODIC_FREQUENCY == 512
52 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_256HZ
53 #define IMU_MPU_SMPLRT_DIV 3
56 #error Non-default PERIODIC_FREQUENCY: please define IMU_MPU_LOWPASS_FILTER and IMU_MPU_SMPLRT_DIV.
66 #ifndef IMU_MPU_CHAN_X
67 #define IMU_MPU_CHAN_X 0
70 #ifndef IMU_MPU_CHAN_Y
71 #define IMU_MPU_CHAN_Y 1
74 #ifndef IMU_MPU_CHAN_Z
75 #define IMU_MPU_CHAN_Z 2
79 #ifndef IMU_MPU_X_SIGN
80 #define IMU_MPU_X_SIGN 1
83 #ifndef IMU_MPU_Y_SIGN
84 #define IMU_MPU_Y_SIGN 1
87 #ifndef IMU_MPU_Z_SIGN
88 #define IMU_MPU_Z_SIGN 1
93 #ifndef IMU_HMC_CHAN_X
94 #define IMU_HMC_CHAN_X 1
97 #ifndef IMU_HMC_CHAN_Y
98 #define IMU_HMC_CHAN_Y 0
101 #ifndef IMU_HMC_CHAN_Z
102 #define IMU_HMC_CHAN_Z 2
106 #ifndef IMU_HMC_X_SIGN
107 #define IMU_HMC_X_SIGN 1
110 #ifndef IMU_HMC_Y_SIGN
111 #define IMU_HMC_Y_SIGN -1
114 #ifndef IMU_HMC_Z_SIGN
115 #define IMU_HMC_Z_SIGN 1
void mpu60x0_spi_init(struct Mpu60x0_Spi *mpu, struct spi_periph *spi_p, uint8_t slave_idx)
volatile bool data_available
data ready flag
struct Mpu60x0Config config
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.
struct Imu imu
global IMU state
enum Mpu60x0GyroRanges gyro_range
deg/s Range
enum Mpu60x0AccelRanges accel_range
g Range
struct ImuMpu6000Hmc5883 imu_mpu_hmc
void imu_mpu_hmc_event(void)
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
Architecture independent SPI (Serial Peripheral Interface) API.
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
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
#define IMU_MPU6000_HMC_ID
union Mpu60x0_Spi::@331 data_accel
#define IMU_MPU_SMPLRT_DIV
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
struct Int32Vect3 mag
magnetometer measurements scaled to 1 in BFP with INT32_MAG_FRAC
Inertial Measurement Unit interface.
void imu_scale_gyro(struct Imu *_imu)
volatile bool data_available
data ready flag
Register defs for Honeywell HMC5843 and HMC5883 magnetometers.
void imu_scale_mag(struct Imu *_imu)
static void hmc58xx_periodic(struct Hmc58xx *hmc)
convenience function: read or start configuration if not already initialized
void imu_mpu_hmc_periodic(void)
void hmc58xx_init(struct Hmc58xx *hmc, struct i2c_periph *i2c_p, uint8_t addr)
Initialize Hmc58xx struct and set default config options.
struct Int32Vect3 accel_unscaled
unscaled accelerometer measurements
void imu_mpu_hmc_init(void)
#define IMU_MPU_GYRO_RANGE
void imu_scale_accel(struct Imu *_imu)
#define IMU_MPU_LOWPASS_FILTER
#define RATES_COPY(_a, _b)
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define IMU_MPU_ACCEL_RANGE
void hmc58xx_event(struct Hmc58xx *hmc)
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
union Mpu60x0_Spi::@332 data_rates