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
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
void imu_scale_gyro(struct Imu *_imu)
void imu_scale_accel(struct Imu *_imu)
enum Adxl345Rates rate
Data Output Rate.
volatile bool_t data_available
data ready flag
Main include for ABI (AirBorneInterface).
#define IMU_PPZUAV_GYRO_LOWPASS
gyro internal lowpass frequency
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#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
struct Imu imu
global IMU state
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.
volatile bool_t data_available
data ready flag
void adxl345_i2c_init(struct Adxl345_I2c *adxl, struct i2c_periph *i2c_p, uint8_t addr)
void imu_periodic(void)
optional.
volatile bool_t data_available
data ready flag
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
#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
struct Itg3200Config config
void hmc58xx_event(struct Hmc58xx *hmc)
int32_t q
in rad/s with INT32_RATE_FRAC
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
union Adxl345_I2c::@24 data
void imu_impl_init(void)
must be defined by underlying hardware