41 #if !defined KROOZ_LOWPASS_FILTER && !defined KROOZ_SMPLRT_DIV
42 #define KROOZ_LOWPASS_FILTER MPU60X0_DLPF_256HZ
43 #define KROOZ_SMPLRT_DIV 1
48 #ifndef KROOZ_GYRO_RANGE
49 #define KROOZ_GYRO_RANGE MPU60X0_GYRO_RANGE_250
53 #ifndef KROOZ_ACCEL_RANGE
54 #define KROOZ_ACCEL_RANGE MPU60X0_ACCEL_RANGE_2G
60 #if IMU_KROOZ_USE_ACCEL_MEDIAN_FILTER
84 #if IMU_KROOZ_USE_ACCEL_MEDIAN_FILTER
144 #if IMU_KROOZ_USE_ACCEL_MEDIAN_FILTER
158 RunOnceEvery(128, {axis_nb = 5;});
178 if (axis_cnt < axis_nb) {
184 axis_cnt <= 2 ? 0xF0 | (axis_cnt << 1) : (axis_cnt >= 4 ? 0xF0 | ((axis_cnt - 3) << 1) : 0xB0);
struct Int32Vect3 accel_filtered
enum SPIClockPolarity cpol
clock polarity control
bool initialized
config done flag
#define VECT3_ADD(_a, _b)
volatile bool data_available
data ready flag
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
uint16_t output_length
number of data words to write
void mpu60x0_i2c_event(struct Mpu60x0_I2c *mpu)
#define RATES_ADD(_a, _b)
void imu_scale_gyro(struct Imu *_imu)
#define KROOZ_LOWPASS_FILTER
void hmc58xx_start_configure(struct Hmc58xx *hmc)
bool initialized
config done flag
void mpu60x0_i2c_init(struct Mpu60x0_I2c *mpu, struct i2c_periph *i2c_p, uint8_t addr)
void imu_scale_accel(struct Imu *_imu)
struct Mpu60x0Config config
#define IMU_KROOZ_ACCEL_AVG_FILTER
#define KROOZ_ACCEL_RANGE
#define VECT3_COPY(_a, _b)
void imu_krooz_sd_arch_init(void)
#define VECT3_ASSIGN(_a, _x, _y, _z)
#define RATES_ASSIGN(_ra, _p, _q, _r)
struct spi_transaction ad7689_trans
Main include for ABI (AirBorneInterface).
uint8_t smplrt_div
Sample rate divider.
Driver for the IMU on the KroozSD Big Rotorcraft Edition board.
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
struct Int32Rates rates_sum
struct ImuKrooz imu_krooz
enum SPIBitOrder bitorder
MSB/LSB order.
void imu_krooz_periodic(void)
struct Imu imu
global IMU state
enum Mpu60x0GyroRanges gyro_range
deg/s Range
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
enum Mpu60x0AccelRanges accel_range
g Range
bool drdy_int_enable
Enable Data Ready Interrupt.
enum SPISlaveSelect select
slave selection behavior
enum Mpu60x0DLPF dlpf_cfg
Digital Low Pass Filter.
void mpu60x0_i2c_read(struct Mpu60x0_I2c *mpu)
void imu_krooz_init(void)
struct Int32Vect3 mag_unscaled
unscaled magnetometer measurements
enum SPIClockPhase cpha
clock phase control
int32_t r
in rad/s with INT32_RATE_FRAC
volatile uint8_t ad7689_spi_rx_buffer[2]
struct Int32Rates gyro_unscaled
unscaled gyroscope measurements
union Mpu60x0_I2c::@313 data_rates
struct Int32Vect3 accel
accelerometer measurements in m/s^2 in BFP with INT32_ACCEL_FRAC
static uint32_t ad7689_event_timer
void hmc58xx_read(struct Hmc58xx *hmc)
Architecture independent timing functions.
struct Uint8Vect3 meas_nb_acc
SPICallback after_cb
NULL or function called after the transaction.
#define VECT3_SDIV(_vo, _vi, _s)
struct Int32Vect3 mag
magnetometer measurements scaled to 1 in BFP with INT32_MAG_FRAC
uint16_t input_length
number of data words to read
#define INT_VECT3_ZERO(_v)
struct Int32Vect3 accel_sum
#define VECT3_SMUL(_vo, _vi, _s)
void imu_scale_mag(struct Imu *_imu)
slave is selected before transaction and unselected after
void mpu60x0_i2c_start_configure(struct Mpu60x0_I2c *mpu)
enum SPIDataSizeSelect dss
data transfer word size
struct MedianFilter3Int median_mag
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
volatile uint8_t ad7689_spi_tx_buffer[2]
int32_t p
in rad/s with INT32_RATE_FRAC
volatile uint8_t * input_buf
pointer to receive buffer for DMA
arch independent LED (Light Emitting Diodes) API
void hmc58xx_init(struct Hmc58xx *hmc, struct i2c_periph *i2c_p, uint8_t addr)
Initialize Hmc58xx struct and set default config options.
struct Int32Vect3 accel_unscaled
unscaled accelerometer measurements
SPICallback before_cb
NULL or function called before the transaction.
void imu_krooz_event(void)
#define SysTimeTimerStart(_t)
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void hmc58xx_event(struct Hmc58xx *hmc)
int32_t q
in rad/s with INT32_RATE_FRAC
enum SPITransactionStatus status
struct Int32Rates gyro
gyroscope measurements in rad/s in BFP with INT32_RATE_FRAC
volatile bool data_available
data ready flag
Architecture independent I2C (Inter-Integrated Circuit Bus) API.