38 #ifndef ASPIRIN_I2C_DEV
39 #define ASPIRIN_I2C_DEV i2c2
44 #ifndef ASPIRIN_ACCEL_RATE
45 # if PERIODIC_FREQUENCY <= 60
46 # define ASPIRIN_ACCEL_RATE ADXL345_RATE_50HZ
47 # elif PERIODIC_FREQUENCY <= 120
48 # define ASPIRIN_ACCEL_RATE ADXL345_RATE_100HZ
50 # define ASPIRIN_ACCEL_RATE ADXL345_RATE_200HZ
57 #ifndef ASPIRIN_GYRO_LOWPASS
58 # if PERIODIC_FREQUENCY <= 60
59 # define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_20HZ
60 # elif PERIODIC_FREQUENCY <= 120
61 # define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_42HZ
63 # define ASPIRIN_GYRO_LOWPASS ITG3200_DLPF_98HZ
70 #ifndef ASPIRIN_GYRO_SMPLRT_DIV
71 # if PERIODIC_FREQUENCY <= 60
72 # define ASPIRIN_GYRO_SMPLRT_DIV 19
75 # define ASPIRIN_GYRO_SMPLRT_DIV 9
94 #ifdef ASPIRIN_I2C_CS_PORT
96 gpio_set(ASPIRIN_I2C_CS_PORT, ASPIRIN_I2C_CS_PIN);
112 #ifdef IMU_ASPIRIN_VERSION_1_5
134 #ifdef IMU_ASPIRIN_VERSION_1_0
172 #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)
union Adxl345_I2c::@295 data
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
#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.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.