 |
Paparazzi UAS
v6.1.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
31 #if IMU_MPU_USE_MEDIAN_FILTER
36 PRINT_CONFIG_VAR(IMU_MPU_SPI_SLAVE_IDX)
37 PRINT_CONFIG_VAR(IMU_MPU_SPI_DEV)
40 #if !defined IMU_MPU_LOWPASS_FILTER && !defined IMU_MPU_SMPLRT_DIV
41 #if (PERIODIC_FREQUENCY >= 60) && (PERIODIC_FREQUENCY <= 120)
45 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_42HZ
46 #define IMU_MPU_SMPLRT_DIV 9
47 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
48 #ifndef IMU_MPU_ACCEL_LOWPASS_FILTER
49 #define IMU_MPU_ACCEL_LOWPASS_FILTER MPU60X0_DLPF_ACC_44HZ // for ICM sensors
51 #elif (PERIODIC_FREQUENCY == 512) || (PERIODIC_FREQUENCY == 500)
55 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_256HZ
56 #define IMU_MPU_SMPLRT_DIV 3
58 #ifndef IMU_MPU_ACCEL_LOWPASS_FILTER
59 #define IMU_MPU_ACCEL_LOWPASS_FILTER MPU60X0_DLPF_ACC_218HZ // for ICM sensors
63 #define IMU_MPU_LOWPASS_FILTER MPU60X0_DLPF_42HZ
64 #define IMU_MPU_SMPLRT_DIV 9
65 PRINT_CONFIG_MSG(
"Gyro/Accel output rate is 100Hz at 1kHz internal sampling")
66 #ifndef IMU_MPU_ACCEL_LOWPASS_FILTER
67 #define IMU_MPU_ACCEL_LOWPASS_FILTER MPU60X0_DLPF_ACC_44HZ // for ICM sensors
69 INFO(
"Non-default PERIODIC_FREQUENCY: using default IMU_MPU_LOWPASS_FILTER and IMU_MPU_SMPLRT_DIV.")
80 #ifndef IMU_MPU_CHAN_X
81 #define IMU_MPU_CHAN_X 0
84 #ifndef IMU_MPU_CHAN_Y
85 #define IMU_MPU_CHAN_Y 1
88 #ifndef IMU_MPU_CHAN_Z
89 #define IMU_MPU_CHAN_Z 2
94 #ifndef IMU_MPU_X_SIGN
95 #define IMU_MPU_X_SIGN 1
98 #ifndef IMU_MPU_Y_SIGN
99 #define IMU_MPU_Y_SIGN 1
102 #ifndef IMU_MPU_Z_SIGN
103 #define IMU_MPU_Z_SIGN 1
109 #if IMU_MPU_USE_MEDIAN_FILTER
117 #if IMU_MPU_USE_MEDIAN_FILTER
155 #if IMU_MPU_USE_MEDIAN_FILTER
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
void imu_scale_accel(struct Imu *_imu)
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
uint8_t smplrt_div
Sample rate divider.
#define IMU_MPU_ACCEL_RANGE
enum Mpu60x0GyroRanges gyro_range
deg/s Range
union Mpu60x0_Spi::@330 data_rates
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
#define IMU_MPU_GYRO_RANGE
enum Mpu60x0AccelRanges accel_range
g Range
enum Mpu60x0ACCDLPF dlpf_cfg_acc
Digital Low Pass Filter for acceleremoter (ICM devices only)
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
struct Int32Vect3 accel_unscaled
unscaled accelerometer measurements
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define IMU_MPU_SMPLRT_DIV
#define IMU_MPU_ACCEL_LOWPASS_FILTER
struct Imu imu
global IMU state
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
void imu_mpu_spi_periodic(void)
static void mpu60x0_spi_periodic(struct Mpu60x0_Spi *mpu)
convenience function: read or start configuration if not already initialized
int int32_t
Typedef defining 32 bit int type.
#define IMU_MPU_LOWPASS_FILTER
void imu_mpu_spi_event(void)
volatile bool data_available
data ready flag
union Mpu60x0_Spi::@329 data_accel
void imu_scale_gyro(struct Imu *_imu)
#define RATES_COPY(_a, _b)
struct Mpu60x0Config config
void imu_mpu_spi_init(void)
void mpu60x0_spi_init(struct Mpu60x0_Spi *mpu, struct spi_periph *spi_p, uint8_t slave_idx)
void mpu60x0_spi_event(struct Mpu60x0_Spi *mpu)
#define VECT3_COPY(_a, _b)
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
struct ImuMpu6000 imu_mpu_spi