38 #include "pprzlink/messages.h"
41 #ifndef IMU_APOGEE_CHAN_X
42 #define IMU_APOGEE_CHAN_X 0
44 #ifndef IMU_APOGEE_CHAN_Y
45 #define IMU_APOGEE_CHAN_Y 1
47 #ifndef IMU_APOGEE_CHAN_Z
48 #define IMU_APOGEE_CHAN_Z 2
51 #if !defined APOGEE_LOWPASS_FILTER && !defined APOGEE_SMPLRT_DIV
52 #define APOGEE_LOWPASS_FILTER MPU60X0_DLPF_42HZ
53 #define APOGEE_SMPLRT_DIV 9
62 #if APOGEE_USE_MPU9150
67 #ifndef APOGEE_MAG_FREQ
68 #define APOGEE_MAG_FREQ 50
70 PRINT_CONFIG_VAR(APOGEE_MAG_FREQ)
73 #define MAG_PRESCALER Max(1,((PERIODIC_FREQUENCY)/APOGEE_MAG_FREQ))
74 PRINT_CONFIG_VAR(MAG_PRESCALER)
78 bool configure_mag_slave(
Mpu60x0ConfigSet mpu_set __attribute__((unused)),
void *mpu __attribute__((unused)))
108 #if APOGEE_USE_MPU9150
121 #if APOGEE_USE_MPU9150
164 #if APOGEE_USE_MPU9150
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
#define APOGEE_ACCEL_RANGE
Driver for the IMU on the Apogee board.
#define APOGEE_GYRO_RANGE
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
void mpu60x0_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
struct Mpu60x0Config config
void ak8975_event(struct Ak8975 *ak)
#define VECT3_COPY(_a, _b)
Main include for ABI (AirBorneInterface).
uint8_t smplrt_div
Sample rate divider.
void ak8975_init(struct Ak8975 *ak, struct i2c_periph *i2c_p, uint8_t addr)
struct Imu imu
global IMU state
enum Mpu60x0GyroRanges gyro_range
deg/s Range
enum Mpu60x0AccelRanges accel_range
g Range
static void ak8975_periodic(struct Ak8975 *ak)
convenience function: read or start configuration if not already initialized
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
Mpu60x0I2cSlaveConfigure configure
void imu_apogee_init(void)
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
#define IMU_APOGEE_CHAN_Y
uint8_t nb_slaves
number of used I2C slaves
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
#define APOGEE_LOWPASS_FILTER
void imu_apogee_event(void)
#define IMU_APOGEE_CHAN_Z
struct Int32Vect3 mag
magnetometer measurements scaled to 1 in BFP with INT32_MAG_FRAC
union Mpu60x0_I2c::@330 data_rates
#define IMU_APOGEE_CHAN_X
void imu_scale_gyro(struct Imu *_imu)
void imu_apogee_downlink_raw(void)
union Mpu60x0_I2c::@329 data_accel
void imu_scale_mag(struct Imu *_imu)
void imu_apogee_periodic(void)
Common code for AP and FBW telemetry.
int32_t p
in rad/s with INT32_RATE_FRAC
arch independent LED (Light Emitting Diodes) API
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.
struct Mpu60x0I2cSlave slaves[MPU60X0_I2C_NB_SLAVES]
I2C slaves.
#define AK8975_I2C_SLV_ADDR
int32_t q
in rad/s with INT32_RATE_FRAC
void(* Mpu60x0ConfigSet)(void *mpu, uint8_t _reg, uint8_t _val)
Configuration function prototype.
struct ImuApogee imu_apogee
bool configure_baro_slave(Mpu60x0ConfigSet mpu_set, void *mpu)
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.
#define APOGEE_SMPLRT_DIV