35 PRINT_CONFIG_VAR(IMU_MPU_SPI_SLAVE_IDX)
36 PRINT_CONFIG_VAR(IMU_MPU_SPI_DEV)
37 PRINT_CONFIG_VAR(IMU_HMC_I2C_DEV)
41 #if !defined IMU_MPU_LOWPASS_FILTER && !defined IMU_MPU_SMPLRT_DIV
42 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
46 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_42HZ
47 #define IMU_MPU_SMPLRT_DIV 9
48 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
49 #elif PERIODIC_FREQUENCY == 512
53 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_256HZ
54 #define IMU_MPU_SMPLRT_DIV 3
57 #error Non-default PERIODIC_FREQUENCY: please define IMU_MPU_LOWPASS_FILTER and IMU_MPU_SMPLRT_DIV.
67 #ifndef IMU_MPU_CHAN_X
68 #define IMU_MPU_CHAN_X 0
71 #ifndef IMU_MPU_CHAN_Y
72 #define IMU_MPU_CHAN_Y 1
75 #ifndef IMU_MPU_CHAN_Z
76 #define IMU_MPU_CHAN_Z 2
80 #ifndef IMU_MPU_X_SIGN
81 #define IMU_MPU_X_SIGN 1
84 #ifndef IMU_MPU_Y_SIGN
85 #define IMU_MPU_Y_SIGN 1
88 #ifndef IMU_MPU_Z_SIGN
89 #define IMU_MPU_Z_SIGN 1
94 #ifndef IMU_HMC_CHAN_X
95 #define IMU_HMC_CHAN_X 1
98 #ifndef IMU_HMC_CHAN_Y
99 #define IMU_HMC_CHAN_Y 0
102 #ifndef IMU_HMC_CHAN_Z
103 #define IMU_HMC_CHAN_Z 2
107 #ifndef IMU_HMC_X_SIGN
108 #define IMU_HMC_X_SIGN 1
111 #ifndef IMU_HMC_Y_SIGN
112 #define IMU_HMC_Y_SIGN -1
115 #ifndef IMU_HMC_Z_SIGN
116 #define IMU_HMC_Z_SIGN 1
Main include for ABI (AirBorneInterface).
#define IMU_MPU6000_HMC_ID
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void hmc58xx_init(struct Hmc58xx *hmc, struct i2c_periph *i2c_p, uint8_t addr)
Initialize Hmc58xx struct and set default config options.
void hmc58xx_event(struct Hmc58xx *hmc)
static void hmc58xx_periodic(struct Hmc58xx *hmc)
convenience function: read or start configuration if not already initialized
volatile bool data_available
data ready flag
Register defs for Honeywell HMC5843 and HMC5883 magnetometers.
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.
#define IMU_MPU_LOWPASS_FILTER
#define IMU_MPU_SMPLRT_DIV
#define IMU_MPU_GYRO_RANGE
#define IMU_MPU_ACCEL_RANGE
struct ImuMpu6000Hmc5883 imu_mpu_hmc
void imu_mpu_hmc_periodic(void)
void imu_mpu_hmc_event(void)
void imu_mpu_hmc_init(void)
Driver for IMU with MPU6000 via SPI and HMC5883 via I2c.
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
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_spi_event(struct Mpu60x0_Spi *mpu)
void mpu60x0_spi_init(struct Mpu60x0_Spi *mpu, struct spi_periph *spi_p, uint8_t slave_idx)
volatile bool data_available
data ready flag
union Mpu60x0_Spi::@326 data_accel
struct Mpu60x0Config config
float temp
temperature in degrees Celcius
static void mpu60x0_spi_periodic(struct Mpu60x0_Spi *mpu)
convenience function: read or start configuration if not already initialized
union Mpu60x0_Spi::@327 data_rates
Architecture independent SPI (Serial Peripheral Interface) API.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.