35 #ifdef ADC_CHANNEL_GYRO_P
38 #ifdef ADC_CHANNEL_GYRO_Q
41 #ifdef ADC_CHANNEL_GYRO_R
44 #ifdef ADC_CHANNEL_ACCEL_X
47 #ifdef ADC_CHANNEL_ACCEL_Y
50 #ifdef ADC_CHANNEL_ACCEL_Z
59 static int last_head = 0;
70 #ifdef ADC_CHANNEL_GYRO_P
73 #ifdef ADC_CHANNEL_GYRO_Q
76 #ifdef ADC_CHANNEL_GYRO_R
79 #ifdef ADC_CHANNEL_ACCEL_X
82 #ifdef ADC_CHANNEL_ACCEL_Y
85 #ifdef ADC_CHANNEL_ACCEL_Z
96 #if defined ADC_CHANNEL_GYRO_P && defined ADC_CHANNEL_GYRO_Q && ! defined ADC_CHANNEL_GYRO_R
106 #elif defined ADC_CHANNEL_GYRO_P && ! defined ADC_CHANNEL_GYRO_Q && ! defined ADC_CHANNEL_GYRO_R
117 #if ! defined ADC_CHANNEL_ACCEL_X && ! defined ADC_CHANNEL_ACCEL_Z && ! defined ADC_CHANNEL_ACCEL_Z
#define IMU_GYRO_Q_SENS_DEN
void imu_scale_gyro(struct Imu *_imu)
Main include for ABI (AirBorneInterface).
#define IMU_GYRO_Q_SENS_NUM
#define IMU_GYRO_P_SENS_NUM
arch independent ADC (Analog to Digital Converter) API
static struct adc_buf analog_imu_adc_buf[NB_ANALOG_IMU_ADC]
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
struct Int32Rates gyro_neutral
gyroscope bias
int32_t r
in rad/s with INT32_RATE_FRAC
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
void imu_scale_accel(struct Imu *_imu)
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
#define IMU_GYRO_P_SENS_DEN
struct Imu imu
global IMU state
void adc_buf_channel(uint8_t adc_channel, struct adc_buf *s, uint8_t av_nb_sample)
Registers a buffer to be used to store the specified converted channel Usage:
void imu_impl_init(void)
must be defined by underlying hardware
#define NB_ANALOG_IMU_ADC
void imu_periodic(void)
optional.
Inertial Measurement Unit using onboard ADCs.
int32_t p
in rad/s with INT32_RATE_FRAC
struct Int32Vect3 accel_unscaled
unscaled accelerometer measurements
abstract IMU interface providing fixed point interface
int32_t q
in rad/s with INT32_RATE_FRAC
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC