33 #include "generated/modules.h"
37 #ifndef ASPIRIN_SPI_SLAVE_IDX
38 #define ASPIRIN_SPI_SLAVE_IDX SPI_SLAVE2
42 #ifndef ASPIRIN_SPI_DEV
43 #define ASPIRIN_SPI_DEV spi2
47 #ifndef ASPIRIN_I2C_DEV
48 #define ASPIRIN_I2C_DEV i2c2
52 #ifndef ASPIRIN_ACCEL_RATE
53 #define ASPIRIN_ACCEL_RATE ADXL345_RATE_800HZ
59 #if !defined ASPIRIN_GYRO_LOWPASS && !defined ASPIRIN_GYRO_SMPLRT_DIV
60 #define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_256HZ
61 #define ASPIRIN_GYRO_SMPLRT_DIV 14
92 #ifdef IMU_ASPIRIN_VERSION_1_5
114 #ifdef IMU_ASPIRIN_VERSION_1_0
118 #if ASPIRIN_ARCH_INDEP
119 TODO(
"Arch dependent functions (accel and gyro eoc interrupt) not used for aspirin!")
145 AbiSendMsgIMU_ACCEL_RAW(
IMU_ASPIRIN_ID, now_ts, &accel, 1, IMU_ASPIRIN_PERIODIC_FREQ, NAN);
160 #ifdef IMU_ASPIRIN_VERSION_1_0
Main include for ABI (AirBorneInterface).
enum Adxl345Rates rate
Data Output Rate.
void adxl345_spi_init(struct Adxl345_Spi *adxl, struct spi_periph *spi_p, uint8_t slave_idx)
void adxl345_spi_event(struct Adxl345_Spi *adxl)
struct Adxl345Config config
union Adxl345_Spi::@309 data
volatile bool data_available
data ready flag
static void adxl345_spi_periodic(struct Adxl345_Spi *adxl)
convenience function: read or start configuration if not already initialized
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define VECT3_COPY(_a, _b)
void hmc58xx_init(struct Hmc58xx *hmc, struct i2c_periph *i2c_p, uint8_t addr)
Initialize Hmc58xx struct and set default config options.
void hmc58xx_event(struct Hmc58xx *hmc)
static void hmc58xx_periodic(struct Hmc58xx *hmc)
convenience function: read or start configuration if not already initialized
volatile bool data_available
data ready flag
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
void imu_set_defaults_accel(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Vect3 *neutral, const struct Int32Vect3 *scale)
Set the defaults for a accel sensor WARNING: Should be called before sensor is publishing messages to...
void imu_set_defaults_gyro(uint8_t abi_id, const struct Int32RMat *imu_to_sensor, const struct Int32Rates *neutral, const struct Int32Rates *scale)
Set the defaults for a gyro sensor WARNING: Should be called before sensor is publishing messages to ...
Inertial Measurement Unit interface.
#define ASPIRIN_GYRO_LOWPASS
#define ASPIRIN_GYRO_SMPLRT_DIV
void imu_aspirin_init(void)
void imu_aspirin_periodic(void)
#define ASPIRIN_SPI_SLAVE_IDX
void imu_aspirin_event(void)
#define ASPIRIN_ACCEL_RATE
struct ImuAspirin imu_aspirin
Interface for the Aspirin v1.x IMU using SPI for the accelerometer.
struct Adxl345_Spi acc_adxl
void imu_aspirin_arch_init(void)
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
void itg3200_init(struct Itg3200 *itg, struct i2c_periph *i2c_p, uint8_t addr)
Initialize Itg3200 struct and set default config options.
void itg3200_event(struct Itg3200 *itg)
enum Itg3200DLPF dlpf_cfg
Digital Low Pass Filter.
static void itg3200_periodic(struct Itg3200 *itg)
convenience function: read or start configuration if not already initialized
uint8_t smplrt_div
Sample rate divider.
struct Itg3200Config config
volatile bool data_available
data ready flag
static const struct Int32Rates gyro_scale[2]
Default gyro scale.
static const struct Int32Vect3 accel_scale[2]
Default accel scale/neutral.
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
Architecture independent SPI (Serial Peripheral Interface) API.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.