31 #include "generated/modules.h"
35 #ifndef BEBOP_MAG_I2C_DEV
36 #define BEBOP_MAG_I2C_DEV i2c1
40 #ifndef BEBOP_MPU_I2C_DEV
41 #define BEBOP_MPU_I2C_DEV i2c2
45 #if !defined BEBOP_LOWPASS_FILTER && !defined BEBOP_SMPLRT_DIV
46 #if (PERIODIC_FREQUENCY == 60) || (PERIODIC_FREQUENCY == 120)
50 #define BEBOP_LOWPASS_FILTER MPU60X0_DLPF_42HZ
51 #define BEBOP_SMPLRT_DIV 9
52 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
53 #elif PERIODIC_FREQUENCY == 512
57 #define BEBOP_LOWPASS_FILTER MPU60X0_DLPF_256HZ
58 #define BEBOP_SMPLRT_DIV 3
96 { 0.0, RadOfDeg(8.5), M_PI };
Main include for ABI (AirBorneInterface).
void ak8963_event(struct Ak8963 *ak)
void ak8963_init(struct Ak8963 *ak, struct i2c_periph *i2c_p, uint8_t addr)
Initialize AK8963 struct.
volatile bool data_available
data ready flag
static void ak8963_periodic(struct Ak8963 *ak)
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 RATES_ASSIGN(_ra, _p, _q, _r)
#define VECT3_ASSIGN(_a, _x, _y, _z)
void int32_rmat_vmult(struct Int32Vect3 *vb, struct Int32RMat *m_a2b, struct Int32Vect3 *va)
rotate 3D vector by rotation matrix.
static struct Int32RMat * orientationGetRMat_i(struct OrientationReps *orientation)
Get vehicle body attitude rotation matrix (int).
static void orientationSetEulers_f(struct OrientationReps *orientation, struct FloatEulers *eulers)
Set vehicle body attitude from euler angles (float).
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 BEBOP_MPU_I2C_DEV
#define BEBOP_MAG_I2C_DEV
struct OrientationReps imu_to_mag_bebop
IMU to magneto rotation.
void imu_bebop_periodic(void)
Handle all the periodic tasks of the Navstik IMU components.
void imu_bebop_init(void)
Navstik IMU initializtion of the MPU-60x0 and HMC58xx.
void imu_bebop_event(void)
Handle all the events of the Navstik IMU components.
struct ImuBebop imu_bebop
Basic Navstik IMU data.
Interface for the Bebop magnetometer, accelerometer and gyroscope.
#define BEBOP_ACCEL_RANGE
struct Ak8963 ak
The AK8963 mag.
struct Mpu60x0_I2c mpu
The MPU gyro/accel device.
Everything that is in the bebop IMU.
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
const struct Int32Rates MPU60X0_GYRO_SENS_FRAC[4][2]
const struct Int32Vect3 MPU60X0_ACCEL_SENS_FRAC[4][2]
uint8_t smplrt_div
Sample rate divider.
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
enum Mpu60x0AccelRanges accel_range
g Range
enum Mpu60x0GyroRanges gyro_range
deg/s Range
void mpu60x0_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
union Mpu60x0_I2c::@341 data_accel
volatile bool data_available
data ready flag
static void mpu60x0_i2c_periodic(struct Mpu60x0_I2c *mpu)
convenience function: read or start configuration if not already initialized
union Mpu60x0_I2c::@342 data_rates
float temp
temperature in degrees Celcius
struct Mpu60x0Config config
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.