PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <lib/conversion/rotation.h>
#include <lib/drivers/accelerometer/PX4Accelerometer.hpp>
#include <lib/drivers/gyroscope/PX4Gyroscope.hpp>
#include <lib/drivers/device/i2c.h>
#include <lib/drivers/device/spi.h>
#include <lib/ecl/geo/geo.h>
#include <lib/perf/perf_counter.h>
#include <px4_platform_common/getopt.h>
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
#include <systemlib/conversions.h>
#include <systemlib/px4_macros.h>
Go to the source code of this file.
Classes | |
struct | MPUReport |
Report conversation within the mpu, including command byte and interrupt status. More... | |
class | MPU6000 |
Typedefs | |
typedef device::Device *(* | MPU6000_constructor) (int, int, bool) |
Enumerations | |
enum | MPU_DEVICE_TYPE { MPU_DEVICE_TYPE_MPU6000 = 6000, MPU_DEVICE_TYPE_ICM20602 = 20602, MPU_DEVICE_TYPE_ICM20608 = 20608, MPU_DEVICE_TYPE_ICM20689 = 20689 } |
enum | MPU6000_BUS { MPU6000_BUS_ALL = 0, MPU6000_BUS_I2C_INTERNAL, MPU6000_BUS_I2C_EXTERNAL, MPU6000_BUS_SPI_INTERNAL1, MPU6000_BUS_SPI_INTERNAL2, MPU6000_BUS_SPI_EXTERNAL1, MPU6000_BUS_SPI_EXTERNAL2 } |
Functions | |
device::Device * | MPU6000_SPI_interface (int bus, int device_type, bool external_bus) |
device::Device * | MPU6000_I2C_interface (int bus, int device_type, bool external_bus) |
int | MPU6000_probe (device::Device *dev, int device_type) |
#define BIT_H_RESET 0x80 |
Definition at line 148 of file MPU6000.hpp.
#define BIT_I2C_IF_DIS 0x10 |
Definition at line 163 of file MPU6000.hpp.
#define BIT_INT_ANYRD_2CLEAR 0x10 |
Definition at line 161 of file MPU6000.hpp.
#define BIT_INT_STATUS_DATA 0x01 |
Definition at line 164 of file MPU6000.hpp.
#define BIT_RAW_RDY_EN 0x01 |
Definition at line 162 of file MPU6000.hpp.
#define BIT_SLEEP 0x40 |
Definition at line 147 of file MPU6000.hpp.
#define BITS_CLKSEL 0x07 |
Definition at line 149 of file MPU6000.hpp.
#define BITS_FS_1000DPS 0x10 |
Definition at line 158 of file MPU6000.hpp.
#define BITS_FS_2000DPS 0x18 |
Definition at line 159 of file MPU6000.hpp.
#define BITS_FS_250DPS 0x00 |
Definition at line 156 of file MPU6000.hpp.
#define BITS_FS_500DPS 0x08 |
Definition at line 157 of file MPU6000.hpp.
#define BITS_FS_MASK 0x18 |
Definition at line 160 of file MPU6000.hpp.
#define BITS_GYRO_ST_X 0x80 |
Definition at line 153 of file MPU6000.hpp.
#define BITS_GYRO_ST_Y 0x40 |
Definition at line 154 of file MPU6000.hpp.
#define BITS_GYRO_ST_Z 0x20 |
Definition at line 155 of file MPU6000.hpp.
#define DIR_READ 0x80 |
Definition at line 98 of file MPU6000.hpp.
#define DIR_WRITE 0x00 |
Definition at line 99 of file MPU6000.hpp.
#define ICM20602_REV_01 1 |
Definition at line 192 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define ICM20602_REV_02 2 |
Definition at line 193 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define ICM20608_REV_FF 0xff |
Definition at line 197 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define ICM20689_REV_03 0x03 |
Definition at line 202 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define ICM20689_REV_04 0x04 |
Definition at line 203 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define ICM20689_REV_FE 0xfe |
Definition at line 201 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define ICM_ACC_DLPF_CFG_1046HZ_NOLPF 0x00 |
Definition at line 174 of file MPU6000.hpp.
Referenced by MPU6000::_set_icm_acc_dlpf_filter().
#define ICM_ACC_DLPF_CFG_10HZ 0x05 |
Definition at line 179 of file MPU6000.hpp.
Referenced by MPU6000::_set_icm_acc_dlpf_filter().
#define ICM_ACC_DLPF_CFG_218HZ 0x01 |
Definition at line 175 of file MPU6000.hpp.
Referenced by MPU6000::_set_icm_acc_dlpf_filter().
#define ICM_ACC_DLPF_CFG_21HZ 0x04 |
Definition at line 178 of file MPU6000.hpp.
Referenced by MPU6000::_set_icm_acc_dlpf_filter().
#define ICM_ACC_DLPF_CFG_420HZ 0x07 |
Definition at line 181 of file MPU6000.hpp.
Referenced by MPU6000::_set_icm_acc_dlpf_filter().
#define ICM_ACC_DLPF_CFG_44HZ 0x03 |
Definition at line 177 of file MPU6000.hpp.
Referenced by MPU6000::_set_icm_acc_dlpf_filter().
#define ICM_ACC_DLPF_CFG_5HZ 0x06 |
Definition at line 180 of file MPU6000.hpp.
Referenced by MPU6000::_set_icm_acc_dlpf_filter().
#define ICM_ACC_DLPF_CFG_99HZ 0x02 |
Definition at line 176 of file MPU6000.hpp.
Referenced by MPU6000::_set_icm_acc_dlpf_filter().
#define ICM_WHOAMI_20602 0x12 |
Definition at line 167 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define ICM_WHOAMI_20608 0xaf |
Definition at line 168 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define ICM_WHOAMI_20689 0x98 |
Definition at line 169 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define ICMREG_ACCEL_CONFIG2 0x1D |
Definition at line 173 of file MPU6000.hpp.
Referenced by MPU6000::_set_icm_acc_dlpf_filter().
#define MPU6000_ACCEL_DEFAULT_RANGE_G 16 |
Definition at line 222 of file MPU6000.hpp.
Referenced by MPU6000::reset().
#define MPU6000_DEFAULT_ONCHIP_FILTER_FREQ 98 |
Definition at line 228 of file MPU6000.hpp.
Referenced by MPU6000::reset().
#define MPU6000_GYRO_DEFAULT_RANGE_G 8 |
Definition at line 224 of file MPU6000.hpp.
#define MPU6000_GYRO_DEFAULT_RATE 1000 |
Definition at line 225 of file MPU6000.hpp.
Referenced by MPU6000::_set_sample_rate().
#define MPU6000_HIGH_BUS_SPEED 0x8000 |
Definition at line 258 of file MPU6000.hpp.
Referenced by MPU6000::check_registers(), MPU6000::factory_self_test(), and MPU6000::measure().
#define MPU6000_HIGH_SPEED_OP | ( | r | ) | MPU6000_SET_SPEED((r), MPU6000_HIGH_BUS_SPEED) |
Definition at line 262 of file MPU6000.hpp.
#define MPU6000_IS_HIGH_SPEED | ( | r | ) | ((r) & MPU6000_HIGH_BUS_SPEED) |
Definition at line 259 of file MPU6000.hpp.
#define MPU6000_LOW_BUS_SPEED 0 |
Definition at line 257 of file MPU6000.hpp.
Referenced by MPU6000::is_mpu_device(), and MPU6000::test_error().
#define MPU6000_LOW_SPEED_OP | ( | r | ) | MPU6000_REG((r)) |
Definition at line 263 of file MPU6000.hpp.
Referenced by MPU6000::read_reg16(), and MPU6000::write_reg().
#define MPU6000_REG | ( | r | ) | ((r) &~MPU6000_HIGH_BUS_SPEED) |
Definition at line 260 of file MPU6000.hpp.
#define MPU6000_REV_C4 0x54 |
Definition at line 213 of file MPU6000.hpp.
Referenced by MPU6000::probe(), and MPU6000::set_accel_range().
#define MPU6000_REV_C5 0x55 |
Definition at line 214 of file MPU6000.hpp.
Referenced by MPU6000::probe(), and MPU6000::set_accel_range().
#define MPU6000_REV_D10 0x5A |
Definition at line 219 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPU6000_REV_D6 0x56 |
Definition at line 215 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPU6000_REV_D7 0x57 |
Definition at line 216 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPU6000_REV_D8 0x58 |
Definition at line 217 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPU6000_REV_D9 0x59 |
Definition at line 218 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPU6000_SET_SPEED | ( | r, | |
s | |||
) | ((r)|(s)) |
Definition at line 261 of file MPU6000.hpp.
Referenced by MPU6000::factory_self_test(), MPU6000::measure(), MPU6000::read_reg(), and MPU6000::test_error().
#define MPU6000_TIMER_REDUCTION 200 |
Definition at line 273 of file MPU6000.hpp.
Referenced by MPU6000::start().
#define MPU6000ES_REV_C4 0x14 |
Definition at line 208 of file MPU6000.hpp.
Referenced by MPU6000::probe(), and MPU6000::set_accel_range().
#define MPU6000ES_REV_C5 0x15 |
Definition at line 209 of file MPU6000.hpp.
Referenced by MPU6000::probe(), and MPU6000::set_accel_range().
#define MPU6000ES_REV_D6 0x16 |
Definition at line 210 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPU6000ES_REV_D7 0x17 |
Definition at line 211 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPU6000ES_REV_D8 0x18 |
Definition at line 212 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPU6050_REV_D8 0x28 |
Definition at line 220 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPU_CLK_SEL_PLLGYROX 0x01 |
Definition at line 150 of file MPU6000.hpp.
#define MPU_CLK_SEL_PLLGYROZ 0x03 |
Definition at line 151 of file MPU6000.hpp.
Referenced by MPU6000::reset().
#define MPU_DLPF_CFG_MASK 0x07 |
Definition at line 144 of file MPU6000.hpp.
#define MPU_EXT_SYNC_GYROX 0x02 |
Definition at line 152 of file MPU6000.hpp.
#define MPU_GYRO_DLPF_CFG_10HZ 0x05 |
Definition at line 141 of file MPU6000.hpp.
Referenced by MPU6000::_set_dlpf_filter().
#define MPU_GYRO_DLPF_CFG_188HZ 0x01 |
Definition at line 137 of file MPU6000.hpp.
Referenced by MPU6000::_set_dlpf_filter().
#define MPU_GYRO_DLPF_CFG_20HZ 0x04 |
Definition at line 140 of file MPU6000.hpp.
Referenced by MPU6000::_set_dlpf_filter().
#define MPU_GYRO_DLPF_CFG_2100HZ_NOLPF 0x07 |
Definition at line 143 of file MPU6000.hpp.
Referenced by MPU6000::_set_dlpf_filter().
#define MPU_GYRO_DLPF_CFG_256HZ_NOLPF2 0x00 |
Definition at line 136 of file MPU6000.hpp.
Referenced by MPU6000::_set_dlpf_filter().
#define MPU_GYRO_DLPF_CFG_42HZ 0x03 |
Definition at line 139 of file MPU6000.hpp.
Referenced by MPU6000::_set_dlpf_filter().
#define MPU_GYRO_DLPF_CFG_5HZ 0x06 |
Definition at line 142 of file MPU6000.hpp.
Referenced by MPU6000::_set_dlpf_filter().
#define MPU_GYRO_DLPF_CFG_98HZ 0x02 |
Definition at line 138 of file MPU6000.hpp.
Referenced by MPU6000::_set_dlpf_filter().
#define MPU_MAX_READ_BUFFER_SIZE (sizeof(MPUReport) + 1) |
Definition at line 248 of file MPU6000.hpp.
#define MPU_MAX_WRITE_BUFFER_SIZE (2) |
Definition at line 249 of file MPU6000.hpp.
#define MPU_WHOAMI_6000 0x68 |
Definition at line 166 of file MPU6000.hpp.
Referenced by MPU6000::probe().
#define MPUREG_ACCEL_CONFIG 0x1C |
Definition at line 106 of file MPU6000.hpp.
#define MPUREG_ACCEL_XOUT_H 0x3B |
Definition at line 111 of file MPU6000.hpp.
#define MPUREG_ACCEL_XOUT_L 0x3C |
Definition at line 112 of file MPU6000.hpp.
#define MPUREG_ACCEL_YOUT_H 0x3D |
Definition at line 113 of file MPU6000.hpp.
#define MPUREG_ACCEL_YOUT_L 0x3E |
Definition at line 114 of file MPU6000.hpp.
#define MPUREG_ACCEL_ZOUT_H 0x3F |
Definition at line 115 of file MPU6000.hpp.
#define MPUREG_ACCEL_ZOUT_L 0x40 |
Definition at line 116 of file MPU6000.hpp.
#define MPUREG_CONFIG 0x1A |
Definition at line 104 of file MPU6000.hpp.
#define MPUREG_FIFO_COUNTH 0x72 |
Definition at line 128 of file MPU6000.hpp.
#define MPUREG_FIFO_COUNTL 0x73 |
Definition at line 129 of file MPU6000.hpp.
#define MPUREG_FIFO_EN 0x23 |
Definition at line 107 of file MPU6000.hpp.
#define MPUREG_FIFO_R_W 0x74 |
Definition at line 130 of file MPU6000.hpp.
#define MPUREG_GYRO_CONFIG 0x1B |
Definition at line 105 of file MPU6000.hpp.
#define MPUREG_GYRO_XOUT_H 0x43 |
Definition at line 119 of file MPU6000.hpp.
#define MPUREG_GYRO_XOUT_L 0x44 |
Definition at line 120 of file MPU6000.hpp.
#define MPUREG_GYRO_YOUT_H 0x45 |
Definition at line 121 of file MPU6000.hpp.
#define MPUREG_GYRO_YOUT_L 0x46 |
Definition at line 122 of file MPU6000.hpp.
#define MPUREG_GYRO_ZOUT_H 0x47 |
Definition at line 123 of file MPU6000.hpp.
#define MPUREG_GYRO_ZOUT_L 0x48 |
Definition at line 124 of file MPU6000.hpp.
#define MPUREG_ICM_UNDOC1 0x11 |
Definition at line 186 of file MPU6000.hpp.
Referenced by MPU6000::check_registers(), and MPU6000::reset().
#define MPUREG_ICM_UNDOC1_VALUE 0xc9 |
Definition at line 187 of file MPU6000.hpp.
Referenced by MPU6000::reset().
#define MPUREG_INT_ENABLE 0x38 |
Definition at line 109 of file MPU6000.hpp.
#define MPUREG_INT_PIN_CFG 0x37 |
Definition at line 108 of file MPU6000.hpp.
#define MPUREG_INT_STATUS 0x3A |
Definition at line 110 of file MPU6000.hpp.
#define MPUREG_PRODUCT_ID 0x0C |
Definition at line 131 of file MPU6000.hpp.
Referenced by MPU6000::print_registers(), and MPU6000::probe().
#define MPUREG_PWR_MGMT_1 0x6B |
Definition at line 126 of file MPU6000.hpp.
#define MPUREG_PWR_MGMT_2 0x6C |
Definition at line 127 of file MPU6000.hpp.
#define MPUREG_SMPLRT_DIV 0x19 |
Definition at line 103 of file MPU6000.hpp.
#define MPUREG_TEMP_OUT_H 0x41 |
Definition at line 117 of file MPU6000.hpp.
#define MPUREG_TEMP_OUT_L 0x42 |
Definition at line 118 of file MPU6000.hpp.
#define MPUREG_TRIM1 0x0D |
Definition at line 132 of file MPU6000.hpp.
Referenced by MPU6000::factory_self_test().
#define MPUREG_TRIM2 0x0E |
Definition at line 133 of file MPU6000.hpp.
Referenced by MPU6000::factory_self_test().
#define MPUREG_TRIM3 0x0F |
Definition at line 134 of file MPU6000.hpp.
Referenced by MPU6000::factory_self_test().
#define MPUREG_TRIM4 0x10 |
Definition at line 135 of file MPU6000.hpp.
Referenced by MPU6000::factory_self_test().
#define MPUREG_USER_CTRL 0x6A |
Definition at line 125 of file MPU6000.hpp.
#define MPUREG_WHOAMI 0x75 |
Definition at line 102 of file MPU6000.hpp.
typedef device::Device*(* MPU6000_constructor) (int, int, bool) |
Definition at line 270 of file MPU6000.hpp.
enum MPU6000_BUS |
Enumerator | |
---|---|
MPU6000_BUS_ALL | |
MPU6000_BUS_I2C_INTERNAL | |
MPU6000_BUS_I2C_EXTERNAL | |
MPU6000_BUS_SPI_INTERNAL1 | |
MPU6000_BUS_SPI_INTERNAL2 | |
MPU6000_BUS_SPI_EXTERNAL1 | |
MPU6000_BUS_SPI_EXTERNAL2 |
Definition at line 275 of file MPU6000.hpp.
enum MPU_DEVICE_TYPE |
Enumerator | |
---|---|
MPU_DEVICE_TYPE_MPU6000 | |
MPU_DEVICE_TYPE_ICM20602 | |
MPU_DEVICE_TYPE_ICM20608 | |
MPU_DEVICE_TYPE_ICM20689 |
Definition at line 91 of file MPU6000.hpp.
device::Device* MPU6000_I2C_interface | ( | int | bus, |
int | device_type, | ||
bool | external_bus | ||
) |
int MPU6000_probe | ( | device::Device * | dev, |
int | device_type | ||
) |
device::Device* MPU6000_SPI_interface | ( | int | bus, |
int | device_type, | ||
bool | external_bus | ||
) |