31 #include "generated/modules.h"
35 #define DISCO_MAG_I2C_DEV i2c1
37 #define DISCO_MPU_I2C_DEV i2c2
40 #if !defined AK8963_HZ
44 #if !defined DISCO_LOWPASS_FILTER && !defined DISCO_SMPLRT_DIV
45 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
49 #define DISCO_LOWPASS_FILTER MPU60X0_DLPF_42HZ
50 #define DISCO_SMPLRT_DIV 9
51 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
52 #elif PERIODIC_FREQUENCY == 512
56 #define DISCO_LOWPASS_FILTER MPU60X0_DLPF_256HZ
57 #define DISCO_SMPLRT_DIV 3
Main include for ABI (AirBorneInterface).
void ak8963_event(struct Ak8963 *ak)
void ak8963_init(struct Ak8963 *ak, struct i2c_periph *i2c_p, uint8_t addr)
Initialize AK8963 struct.
volatile bool data_available
data ready flag
static void ak8963_periodic(struct Ak8963 *ak)
convenience function: read or start configuration if not already initialized
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define RATES_ASSIGN(_ra, _p, _q, _r)
#define VECT3_ASSIGN(_a, _x, _y, _z)
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
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.
void imu_disco_periodic(void)
Handle all the periodic tasks of the Disco IMU components.
struct ImuDisco imu_disco
Disco IMU data.
#define DISCO_MPU_I2C_DEV
void imu_disco_init(void)
Disco IMU initializtion of the MPU-60x0 and HMC58xx.
#define DISCO_MAG_I2C_DEV
void imu_disco_event(void)
Handle all the events of the Disco IMU components.
Interface for the Disco magnetometer, accelerometer and gyroscope.
#define DISCO_ACCEL_RANGE
struct Ak8963 ak
The AK8963 mag.
struct Mpu60x0_I2c mpu
The MPU gyro/accel device.
Everything that is in the disco IMU.
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_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
union Mpu60x0_I2c::@341 data_accel
volatile bool data_available
data ready flag
static void mpu60x0_i2c_periodic(struct Mpu60x0_I2c *mpu)
convenience function: read or start configuration if not already initialized
union Mpu60x0_I2c::@342 data_rates
float temp
temperature in degrees Celcius
struct Mpu60x0Config config
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.