Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MPU6050 by
MPU6050RegDef.h
00001 /* 00002 * Copyright (c) 2015, Baser Kandehir, baser.kandehir@ieee.metu.edu.tr 00003 * 00004 * Permission is hereby granted, free of charge, to any person obtaining a copy 00005 * of this software and associated documentation files (the "Software"), to deal 00006 * in the Software without restriction, including without limitation the rights 00007 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00008 * copies of the Software, and to permit persons to whom the Software is 00009 * furnished to do so, subject to the following conditions: 00010 * 00011 * The above copyright notice and this permission notice shall be included in 00012 * all copies or substantial portions of the Software. 00013 * 00014 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00015 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00016 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00017 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00018 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00019 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00020 * THE SOFTWARE. 00021 * 00022 */ 00023 00024 // Taken from Kris Winer's MPU6050 library 00025 00026 // Define registers per MPU6050, Register Map and Descriptions, Rev 4.2, 08/19/2013 6 DOF Motion sensor fusion device 00027 // Invensense Inc., www.invensense.com 00028 // See also MPU-6050 Register Map and Descriptions, Revision 4.0, RM-MPU-6050A-00, 9/12/2012 for registers not listed in 00029 // above document; the MPU6050 and MPU 9150 are virtually identical but the latter has an on-board magnetic sensor 00030 // 00031 00032 #define XGOFFS_TC 0x00 // Bit 7 PWR_MODE, bits 6:1 XG_OFFS_TC, bit 0 OTP_BNK_VLD 00033 #define YGOFFS_TC 0x01 00034 #define ZGOFFS_TC 0x02 00035 #define X_FINE_GAIN 0x03 // [7:0] fine gain 00036 #define Y_FINE_GAIN 0x04 00037 #define Z_FINE_GAIN 0x05 00038 #define XA_OFFSET_H 0x06 // User-defined trim values for accelerometer 00039 #define XA_OFFSET_L_TC 0x07 00040 #define YA_OFFSET_H 0x08 00041 #define YA_OFFSET_L_TC 0x09 00042 #define ZA_OFFSET_H 0x0A 00043 #define ZA_OFFSET_L_TC 0x0B 00044 #define SELF_TEST_X 0x0D 00045 #define SELF_TEST_Y 0x0E 00046 #define SELF_TEST_Z 0x0F 00047 #define SELF_TEST_A 0x10 00048 #define XG_OFFS_USRH 0x13 // User-defined trim values for gyroscope; supported in MPU-6050? 00049 #define XG_OFFS_USRL 0x14 00050 #define YG_OFFS_USRH 0x15 00051 #define YG_OFFS_USRL 0x16 00052 #define ZG_OFFS_USRH 0x17 00053 #define ZG_OFFS_USRL 0x18 00054 #define SMPLRT_DIV 0x19 00055 #define CONFIG 0x1A 00056 #define GYRO_CONFIG 0x1B 00057 #define ACCEL_CONFIG 0x1C 00058 #define FF_THR 0x1D // Free-fall 00059 #define FF_DUR 0x1E // Free-fall 00060 #define MOT_THR 0x1F // Motion detection threshold bits [7:0] 00061 #define MOT_DUR 0x20 // Duration counter threshold for motion interrupt generation, 1 kHz rate, LSB = 1 ms 00062 #define ZMOT_THR 0x21 // Zero-motion detection threshold bits [7:0] 00063 #define ZRMOT_DUR 0x22 // Duration counter threshold for zero motion interrupt generation, 16 Hz rate, LSB = 64 ms 00064 #define FIFO_EN 0x23 00065 #define I2C_MST_CTRL 0x24 00066 #define I2C_SLV0_ADDR 0x25 00067 #define I2C_SLV0_REG 0x26 00068 #define I2C_SLV0_CTRL 0x27 00069 #define I2C_SLV1_ADDR 0x28 00070 #define I2C_SLV1_REG 0x29 00071 #define I2C_SLV1_CTRL 0x2A 00072 #define I2C_SLV2_ADDR 0x2B 00073 #define I2C_SLV2_REG 0x2C 00074 #define I2C_SLV2_CTRL 0x2D 00075 #define I2C_SLV3_ADDR 0x2E 00076 #define I2C_SLV3_REG 0x2F 00077 #define I2C_SLV3_CTRL 0x30 00078 #define I2C_SLV4_ADDR 0x31 00079 #define I2C_SLV4_REG 0x32 00080 #define I2C_SLV4_DO 0x33 00081 #define I2C_SLV4_CTRL 0x34 00082 #define I2C_SLV4_DI 0x35 00083 #define I2C_MST_STATUS 0x36 00084 #define INT_PIN_CFG 0x37 00085 #define INT_ENABLE 0x38 00086 #define DMP_INT_STATUS 0x39 // Check DMP interrupt 00087 #define INT_STATUS 0x3A 00088 #define ACCEL_XOUT_H 0x3B 00089 #define ACCEL_XOUT_L 0x3C 00090 #define ACCEL_YOUT_H 0x3D 00091 #define ACCEL_YOUT_L 0x3E 00092 #define ACCEL_ZOUT_H 0x3F 00093 #define ACCEL_ZOUT_L 0x40 00094 #define TEMP_OUT_H 0x41 00095 #define TEMP_OUT_L 0x42 00096 #define GYRO_XOUT_H 0x43 00097 #define GYRO_XOUT_L 0x44 00098 #define GYRO_YOUT_H 0x45 00099 #define GYRO_YOUT_L 0x46 00100 #define GYRO_ZOUT_H 0x47 00101 #define GYRO_ZOUT_L 0x48 00102 #define EXT_SENS_DATA_00 0x49 00103 #define EXT_SENS_DATA_01 0x4A 00104 #define EXT_SENS_DATA_02 0x4B 00105 #define EXT_SENS_DATA_03 0x4C 00106 #define EXT_SENS_DATA_04 0x4D 00107 #define EXT_SENS_DATA_05 0x4E 00108 #define EXT_SENS_DATA_06 0x4F 00109 #define EXT_SENS_DATA_07 0x50 00110 #define EXT_SENS_DATA_08 0x51 00111 #define EXT_SENS_DATA_09 0x52 00112 #define EXT_SENS_DATA_10 0x53 00113 #define EXT_SENS_DATA_11 0x54 00114 #define EXT_SENS_DATA_12 0x55 00115 #define EXT_SENS_DATA_13 0x56 00116 #define EXT_SENS_DATA_14 0x57 00117 #define EXT_SENS_DATA_15 0x58 00118 #define EXT_SENS_DATA_16 0x59 00119 #define EXT_SENS_DATA_17 0x5A 00120 #define EXT_SENS_DATA_18 0x5B 00121 #define EXT_SENS_DATA_19 0x5C 00122 #define EXT_SENS_DATA_20 0x5D 00123 #define EXT_SENS_DATA_21 0x5E 00124 #define EXT_SENS_DATA_22 0x5F 00125 #define EXT_SENS_DATA_23 0x60 00126 #define MOT_DETECT_STATUS 0x61 00127 #define I2C_SLV0_DO 0x63 00128 #define I2C_SLV1_DO 0x64 00129 #define I2C_SLV2_DO 0x65 00130 #define I2C_SLV3_DO 0x66 00131 #define I2C_MST_DELAY_CTRL 0x67 00132 #define SIGNAL_PATH_RESET 0x68 00133 #define MOT_DETECT_CTRL 0x69 00134 #define USER_CTRL 0x6A // Bit 7 enable DMP, bit 3 reset DMP 00135 #define PWR_MGMT_1 0x6B // Device defaults to the SLEEP mode 00136 #define PWR_MGMT_2 0x6C 00137 #define DMP_BANK 0x6D // Activates a specific bank in the DMP 00138 #define DMP_RW_PNT 0x6E // Set read/write pointer to a specific start address in specified DMP bank 00139 #define DMP_REG 0x6F // Register in DMP from which to read or to which to write 00140 #define DMP_REG_1 0x70 00141 #define DMP_REG_2 0x71 00142 #define FIFO_COUNTH 0x72 00143 #define FIFO_COUNTL 0x73 00144 #define FIFO_R_W 0x74 00145 #define WHO_AM_I_MPU6050 0x75 // Should return 0x68 00146 00147 // Using the GY-521 breakout board, I set ADO to 0 by grounding through a 4k7 resistor 00148 // Seven-bit device address is 110100 for ADO = 0 and 110101 for ADO = 1 00149 #define ADO 0 00150 #if ADO 00151 #define MPU6050_ADDRESS 0x69<<1 // Device address when ADO = 1 00152 #else 00153 #define MPU6050_ADDRESS 0x68<<1 // Device address when ADO = 0 00154 #endif
Generated on Mon Jul 18 2022 19:38:45 by
