37 #ifndef ASPIRIN_I2C_DEV
38 #define ASPIRIN_I2C_DEV i2c2
43 #ifndef ASPIRIN_ACCEL_RATE
44 # if PERIODIC_FREQUENCY <= 60
45 # define ASPIRIN_ACCEL_RATE ADXL345_RATE_50HZ
46 # elif PERIODIC_FREQUENCY <= 120
47 # define ASPIRIN_ACCEL_RATE ADXL345_RATE_100HZ
49 # define ASPIRIN_ACCEL_RATE ADXL345_RATE_200HZ
56 #ifndef ASPIRIN_GYRO_LOWPASS
57 # if PERIODIC_FREQUENCY <= 60
58 # define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_20HZ
59 # elif PERIODIC_FREQUENCY <= 120
60 # define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_42HZ
62 # define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_98HZ
69 #ifndef ASPIRIN_GYRO_SMPLRT_DIV
70 # if PERIODIC_FREQUENCY <= 60
71 # define ASPIRIN_GYRO_SMPLRT_DIV 19
74 # define ASPIRIN_GYRO_SMPLRT_DIV 9
93 #ifdef ASPIRIN_I2C_CS_PORT
95 gpio_set(ASPIRIN_I2C_CS_PORT, ASPIRIN_I2C_CS_PIN);
112 #ifdef IMU_ASPIRIN_VERSION_1_0
153 #ifdef IMU_ASPIRIN_VERSION_1_0
155 #else // aspirin 1.5 with hmc5883
void imu_aspirin_i2c_event(void)
void imu_periodic(void)
optional.
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.
void imu_scale_gyro(struct Imu *_imu)
void imu_scale_accel(struct Imu *_imu)
Some architecture independent helper functions for GPIOs.
enum Adxl345Rates rate
Data Output Rate.
volatile bool_t data_available
data ready flag
#define VECT3_COPY(_a, _b)
Main include for ABI (AirBorneInterface).
#define ASPIRIN_ACCEL_RATE
adxl345 accelerometer output rate, lowpass is set to half of rate
#define ASPIRIN_GYRO_LOWPASS
gyro internal lowpass frequency
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
struct ImuAspirinI2c imu_aspirin
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
void gpio_set(uint32_t port, uint16_t pin)
Set a gpio output to high level.
struct Adxl345Config config
static void adxl345_i2c_periodic(struct Adxl345_I2c *adxl)
convenience function: read or start configuration if not already initialized
void adxl345_i2c_event(struct Adxl345_I2c *adxl)
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)
#define ASPIRIN_GYRO_SMPLRT_DIV
gyro sample rate divider
volatile bool_t data_available
data ready flag
enum Itg3200DLPF dlpf_cfg
Digital Low Pass Filter.
void imu_impl_init(void)
must be defined by underlying hardware
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 itg3200_event(struct Itg3200 *itg)
static void itg3200_periodic(struct Itg3200 *itg)
convenience function: read or start configuration if not already initialized
#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
#define RATES_COPY(_a, _b)
struct Itg3200Config config
void hmc58xx_event(struct Hmc58xx *hmc)
struct Adxl345_I2c acc_adxl
void gpio_setup_output(uint32_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
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