34 #if !defined PX4FMU_LOWPASS_FILTER && !defined PX4FMU_SMPLRT_DIV
35 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
39 #define PX4FMU_LOWPASS_FILTER MPU60X0_DLPF_42HZ
40 #define PX4FMU_SMPLRT_DIV 9
41 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
42 #elif PERIODIC_FREQUENCY == 512
46 #define PX4FMU_LOWPASS_FILTER MPU60X0_DLPF_256HZ
47 #define PX4FMU_SMPLRT_DIV 3
50 #error Non-default PERIODIC_FREQUENCY: please define PX4FMU_LOWPASS_FILTER and PX4FMU_SMPLRT_DIV.
53 PRINT_CONFIG_VAR(PX4FMU_LOWPASS_FILTER)
54 PRINT_CONFIG_VAR(PX4FMU_SMPLRT_DIV)
56 #ifndef PX4FMU_GYRO_RANGE
57 #define PX4FMU_GYRO_RANGE MPU60X0_GYRO_RANGE_2000
61 #ifndef PX4FMU_ACCEL_RANGE
62 #define PX4FMU_ACCEL_RANGE MPU60X0_ACCEL_RANGE_16G
void mpu60x0_spi_init(struct Mpu60x0_Spi *mpu, struct spi_periph *spi_p, uint8_t slave_idx)
volatile bool data_available
data ready flag
void imu_scale_gyro(struct Imu *_imu)
void imu_scale_accel(struct Imu *_imu)
struct Mpu60x0Config config
void mpu60x0_spi_event(struct Mpu60x0_Spi *mpu)
#define VECT3_ASSIGN(_a, _x, _y, _z)
#define RATES_ASSIGN(_ra, _p, _q, _r)
Main include for ABI (AirBorneInterface).
union Mpu60x0_Spi::@314 data_accel
uint8_t smplrt_div
Sample rate divider.
struct Imu imu
global IMU state
enum Mpu60x0GyroRanges gyro_range
deg/s Range
void imu_px4fmu_periodic(void)
enum Mpu60x0AccelRanges accel_range
g Range
void imu_px4fmu_init(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
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.
#define PX4FMU_GYRO_RANGE
struct ImuPx4fmu imu_px4fmu
volatile bool data_available
data ready flag
Register defs for Honeywell HMC5843 and HMC5883 magnetometers.
void imu_scale_mag(struct Imu *_imu)
union Mpu60x0_Spi::@315 data_rates
static void hmc58xx_periodic(struct Hmc58xx *hmc)
convenience function: read or start configuration if not already initialized
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
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void hmc58xx_event(struct Hmc58xx *hmc)
void imu_px4fmu_event(void)
process_rx_dma_interrupt & spi1
receive transferred over DMA
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
#define PX4FMU_ACCEL_RANGE