35 #include "../../peripherals/mpu60x0.h"
46 #ifndef PERIODIC_FREQUENCY
47 #define PERIODIC_FREQUENCY 60
77 #if PERIODIC_FREQUENCY == 60
79 # if PERIODIC_FREQUENCY == 120
81 # error PERIODIC_FREQUENCY should be either 60Hz or 120Hz. Otherwise manually fix the sensor rates
161 #if PERIODIC_FREQUENCY > 60
170 #if PERIODIC_FREQUENCY > 60
192 #define MPU_OFFSET_GYRO 9
199 #define MPU_OFFSET_ACC 1
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
void imu_impl_init(void)
must be defined by underlying hardware
#define MPU60X0_REG_PWR_MGMT_1
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
void imu_scale_gyro(struct Imu *_imu)
transaction successfully finished by I2C driver
void imu_scale_accel(struct Imu *_imu)
#define VECT3_ASSIGN(_a, _x, _y, _z)
#define RATES_ASSIGN(_ra, _p, _q, _r)
Main include for ABI (AirBorneInterface).
#define MPU60X0_REG_SMPLRT_DIV
void aspirin2_subsystem_event(void)
#define MPU60X0_REG_CONFIG
bool_t i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
void aspirin2_subsystem_downlink_raw(void)
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
int32_t r
in rad/s with INT32_RATE_FRAC
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
transaction set to done by user level
struct Imu imu
global IMU state
bool_t i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
I2C transaction structure.
enum I2CTransactionStatus status
Transaction status.
#define DefaultChannel
SITL.
#define MPU60X0_REG_INT_STATUS
struct i2c_transaction aspirin2_mpu60x0
Common code for AP and FBW telemetry.
int32_t p
in rad/s with INT32_RATE_FRAC
arch independent LED (Light Emitting Diodes) API
struct Int32Vect3 accel_unscaled
unscaled accelerometer measurements
void imu_periodic(void)
optional.
abstract IMU interface providing fixed point interface
int32_t q
in rad/s with INT32_RATE_FRAC
#define MPU60X0_REG_GYRO_CONFIG
transaction is pending in queue
#define MPU60X0_REG_ACCEL_CONFIG
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
Architecture independent I2C (Inter-Integrated Circuit Bus) API.