teste

Dependencies:   BurstSPI Fonts

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MPU6050RegDef.h Source File

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 #define XGOFFS_TC        0x00 // Bit 7 PWR_MODE, bits 6:1 XG_OFFS_TC, bit 0 OTP_BNK_VLD                 
00032 #define YGOFFS_TC        0x01                                                                          
00033 #define ZGOFFS_TC        0x02
00034 #define X_FINE_GAIN      0x03 // [7:0] fine gain
00035 #define Y_FINE_GAIN      0x04
00036 #define Z_FINE_GAIN      0x05
00037 #define XA_OFFSET_H      0x06 // User-defined trim values for accelerometer
00038 #define XA_OFFSET_L_TC   0x07
00039 #define YA_OFFSET_H      0x08
00040 #define YA_OFFSET_L_TC   0x09
00041 #define ZA_OFFSET_H      0x0A
00042 #define ZA_OFFSET_L_TC   0x0B
00043 #define SELF_TEST_X      0x0D
00044 #define SELF_TEST_Y      0x0E    
00045 #define SELF_TEST_Z      0x0F
00046 #define SELF_TEST_A      0x10
00047 #define XG_OFFS_USRH     0x13  // User-defined trim values for gyroscope; supported in MPU-6050?
00048 #define XG_OFFS_USRL     0x14
00049 #define YG_OFFS_USRH     0x15
00050 #define YG_OFFS_USRL     0x16
00051 #define ZG_OFFS_USRH     0x17
00052 #define ZG_OFFS_USRL     0x18
00053 #define SMPLRT_DIV       0x19
00054 #define CONFIG           0x1A
00055 #define GYRO_CONFIG      0x1B
00056 #define ACCEL_CONFIG     0x1C
00057 #define FF_THR           0x1D  // Free-fall
00058 #define FF_DUR           0x1E  // Free-fall
00059 #define MOT_THR          0x1F  // Motion detection threshold bits [7:0]
00060 #define MOT_DUR          0x20  // Duration counter threshold for motion interrupt generation, 1 kHz rate, LSB = 1 ms
00061 #define ZMOT_THR         0x21  // Zero-motion detection threshold bits [7:0]
00062 #define ZRMOT_DUR        0x22  // Duration counter threshold for zero motion interrupt generation, 16 Hz rate, LSB = 64 ms
00063 #define FIFO_EN          0x23
00064 #define I2C_MST_CTRL     0x24   
00065 #define I2C_SLV0_ADDR    0x25
00066 #define I2C_SLV0_REG     0x26
00067 #define I2C_SLV0_CTRL    0x27
00068 #define I2C_SLV1_ADDR    0x28
00069 #define I2C_SLV1_REG     0x29
00070 #define I2C_SLV1_CTRL    0x2A
00071 #define I2C_SLV2_ADDR    0x2B
00072 #define I2C_SLV2_REG     0x2C
00073 #define I2C_SLV2_CTRL    0x2D
00074 #define I2C_SLV3_ADDR    0x2E
00075 #define I2C_SLV3_REG     0x2F
00076 #define I2C_SLV3_CTRL    0x30
00077 #define I2C_SLV4_ADDR    0x31
00078 #define I2C_SLV4_REG     0x32
00079 #define I2C_SLV4_DO      0x33
00080 #define I2C_SLV4_CTRL    0x34
00081 #define I2C_SLV4_DI      0x35
00082 #define I2C_MST_STATUS   0x36
00083 #define INT_PIN_CFG      0x37
00084 #define INT_ENABLE       0x38
00085 #define DMP_INT_STATUS   0x39  // Check DMP interrupt
00086 #define INT_STATUS       0x3A
00087 #define ACCEL_XOUT_H     0x3B
00088 #define ACCEL_XOUT_L     0x3C
00089 #define ACCEL_YOUT_H     0x3D
00090 #define ACCEL_YOUT_L     0x3E
00091 #define ACCEL_ZOUT_H     0x3F
00092 #define ACCEL_ZOUT_L     0x40
00093 #define TEMP_OUT_H       0x41
00094 #define TEMP_OUT_L       0x42
00095 #define GYRO_XOUT_H      0x43
00096 #define GYRO_XOUT_L      0x44
00097 #define GYRO_YOUT_H      0x45
00098 #define GYRO_YOUT_L      0x46
00099 #define GYRO_ZOUT_H      0x47
00100 #define GYRO_ZOUT_L      0x48
00101 #define EXT_SENS_DATA_00 0x49
00102 #define EXT_SENS_DATA_01 0x4A
00103 #define EXT_SENS_DATA_02 0x4B
00104 #define EXT_SENS_DATA_03 0x4C
00105 #define EXT_SENS_DATA_04 0x4D
00106 #define EXT_SENS_DATA_05 0x4E
00107 #define EXT_SENS_DATA_06 0x4F
00108 #define EXT_SENS_DATA_07 0x50
00109 #define EXT_SENS_DATA_08 0x51
00110 #define EXT_SENS_DATA_09 0x52
00111 #define EXT_SENS_DATA_10 0x53
00112 #define EXT_SENS_DATA_11 0x54
00113 #define EXT_SENS_DATA_12 0x55
00114 #define EXT_SENS_DATA_13 0x56
00115 #define EXT_SENS_DATA_14 0x57
00116 #define EXT_SENS_DATA_15 0x58
00117 #define EXT_SENS_DATA_16 0x59
00118 #define EXT_SENS_DATA_17 0x5A
00119 #define EXT_SENS_DATA_18 0x5B
00120 #define EXT_SENS_DATA_19 0x5C
00121 #define EXT_SENS_DATA_20 0x5D
00122 #define EXT_SENS_DATA_21 0x5E
00123 #define EXT_SENS_DATA_22 0x5F
00124 #define EXT_SENS_DATA_23 0x60
00125 #define MOT_DETECT_STATUS 0x61
00126 #define I2C_SLV0_DO      0x63
00127 #define I2C_SLV1_DO      0x64
00128 #define I2C_SLV2_DO      0x65
00129 #define I2C_SLV3_DO      0x66
00130 #define I2C_MST_DELAY_CTRL 0x67
00131 #define SIGNAL_PATH_RESET  0x68
00132 #define MOT_DETECT_CTRL   0x69
00133 #define USER_CTRL        0x6A  // Bit 7 enable DMP, bit 3 reset DMP
00134 #define PWR_MGMT_1       0x6B  // Device defaults to the SLEEP mode
00135 #define PWR_MGMT_2       0x6C
00136 #define DMP_BANK         0x6D  // Activates a specific bank in the DMP
00137 #define DMP_RW_PNT       0x6E  // Set read/write pointer to a specific start address in specified DMP bank
00138 #define DMP_REG          0x6F  // Register in DMP from which to read or to which to write
00139 #define DMP_REG_1        0x70
00140 #define DMP_REG_2        0x71
00141 #define FIFO_COUNTH      0x72
00142 #define FIFO_COUNTL      0x73
00143 #define FIFO_R_W         0x74
00144 #define WHO_AM_I_MPU6050 0x75 // Should return 0x68
00145 
00146 // Using the GY-521 breakout board, I set ADO to 0 by grounding through a 4k7 resistor
00147 // Seven-bit device address is 110100 for ADO = 0 and 110101 for ADO = 1
00148 #define ADO 0
00149 #if ADO
00150 #define MPU6050_ADDRESS 0x69<<1  // Device address when ADO = 1
00151 #else
00152 #define MPU6050_ADDRESS 0x68<<1  // Device address when ADO = 0
00153 #endif