39 #if !defined DROTEK_2_LOWPASS_FILTER && !defined DROTEK_2_SMPLRT_DIV
40 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
44 #define DROTEK_2_LOWPASS_FILTER MPU60X0_DLPF_42HZ
45 #define DROTEK_2_SMPLRT_DIV 9
46 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
47 #elif PERIODIC_FREQUENCY == 512
51 #define DROTEK_2_LOWPASS_FILTER MPU60X0_DLPF_256HZ
52 #define DROTEK_2_SMPLRT_DIV 3
56 PRINT_CONFIG_VAR(DROTEK_2_SMPLRT_DIV)
57 PRINT_CONFIG_VAR(DROTEK_2_LOWPASS_FILTER)
62 #ifndef DROTEK_2_MPU_I2C_ADDR
63 #define DROTEK_2_MPU_I2C_ADDR MPU60X0_ADDR_ALT
67 #ifndef DROTEK_2_HMC_I2C_ADDR
68 #define DROTEK_2_HMC_I2C_ADDR HMC58XX_ADDR
118 #if IMU_DROTEK_2_ORIENTATION_IC_UP
142 #if IMU_DROTEK_2_ORIENTATION_IC_UP
159 void *
mpu __attribute__((unused)))
void imu_drotek2_periodic(void)
bool initialized
config done flag
volatile bool data_available
data ready flag
union Mpu60x0_I2c::@314 data_rates
union Mpu60x0_I2c::@313 data_accel
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
bool imu_drotek2_configure_mag_slave(Mpu60x0ConfigSet mpu_set, void *mpu)
callback function to configure hmc5883 mag
void hmc58xx_start_configure(struct Hmc58xx *hmc)
bool initialized
config done flag
void mpu60x0_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
struct Mpu60x0Config config
#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
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
struct ImuDrotek2 imu_drotek2
Mpu60x0I2cSlaveConfigure configure
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
int32_t r
in rad/s with INT32_RATE_FRAC
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
void hmc58xx_read(struct Hmc58xx *hmc)
#define DROTEK_2_HMC_I2C_ADDR
#define DROTEK_2_GYRO_RANGE
#define DROTEK_2_ACCEL_RANGE
uint8_t nb_slaves
number of used I2C slaves
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)
void imu_drotek2_init(void)
void imu_scale_mag(struct Imu *_imu)
#define DROTEK_2_MPU_I2C_ADDR
int32_t p
in rad/s with INT32_RATE_FRAC
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
static void mpu60x0_i2c_periodic(struct Mpu60x0_I2c *mpu)
convenience function: read or start configuration if not already initialized
void imu_scale_accel(struct Imu *_imu)
bool i2c_bypass
Bypass MPU I2C.
#define RATES_COPY(_a, _b)
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void hmc58xx_event(struct Hmc58xx *hmc)
struct Mpu60x0I2cSlave slaves[MPU60X0_I2C_NB_SLAVES]
I2C slaves.
int32_t q
in rad/s with INT32_RATE_FRAC
void(* Mpu60x0ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
void imu_drotek2_event(void)
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
volatile bool data_available
data ready flag
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
struct Mpu60x0_I2c mpu
The MPU gyro/accel device.