APM:Libraries
|
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/I2CDevice.h>
#include <AP_Baro/AP_Baro.h>
#include <AP_BoardConfig/AP_BoardConfig.h>
#include <utility>
#include <stdio.h>
Go to the source code of this file.
Macros | |
#define | MPUREG_WHOAMI 0x75 |
#define | MPUREG_USER_CTRL 0x6A |
#define | MPUREG_PWR_MGMT_1 0x6B |
#define | MPUREG_INT_PIN_CFG 0x37 |
#define | BIT_BYPASS_EN 0x02 |
#define | BIT_INT_RD_CLEAR 0x10 |
#define | BIT_LATCH_INT_EN 0x20 |
#define | BIT_USER_CTRL_I2C_MST_EN 0x20 |
#define | BIT_PWR_MGMT_1_DEVICE_RESET 0x80 |
#define | BIT_USER_CTRL_I2C_IF_DIS 0x10 |
#define | BIT_PWR_MGMT_1_CLK_XGYRO 0x01 |
#define | BIT_PWR_MGMT_1_CLK_ZGYRO 0x03 |
#define | CMD_SOFT_RESET 0x805D |
#define | CMD_READ_ID 0xEFC8 |
Functions | |
void | setup (void) |
void | loop (void) |
static bool | send_cmd16 (uint16_t cmd) |
static bool | read_calibration_data (void) |
AP_HAL_MAIN () | |
Variables | |
const AP_HAL::HAL & | hal = AP_HAL::get_HAL() |
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- More... | |
static AP_HAL::OwnPtr< AP_HAL::Device > | i2c_dev |
static AP_HAL::OwnPtr< AP_HAL::Device > | spi_dev |
static AP_HAL::OwnPtr< AP_HAL::Device > | dev |
#define BIT_BYPASS_EN 0x02 |
Definition at line 24 of file ICM20789.cpp.
Referenced by AP_InertialSensor_Invensense::_hardware_init(), AP_Baro_LPS2XH::_imu_i2c_init(), AP_Baro_ICM20789::imu_i2c_init(), and AP_InertialSensor_Invensense::start().
#define BIT_INT_RD_CLEAR 0x10 |
Definition at line 25 of file ICM20789.cpp.
Referenced by AP_InertialSensor_Invensense::start().
#define BIT_LATCH_INT_EN 0x20 |
Definition at line 26 of file ICM20789.cpp.
Referenced by AP_InertialSensor_Invensense::start().
#define BIT_PWR_MGMT_1_CLK_XGYRO 0x01 |
Definition at line 31 of file ICM20789.cpp.
Referenced by AP_Baro_LPS2XH::_imu_i2c_init(), AP_Baro_ICM20789::imu_i2c_init(), and AP_Baro_ICM20789::imu_spi_init().
#define BIT_PWR_MGMT_1_CLK_ZGYRO 0x03 |
Definition at line 32 of file ICM20789.cpp.
Referenced by AP_InertialSensor_Invensense::_hardware_init().
#define BIT_PWR_MGMT_1_DEVICE_RESET 0x80 |
Definition at line 29 of file ICM20789.cpp.
Referenced by AP_InertialSensor_Invensense::_hardware_init().
#define BIT_USER_CTRL_I2C_IF_DIS 0x10 |
Definition at line 30 of file ICM20789.cpp.
Referenced by AP_InertialSensor_Invensense::_hardware_init(), and AP_Baro_ICM20789::imu_spi_init().
#define BIT_USER_CTRL_I2C_MST_EN 0x20 |
Definition at line 28 of file ICM20789.cpp.
Referenced by AP_Invensense_AuxiliaryBus::_configure_slaves(), and AP_InertialSensor_Invensense::_hardware_init().
#define CMD_READ_ID 0xEFC8 |
Definition at line 36 of file ICM20789.cpp.
Referenced by read_calibration_data().
#define CMD_SOFT_RESET 0x805D |
Definition at line 35 of file ICM20789.cpp.
Referenced by read_calibration_data().
#define MPUREG_INT_PIN_CFG 0x37 |
Definition at line 23 of file ICM20789.cpp.
Referenced by AP_InertialSensor_Invensense::_hardware_init(), AP_Baro_LPS2XH::_imu_i2c_init(), AP_Baro_ICM20789::imu_i2c_init(), AP_Baro_ICM20789::imu_spi_init(), and AP_InertialSensor_Invensense::start().
#define MPUREG_PWR_MGMT_1 0x6B |
Definition at line 21 of file ICM20789.cpp.
Referenced by AP_InertialSensor_Invensense::_hardware_init(), AP_Baro_LPS2XH::_imu_i2c_init(), AP_Baro_ICM20789::imu_i2c_init(), and AP_Baro_ICM20789::imu_spi_init().
#define MPUREG_USER_CTRL 0x6A |
Definition at line 20 of file ICM20789.cpp.
Referenced by AP_Invensense_AuxiliaryBus::_configure_slaves(), AP_InertialSensor_Invensense::_fifo_reset(), AP_InertialSensor_Invensense::_hardware_init(), and AP_Baro_ICM20789::imu_spi_init().
#define MPUREG_WHOAMI 0x75 |
Definition at line 19 of file ICM20789.cpp.
Referenced by AP_InertialSensor_Invensense::_check_whoami(), AP_Baro_LPS2XH::_imu_i2c_init(), AP_Baro_ICM20789::imu_i2c_init(), and AP_Baro_ICM20789::imu_spi_init().
AP_HAL_MAIN | ( | ) |
void loop | ( | void | ) |
|
static |
|
static |
Definition at line 190 of file ICM20789.cpp.
Referenced by read_calibration_data().
void setup | ( | void | ) |
|
static |
Definition at line 16 of file ICM20789.cpp.
Referenced by Linux::SPIDeviceManager::_create_device(), Linux::I2CDeviceManager::_create_device(), F4Light::SPIDevice::_cs_release(), F4Light::GPIO::_pinMode(), F4Light::AnalogIn::_timer_event(), adc_init(), dispatch_handler(), dma_attach_interrupt(), dma_clear_isr_bits(), dma_detach_interrupt(), dma_disable(), dma_enable(), dma_get_isr_bits(), dma_init(), dma_init_transfer(), dma_is_stream_enabled(), dma_set_num_transfers(), F4Light::RCOutput::enable_ch(), PX4::I2CDevice::from(), VRBRAIN::I2CDevice::from(), Linux::I2CDevice::from(), AP_InertialSensor_Invensense::from(), ChibiOS::I2CDevice::from(), AP_InertialSensor_Revo::from(), get_device(), PX4::I2CDeviceManager::get_device(), VRBRAIN::I2CDeviceManager::get_device(), Linux::SPIDeviceManager::get_device(), Linux::I2CDeviceManager::get_device(), ChibiOS::I2CDeviceManager::get_device(), F4Light::RCOutput::get_freq(), GCS_MAVLINK::handle_device_op_read(), GCS_MAVLINK::handle_device_op_write(), F4Light::I2CDevice::init(), F4Light::RCOutput::init_channel(), loop(), pwmInitializeInput(), F4Light::RCOutput::set_freq(), F4Light::AnalogSource::set_pin(), F4Light::RCOutput::set_pwm(), F4Light::AnalogSource::setup_read(), AP_BoardConfig::spi_check_register(), spi_peripheral_disable(), F4Light::AnalogSource::stop_read(), usart_disable_all(), F4Light::GPIO::write(), and AP_InertialSensor_LSM9DS1::~AP_InertialSensor_LSM9DS1().
const AP_HAL::HAL& hal = AP_HAL::get_HAL() |
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
The strategy for roll/pitch autotune is to give the user a AUTOTUNE flight mode which behaves just like FBWA, but does automatic tuning.
While the user is flying in AUTOTUNE the gains are saved every 10 seconds, but the saved gains are not the current gains, instead it saves the gains from 10s ago. When the user exits AUTOTUNE the gains are restored from 10s ago.
This allows the user to fly as much as they want in AUTOTUNE mode, and if they are ever unhappy they just exit the mode. If they stay in AUTOTUNE for more than 10s then their gains will have changed.
Using this approach users don't need any special switches, they just need to be able to enter and exit AUTOTUNE mode
Definition at line 12 of file ICM20789.cpp.
|
static |
Definition at line 14 of file ICM20789.cpp.
|
static |
Definition at line 15 of file ICM20789.cpp.