35 #ifndef ASPIRIN_SPI_SLAVE_IDX
36 #define ASPIRIN_SPI_SLAVE_IDX SPI_SLAVE2
40 #ifndef ASPIRIN_SPI_DEV
41 #define ASPIRIN_SPI_DEV spi2
45 #ifndef ASPIRIN_I2C_DEV
46 #define ASPIRIN_I2C_DEV i2c2
50 #ifndef ASPIRIN_ACCEL_RATE
51 #define ASPIRIN_ACCEL_RATE ADXL345_RATE_800HZ
57 #if !defined ASPIRIN_GYRO_LOWPASS && !defined ASPIRIN_GYRO_SMPLRT_DIV
58 #define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_256HZ
59 #define ASPIRIN_GYRO_SMPLRT_DIV 14
95 #ifdef IMU_ASPIRIN_VERSION_1_0
99 #if ASPIRIN_ARCH_INDEP
100 TODO(
"Arch dependent functions (accel and gyro eoc interrupt) not used for aspirin!")
140 #ifdef IMU_ASPIRIN_VERSION_1_0
142 #else // aspirin 1.5 with hmc5883
struct ImuAspirin imu_aspirin
struct Adxl345Config config
void imu_aspirin_arch_init(void)
void imu_aspirin_event(void)
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)
enum Adxl345Rates rate
Data Output Rate.
volatile bool_t data_available
data ready flag
#define VECT3_COPY(_a, _b)
volatile uint8_t mag_valid
Main include for ABI (AirBorneInterface).
void imu_impl_init(void)
must be defined by underlying hardware
void imu_periodic(void)
optional.
union Adxl345_Spi::@25 data
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Architecture independent SPI (Serial Peripheral Interface) API.
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
volatile bool_t data_available
data ready flag
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
void adxl345_spi_event(struct Adxl345_Spi *adxl)
#define ASPIRIN_ACCEL_RATE
struct Imu imu
global IMU state
struct Adxl345_Spi acc_adxl
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
#define ASPIRIN_GYRO_LOWPASS
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_spi_init(struct Adxl345_Spi *adxl, struct spi_periph *spi_p, uint8_t slave_idx)
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
volatile uint8_t accel_valid
void itg3200_event(struct Itg3200 *itg)
static void itg3200_periodic(struct Itg3200 *itg)
convenience function: read or start configuration if not already initialized
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)
static void adxl345_spi_periodic(struct Adxl345_Spi *adxl)
convenience function: read or start configuration if not already initialized
#define ASPIRIN_SPI_SLAVE_IDX
volatile uint8_t gyro_valid
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
#define ASPIRIN_GYRO_SMPLRT_DIV