![]() |
Core2 for AWS IoT EduKit BSP 1.5.1
|
Functions for the MPU6886 inertial measurement unit (IMU). More...
#include "stdint.h"Go to the source code of this file.
Macros | |
| #define | MPU6886_ADDRESS 0x68 |
| #define | MPU6886_WHOAMI 0x75 |
| #define | MPU6886_ACCEL_INTEL_CTRL 0x69 |
| #define | MPU6886_SMPLRT_DIV 0x19 |
| #define | MPU6886_INT_PIN_CFG 0x37 |
| #define | MPU6886_INT_ENABLE 0x38 |
| #define | MPU6886_ACCEL_XOUT_H 0x3B |
| #define | MPU6886_ACCEL_XOUT_L 0x3C |
| #define | MPU6886_ACCEL_YOUT_H 0x3D |
| #define | MPU6886_ACCEL_YOUT_L 0x3E |
| #define | MPU6886_ACCEL_ZOUT_H 0x3F |
| #define | MPU6886_ACCEL_ZOUT_L 0x40 |
| #define | MPU6886_TEMP_OUT_H 0x41 |
| #define | MPU6886_TEMP_OUT_L 0x42 |
| #define | MPU6886_GYRO_XOUT_H 0x43 |
| #define | MPU6886_GYRO_XOUT_L 0x44 |
| #define | MPU6886_GYRO_YOUT_H 0x45 |
| #define | MPU6886_GYRO_YOUT_L 0x46 |
| #define | MPU6886_GYRO_ZOUT_H 0x47 |
| #define | MPU6886_GYRO_ZOUT_L 0x48 |
| #define | MPU6886_USER_CTRL 0x6A |
| #define | MPU6886_PWR_MGMT_1 0x6B |
| #define | MPU6886_PWR_MGMT_2 0x6C |
| #define | MPU6886_CONFIG 0x1A |
| #define | MPU6886_GYRO_CONFIG 0x1B |
| #define | MPU6886_ACCEL_CONFIG 0x1C |
| #define | MPU6886_ACCEL_CONFIG2 0x1D |
| #define | MPU6886_FIFO_EN 0x23 |
Enumerations | |
| enum | acc_scale_t { MPU6886_AFS_2G = 0 , MPU6886_AFS_4G , MPU6886_AFS_8G , MPU6886_AFS_16G } |
| List of possible accelerometer scalars in Gs. More... | |
| enum | gyro_scale_t { MPU6886_GFS_250DPS = 0 , MPU6886_GFS_500DPS , MPU6886_GFS_1000DPS , MPU6886_GFS_2000DPS } |
| List of possible gyroscope scalars in degrees per second. More... | |
Functions | |
| int | MPU6886_Init (void) |
| Initializes the MPU6886 over I2C. More... | |
| void | MPU6886_GetAccelAdc (int16_t *ax, int16_t *ay, int16_t *az) |
| Retrieves the accelerometer measurements from the 16-bit ADC on the MPU6886. More... | |
| void | MPU6886_GetGyroAdc (int16_t *gx, int16_t *gy, int16_t *gz) |
| Retrieves the gyroscope measurements from the 16-bit ADC on the MPU6886. More... | |
| void | MPU6886_GetTempAdc (int16_t *t) |
| Retrieves the internal temperature measurement from the 16-bit ADC on the MPU6886. More... | |
| float | MPU6886_GetGyroRes (gyro_scale_t scale) |
| Retrieves the resolution of the gyroscope measurements on the MPU6886. More... | |
| float | MPU6886_GetAccRes (acc_scale_t scale) |
| Retrieves the resolution of the accelerometer measurements on the MPU6886. More... | |
| void | MPU6886_SetGyroFSR (gyro_scale_t scale) |
| Sets the full-scale range of the gyroscope on the MPU6886. More... | |
| void | MPU6886_SetAccelFSR (acc_scale_t scale) |
| Sets the full-scale range of the accelerometer on the MPU6886. More... | |
| void | MPU6886_GetAccelData (float *ax, float *ay, float *az) |
| Retrieves the accelerometer measurements from the MPU6886. More... | |
| void | MPU6886_GetGyroData (float *roll, float *yaw, float *pitch) |
| Retrieves the gyroscope measurements from the MPU6886. More... | |
| void | MPU6886_GetTempData (float *t) |
| Retrieves the internal temperature measurement from the MPU6886. More... | |
Functions for the MPU6886 inertial measurement unit (IMU).
| #define MPU6886_ADDRESS 0x68 |
| #define MPU6886_WHOAMI 0x75 |
| #define MPU6886_ACCEL_INTEL_CTRL 0x69 |
| #define MPU6886_SMPLRT_DIV 0x19 |
| #define MPU6886_INT_PIN_CFG 0x37 |
| #define MPU6886_INT_ENABLE 0x38 |
| #define MPU6886_ACCEL_XOUT_H 0x3B |
| #define MPU6886_ACCEL_XOUT_L 0x3C |
| #define MPU6886_ACCEL_YOUT_H 0x3D |
| #define MPU6886_ACCEL_YOUT_L 0x3E |
| #define MPU6886_ACCEL_ZOUT_H 0x3F |
| #define MPU6886_ACCEL_ZOUT_L 0x40 |
| #define MPU6886_TEMP_OUT_H 0x41 |
| #define MPU6886_TEMP_OUT_L 0x42 |
| #define MPU6886_GYRO_XOUT_H 0x43 |
| #define MPU6886_GYRO_XOUT_L 0x44 |
| #define MPU6886_GYRO_YOUT_H 0x45 |
| #define MPU6886_GYRO_YOUT_L 0x46 |
| #define MPU6886_GYRO_ZOUT_H 0x47 |
| #define MPU6886_GYRO_ZOUT_L 0x48 |
| #define MPU6886_USER_CTRL 0x6A |
| #define MPU6886_PWR_MGMT_1 0x6B |
| #define MPU6886_PWR_MGMT_2 0x6C |
| #define MPU6886_CONFIG 0x1A |
| #define MPU6886_GYRO_CONFIG 0x1B |
| #define MPU6886_ACCEL_CONFIG 0x1C |
| #define MPU6886_ACCEL_CONFIG2 0x1D |
| #define MPU6886_FIFO_EN 0x23 |
| enum acc_scale_t |
| enum gyro_scale_t |
| int MPU6886_Init | ( | void | ) |
Initializes the MPU6886 over I2C.
| void MPU6886_GetAccelAdc | ( | int16_t * | ax, |
| int16_t * | ay, | ||
| int16_t * | az | ||
| ) |
Retrieves the accelerometer measurements from the 16-bit ADC on the MPU6886.
| [out] | ax | The 16-bit accelerometer measurement in the X direction. |
| [out] | ay | The 16-bit accelerometer measurement in the Y direction. |
| [out] | az | The 16-bit accelerometer measurement in the Z direction. |
| void MPU6886_GetGyroAdc | ( | int16_t * | gx, |
| int16_t * | gy, | ||
| int16_t * | gz | ||
| ) |
Retrieves the gyroscope measurements from the 16-bit ADC on the MPU6886.
| [out] | gx | The 16-bit accelerometer measurement in the X direction. |
| [out] | gy | The 16-bit accelerometer measurement in the Y direction. |
| [out] | gz | The 16-bit accelerometer measurement in the Z direction. |
| void MPU6886_GetTempAdc | ( | int16_t * | t | ) |
Retrieves the internal temperature measurement from the 16-bit ADC on the MPU6886.
| [out] | t | Temperature of the MPU6886 passed through the 16-bit ADC. |
| float MPU6886_GetGyroRes | ( | gyro_scale_t | scale | ) |
Retrieves the resolution of the gyroscope measurements on the MPU6886.
| [in] | scale | The degrees per second scale of measurement. |
| float MPU6886_GetAccRes | ( | acc_scale_t | scale | ) |
Retrieves the resolution of the accelerometer measurements on the MPU6886.
| [in] | scale | The G's per second scale of measurement. |
| void MPU6886_SetGyroFSR | ( | gyro_scale_t | scale | ) |
Sets the full-scale range of the gyroscope on the MPU6886.
| [in] | scale | The degrees per second scale of measurement. |
| void MPU6886_SetAccelFSR | ( | acc_scale_t | scale | ) |
Sets the full-scale range of the accelerometer on the MPU6886.
| [in] | scale | The G's per second scale of measurement. |
| void MPU6886_GetAccelData | ( | float * | ax, |
| float * | ay, | ||
| float * | az | ||
| ) |
Retrieves the accelerometer measurements from the MPU6886.
Example:
Get the accelerometer values for the X, Y, and Z direction.
| [out] | ax | The 16-bit accelerometer measurement in the X direction. |
| [out] | ay | The 16-bit accelerometer measurement in the Y direction. |
| [out] | az | The 16-bit accelerometer measurement in the Z direction. |
| void MPU6886_GetGyroData | ( | float * | roll, |
| float * | yaw, | ||
| float * | pitch | ||
| ) |
Retrieves the gyroscope measurements from the MPU6886.
Example:
Get the gyroscope values for the Roll, Yaw, and Pitch direction.
| [out] | roll | The 16-bit gyroscope roll measurement. |
| [out] | yaw | The 16-bit gyroscope yaw measurement. |
| [out] | pitch | The 16-bit gyroscope pitch measurement. |
| void MPU6886_GetTempData | ( | float * | t | ) |
Retrieves the internal temperature measurement from the MPU6886.
Example:
Get the temperature reading of the MPU6886 temperature sensor.
| [out] | t | Temperature of the MPU6886. |