M5Unified
|
#include <MPU6886_Class.hpp>
Public Types | |
enum | Ascale { AFS_2G = 0 , AFS_4G , AFS_8G , AFS_16G } |
enum | Gscale { GFS_250DPS = 0 , GFS_500DPS , GFS_1000DPS , GFS_2000DPS } |
enum | Fodr { ODR_1kHz = 0 , ODR_500Hz = 1 , ODR_250Hz = 3 , ODR_200Hz = 4 , ODR_125Hz = 7 , ODR_100Hz = 9 , ODR_50Hz = 19 , ODR_10Hz = 99 } |
![]() | |
enum | imu_spec_t { imu_spec_none = 0 , imu_spec_accel = 0b0001 , imu_spec_gyro = 0b0010 , imu_spec_mag = 0b0100 } |
Public Member Functions | |
virtual | ~MPU6886_Class () |
MPU6886_Class (std::uint8_t i2c_addr=DEFAULT_ADDRESS, std::uint32_t freq=400000, I2C_Class *i2c=&In_I2C) | |
imu_spec_t | begin (I2C_Class *i2c=nullptr) override |
imu_spec_t | getImuRawData (imu_raw_data_t *data) const override |
void | getConvertParam (imu_convert_param_t *param) const |
bool | getTempAdc (int16_t *adc) const override |
void | enableFIFO (Fodr output_data_rate) |
bool | setGyroAdcOffset (std::int16_t gx, std::int16_t gy, std::int16_t gz) |
bool | setINTPinActiveLogic (bool level) override |
std::uint8_t | whoAmI (void) const |
![]() | |
virtual | ~IMU_Base () |
IMU_Base (std::uint8_t i2c_addr, std::uint32_t freq=400000, I2C_Class *i2c=&In_I2C) | |
![]() | |
I2C_Device (std::uint8_t i2c_addr, std::uint32_t freq, I2C_Class *i2c=&In_I2C) | |
void | setPort (I2C_Class *i2c) |
bool | writeRegister8 (std::uint8_t reg, std::uint8_t data) const |
std::uint8_t | readRegister8 (std::uint8_t reg) const |
bool | writeRegister8Array (const std::uint8_t *reg_data_array, std::size_t length) const |
bool | writeRegister (std::uint8_t reg, const std::uint8_t *data, std::size_t length) const |
bool | readRegister (std::uint8_t reg, std::uint8_t *result, std::size_t length) const |
bool | bitOn (std::uint8_t reg, std::uint8_t bit) const |
bool | bitOff (std::uint8_t reg, std::uint8_t bit) const |
bool | isEnabled (void) const |
Static Public Attributes | |
static constexpr const std::uint8_t | DEV_ID_MPU6886 = 0x19 |
static constexpr const std::uint8_t | DEV_ID_MPU6050 = 0x68 |
static constexpr const std::uint8_t | DEV_ID_MPU9250 = 0x71 |
static constexpr const std::uint8_t | REG_WHOAMI = 0x75 |
static constexpr const std::uint8_t | REG_ACCEL_INTEL_CTRL = 0x69 |
static constexpr const std::uint8_t | REG_SMPLRT_DIV = 0x19 |
static constexpr const std::uint8_t | REG_INT_PIN_CFG = 0x37 |
static constexpr const std::uint8_t | REG_INT_ENABLE = 0x38 |
static constexpr const std::uint8_t | REG_ACCEL_XOUT_H = 0x3B |
static constexpr const std::uint8_t | REG_ACCEL_XOUT_L = 0x3C |
static constexpr const std::uint8_t | REG_ACCEL_YOUT_H = 0x3D |
static constexpr const std::uint8_t | REG_ACCEL_YOUT_L = 0x3E |
static constexpr const std::uint8_t | REG_ACCEL_ZOUT_H = 0x3F |
static constexpr const std::uint8_t | REG_ACCEL_ZOUT_L = 0x40 |
static constexpr const std::uint8_t | REG_TEMP_OUT_H = 0x41 |
static constexpr const std::uint8_t | REG_TEMP_OUT_L = 0x42 |
static constexpr const std::uint8_t | REG_GYRO_XOUT_H = 0x43 |
static constexpr const std::uint8_t | REG_GYRO_XOUT_L = 0x44 |
static constexpr const std::uint8_t | REG_GYRO_YOUT_H = 0x45 |
static constexpr const std::uint8_t | REG_GYRO_YOUT_L = 0x46 |
static constexpr const std::uint8_t | REG_GYRO_ZOUT_H = 0x47 |
static constexpr const std::uint8_t | REG_GYRO_ZOUT_L = 0x48 |
static constexpr const std::uint8_t | REG_USER_CTRL = 0x6A |
static constexpr const std::uint8_t | REG_PWR_MGMT_1 = 0x6B |
static constexpr const std::uint8_t | REG_PWR_MGMT_2 = 0x6C |
static constexpr const std::uint8_t | REG_CONFIG = 0x1A |
static constexpr const std::uint8_t | REG_GYRO_CONFIG = 0x1B |
static constexpr const std::uint8_t | REG_ACCEL_CONFIG = 0x1C |
static constexpr const std::uint8_t | REG_ACCEL_CONFIG2 = 0x1D |
static constexpr const std::uint8_t | REG_LP_MODE_CFG = 0x1E |
static constexpr const std::uint8_t | REG_FIFO_EN = 0x23 |
static constexpr const std::uint8_t | REG_FIFO_COUNTH = 0x72 |
static constexpr const std::uint8_t | REG_FIFO_R_W = 0x74 |
static constexpr std::uint8_t | DEFAULT_ADDRESS = 0x68 |
Protected Member Functions | |
void | setGyroFsr (Gscale scale) |
void | setAccelFsr (Ascale scale) |
Protected Attributes | |
bool | _fifo_en |
float | _aRes |
float | _gRes |
Gscale | _gscale |
Ascale | _ascale |
std::uint8_t | _device_id = 0 |
![]() | |
I2C_Class * | _i2c |
std::uint32_t | _freq |
std::uint8_t | _addr |
bool | _init |
Definition at line 11 of file MPU6886_Class.hpp.
Enumerator | |
---|---|
AFS_2G | |
AFS_4G | |
AFS_8G | |
AFS_16G |
Definition at line 53 of file MPU6886_Class.hpp.
Enumerator | |
---|---|
ODR_1kHz | |
ODR_500Hz | |
ODR_250Hz | |
ODR_200Hz | |
ODR_125Hz | |
ODR_100Hz | |
ODR_50Hz | |
ODR_10Hz |
Definition at line 67 of file MPU6886_Class.hpp.
Enumerator | |
---|---|
GFS_250DPS | |
GFS_500DPS | |
GFS_1000DPS | |
GFS_2000DPS |
Definition at line 60 of file MPU6886_Class.hpp.
|
virtual |
m5::MPU6886_Class::MPU6886_Class | ( | std::uint8_t | i2c_addr = DEFAULT_ADDRESS , |
std::uint32_t | freq = 400000 , |
||
I2C_Class * | i2c = &In_I2C |
||
) |
|
overridevirtual |
Implements m5::IMU_Base.
void m5::MPU6886_Class::enableFIFO | ( | Fodr | output_data_rate | ) |
|
virtual |
Implements m5::IMU_Base.
|
overridevirtual |
Implements m5::IMU_Base.
|
overridevirtual |
Reimplemented from m5::IMU_Base.
|
protected |
bool m5::MPU6886_Class::setGyroAdcOffset | ( | std::int16_t | gx, |
std::int16_t | gy, | ||
std::int16_t | gz | ||
) |
|
protected |
|
overridevirtual |
Reimplemented from m5::IMU_Base.
|
inline |
Definition at line 104 of file MPU6886_Class.hpp.
|
protected |
Definition at line 111 of file MPU6886_Class.hpp.
|
protected |
Definition at line 113 of file MPU6886_Class.hpp.
|
protected |
Definition at line 114 of file MPU6886_Class.hpp.
|
protected |
Definition at line 110 of file MPU6886_Class.hpp.
|
protected |
Definition at line 111 of file MPU6886_Class.hpp.
|
protected |
Definition at line 112 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 82 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 15 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 14 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 16 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 45 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 46 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 19 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 23 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 24 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 25 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 26 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 27 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 28 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 43 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 50 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 48 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 51 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 44 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 33 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 34 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 35 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 36 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 37 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 38 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 22 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 21 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 47 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 41 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 42 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 20 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 30 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 31 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 40 of file MPU6886_Class.hpp.
|
staticconstexpr |
Definition at line 18 of file MPU6886_Class.hpp.