36 #ifndef IMU_PPZUAV_I2C_DEV
37 #define IMU_PPZUAV_I2C_DEV i2c0
41 #ifndef IMU_PPZUAV_ACCEL_RATE
42 # if PERIODIC_FREQUENCY <= 60
43 # define IMU_PPZUAV_ACCEL_RATE ADXL345_RATE_50HZ
44 # elif PERIODIC_FREQUENCY <= 120
45 # define IMU_PPZUAV_ACCEL_RATE ADXL345_RATE_100HZ
47 # define IMU_PPZUAV_ACCEL_RATE ADXL345_RATE_200HZ
54 #ifndef IMU_PPZUAV_GYRO_LOWPASS
55 # if PERIODIC_FREQUENCY <= 60
56 # define IMU_PPZUAV_GYRO_LOWPASS ITG3200_DLPF_20HZ
57 # elif PERIODIC_FREQUENCY <= 120
58 # define IMU_PPZUAV_GYRO_LOWPASS ITG3200_DLPF_42HZ
60 # define IMU_PPZUAV_GYRO_LOWPASS ITG3200_DLPF_98HZ
67 #ifndef IMU_PPZUAV_GYRO_SMPLRT_DIV
68 # if PERIODIC_FREQUENCY <= 60
69 # define IMU_PPZUAV_GYRO_SMPLRT_DIV 19
72 # define IMU_PPZUAV_GYRO_SMPLRT_DIV 9
volatile bool data_available
data ready flag
uint8_t smplrt_div
Sample rate divider.
void itg3200_init(struct Itg3200 *itg, struct i2c_periph *i2c_p, uint8_t addr)
Initialize Itg3200 struct and set default config options.
struct Adxl345_I2c acc_adxl
enum Adxl345Rates rate
Data Output Rate.
Main include for ABI (AirBorneInterface).
#define IMU_PPZUAV_GYRO_LOWPASS
gyro internal lowpass frequency
struct Imu imu
global IMU state
#define IMU_PPZUAV_ACCEL_RATE
adxl345 accelerometer output rate, lowpass is set to half of rate
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
struct Adxl345Config config
static void adxl345_i2c_periodic(struct Adxl345_I2c *adxl)
convenience function: read or start configuration if not already initialized
void imu_ppzuav_event(void)
void adxl345_i2c_event(struct Adxl345_I2c *adxl)
#define IMU_PPZUAV_I2C_DEV
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 adxl345_i2c_init(struct Adxl345_I2c *adxl, struct i2c_periph *i2c_p, uint8_t addr)
union Adxl345_I2c::@293 data
enum Itg3200DLPF dlpf_cfg
Digital Low Pass Filter.
void imu_scale_mag(struct Imu *_imu)
static void hmc58xx_periodic(struct Hmc58xx *hmc)
convenience function: read or start configuration if not already initialized
void imu_ppzuav_init(void)
#define IMU_PPZUAV_GYRO_SMPLRT_DIV
gyro sample rate divider
struct ImuPpzuav imu_ppzuav
void itg3200_event(struct Itg3200 *itg)
static void itg3200_periodic(struct Itg3200 *itg)
convenience function: read or start configuration if not already initialized
int32_t p
in rad/s with INT32_RATE_FRAC
#define ADXL345_ADDR
default I2C address
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
void imu_scale_accel(struct Imu *_imu)
void imu_ppzuav_periodic(void)
volatile bool data_available
data ready flag
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
struct Itg3200Config config
void hmc58xx_event(struct Hmc58xx *hmc)
int32_t q
in rad/s with INT32_RATE_FRAC
volatile bool data_available
data ready flag
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
Architecture independent I2C (Inter-Integrated Circuit Bus) API.