32 #include "generated/modules.h"
39 #ifndef ASPIRIN_I2C_DEV
40 #define ASPIRIN_I2C_DEV i2c2
45 #ifndef ASPIRIN_ACCEL_RATE
46 # if PERIODIC_FREQUENCY <= 60
47 # define ASPIRIN_ACCEL_RATE ADXL345_RATE_50HZ
48 # elif PERIODIC_FREQUENCY <= 120
49 # define ASPIRIN_ACCEL_RATE ADXL345_RATE_100HZ
51 # define ASPIRIN_ACCEL_RATE ADXL345_RATE_200HZ
58 #ifndef ASPIRIN_GYRO_LOWPASS
59 # if PERIODIC_FREQUENCY <= 60
60 # define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_20HZ
61 # elif PERIODIC_FREQUENCY <= 120
62 # define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_42HZ
64 # define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_98HZ
71 #ifndef ASPIRIN_GYRO_SMPLRT_DIV
72 # if PERIODIC_FREQUENCY <= 60
73 # define ASPIRIN_GYRO_SMPLRT_DIV 19
76 # define ASPIRIN_GYRO_SMPLRT_DIV 9
95 #ifdef ASPIRIN_I2C_CS_PORT
97 gpio_set(ASPIRIN_I2C_CS_PORT, ASPIRIN_I2C_CS_PIN);
113 #ifdef IMU_ASPIRIN_VERSION_1_5
135 #ifdef IMU_ASPIRIN_VERSION_1_0
173 #ifdef IMU_ASPIRIN_VERSION_1_0
Main include for ABI (AirBorneInterface).
enum Adxl345Rates rate
Data Output Rate.
void adxl345_i2c_init(struct Adxl345_I2c *adxl, struct i2c_periph *i2c_p, uint8_t addr)
void adxl345_i2c_event(struct Adxl345_I2c *adxl)
struct Adxl345Config config
volatile bool data_available
data ready flag
static void adxl345_i2c_periodic(struct Adxl345_I2c *adxl)
convenience function: read or start configuration if not already initialized
union Adxl345_I2c::@308 data
#define ADXL345_ADDR
default I2C address
void gpio_setup_output(ioportid_t port, uint16_t gpios)
Setup one or more pins of the given GPIO port as outputs.
static void gpio_set(ioportid_t port, uint16_t pin)
Set a gpio output to high level.
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Some architecture independent helper functions for GPIOs.
#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
gyro internal lowpass frequency
#define ASPIRIN_GYRO_SMPLRT_DIV
gyro sample rate divider
void imu_aspirin_i2c_init(void)
void imu_aspirin_i2c_event(void)
void imu_aspirin_i2c_periodic(void)
#define ASPIRIN_ACCEL_RATE
adxl345 accelerometer output rate, lowpass is set to half of rate
struct ImuAspirinI2c imu_aspirin
Interface for the Aspirin v1.x IMU using I2C for the accelerometer.
struct Adxl345_I2c acc_adxl
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)
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.