Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the IMU on the KroozSD Big Rotorcraft Edition board. More...
#include <math.h>
#include "boards/krooz/imu_krooz_memsic.h"
#include "subsystems/imu/imu_krooz_sd_arch.h"
#include "mcu_periph/i2c.h"
#include "led.h"
#include "filters/median_filter.h"
#include "mcu_periph/sys_time.h"
#include "subsystems/abi.h"
Go to the source code of this file.
Macros | |
#define | KROOZ_LOWPASS_FILTER MPU60X0_DLPF_256HZ |
#define | KROOZ_SMPLRT_DIV 1 |
#define | KROOZ_ACCEL_RANGE MPU60X0_ACCEL_RANGE_2G |
Functions | |
void | imu_krooz_init (void) |
void | imu_krooz_periodic (void) |
void | imu_krooz_event (void) |
Variables | |
struct ImuKrooz | imu_krooz |
struct MedianFilter3Int | median_mag |
static uint32_t | ad7689_event_timer |
static uint8_t | axis_cnt |
static uint8_t | axis_nb |
Driver for the IMU on the KroozSD Big Rotorcraft Edition board.
Invensense MPU-6050 Memsic MXR9500 with AD7689 Honeywell HMC-5883
Definition in file imu_krooz_memsic.c.
#define KROOZ_ACCEL_RANGE MPU60X0_ACCEL_RANGE_2G |
Definition at line 51 of file imu_krooz_memsic.c.
Referenced by imu_krooz_init().
#define KROOZ_LOWPASS_FILTER MPU60X0_DLPF_256HZ |
Definition at line 42 of file imu_krooz_memsic.c.
Referenced by imu_krooz_init().
#define KROOZ_SMPLRT_DIV 1 |
Definition at line 43 of file imu_krooz_memsic.c.
Referenced by imu_krooz_init().
void imu_krooz_event | ( | void | ) |
Definition at line 158 of file imu_krooz_memsic.c.
References ImuKrooz::accel_sum, ImuKrooz::ad7689_trans, Hmc58xx::data, Mpu60x0_I2c::data_accel, Mpu60x0_I2c::data_available, Hmc58xx::data_available, Mpu60x0_I2c::data_rates, get_sys_time_usec(), ImuKrooz::hmc, hmc58xx_event(), hmc58xx_read(), ImuKrooz::hmc_eoc, imu, IMU_BOARD_ID, imu_scale_mag(), spi_transaction::input_buf, Imu::mag, Imu::mag_unscaled, ImuKrooz::meas_nb, ImuKrooz::meas_nb_acc, median_mag, ImuKrooz::mpu, mpu60x0_i2c_event(), mpu60x0_i2c_read(), ImuKrooz::mpu_eoc, spi_transaction::output_buf, RATES_ADD, ImuKrooz::rates_sum, spi_submit(), SPITransDone, SPITransSuccess, spi_transaction::status, SysTimeTimer, SysTimeTimerStart, ImuKrooz::temperature, UpdateMedianFilterVect3Int, VECT3_ADD, VECT3_ASSIGN, Uint8Vect3::x, Int32Vect3::x, Uint8Vect3::y, Int32Vect3::y, Uint8Vect3::z, and Int32Vect3::z.
void imu_krooz_init | ( | void | ) |
Definition at line 66 of file imu_krooz_memsic.c.
References Mpu60x0Config::accel_range, ImuKrooz::accel_sum, ImuKrooz::ad7689_spi_rx_buffer, ImuKrooz::ad7689_spi_tx_buffer, ImuKrooz::ad7689_trans, spi_transaction::after_cb, spi_transaction::before_cb, spi_transaction::bitorder, spi_transaction::cdiv, Mpu60x0_I2c::config, spi_transaction::cpha, spi_transaction::cpol, Mpu60x0Config::dlpf_cfg, Mpu60x0Config::drdy_int_enable, spi_transaction::dss, Mpu60x0Config::gyro_range, ImuKrooz::hmc, HMC58XX_ADDR, hmc58xx_init(), ImuKrooz::hmc_eoc, imu_krooz_sd_arch_init(), InitMedianFilterVect3Int, spi_transaction::input_buf, spi_transaction::input_length, KROOZ_ACCEL_RANGE, KROOZ_GYRO_RANGE, KROOZ_LOWPASS_FILTER, KROOZ_SMPLRT_DIV, ImuKrooz::meas_nb, MEDIAN_DEFAULT_SIZE, median_mag, ImuKrooz::mpu, MPU60X0_ADDR, mpu60x0_i2c_init(), ImuKrooz::mpu_eoc, spi_transaction::output_buf, spi_transaction::output_length, RATES_ASSIGN, ImuKrooz::rates_sum, spi_transaction::select, spi_transaction::slave_idx, Mpu60x0Config::smplrt_div, SPICphaEdge1, SPICpolIdleLow, SPIDiv16, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, and VECT3_ASSIGN.
void imu_krooz_periodic | ( | void | ) |
Definition at line 112 of file imu_krooz_memsic.c.
References Imu::accel, ImuKrooz::accel_filtered, ImuKrooz::accel_sum, Imu::accel_unscaled, Mpu60x0_I2c::config, get_sys_time_usec(), Imu::gyro, Imu::gyro_unscaled, ImuKrooz::hmc, hmc58xx_start_configure(), imu, IMU_BOARD_ID, IMU_KROOZ_ACCEL_AVG_FILTER, imu_scale_accel(), imu_scale_gyro(), Hmc58xx::initialized, Mpu60x0Config::initialized, INT_VECT3_ZERO, ImuKrooz::meas_nb, ImuKrooz::meas_nb_acc, ImuKrooz::mpu, mpu60x0_i2c_start_configure(), Int32Rates::p, Int32Rates::q, Int32Rates::r, RATES_ASSIGN, ImuKrooz::rates_sum, UpdateMedianFilterVect3Int, VECT3_ADD, VECT3_ASSIGN, VECT3_COPY, VECT3_SDIV, VECT3_SMUL, Uint8Vect3::x, Int32Vect3::x, Uint8Vect3::y, Int32Vect3::y, Uint8Vect3::z, and Int32Vect3::z.
|
static |
Definition at line 62 of file imu_krooz_memsic.c.
|
static |
Definition at line 63 of file imu_krooz_memsic.c.
|
static |
Definition at line 64 of file imu_krooz_memsic.c.
struct ImuKrooz imu_krooz |
Definition at line 55 of file imu_krooz_memsic.c.
struct MedianFilter3Int median_mag |
Definition at line 60 of file imu_krooz_memsic.c.
Referenced by imu_krooz_event(), and imu_krooz_init().