Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mpu60x0_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010-2013 The Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
28 #ifndef MPU60X0_REGS_H
29 #define MPU60X0_REGS_H
30 
31 /* default I2C address */
32 #define MPU60X0_ADDR 0xD0
33 #define MPU60X0_ADDR_ALT 0xD2
34 
35 #define MPU60X0_SPI_READ 0x80
36 
37 // Power and Interface
38 #define MPU60X0_REG_AUX_VDDIO 0x01 // Must be set to 0 on MPU6000
39 #define MPU60X0_REG_USER_CTRL 0x6A
40 #define MPU60X0_REG_PWR_MGMT_1 0x6B
41 #define MPU60X0_REG_PWR_MGMT_2 0x6C
42 
43 // FIFO
44 #define MPU60X0_REG_FIFO_EN 0x23
45 #define MPU60X0_REG_FIFO_COUNT_H 0x72
46 #define MPU60X0_REG_FIFO_COUNT_L 0x73
47 #define MPU60X0_REG_FIFO_R_W 0x74
48 
49 // Measurement Settings
50 #define MPU60X0_REG_SMPLRT_DIV 0x19
51 #define MPU60X0_REG_CONFIG 0x1A
52 #define MPU60X0_REG_GYRO_CONFIG 0x1B
53 #define MPU60X0_REG_ACCEL_CONFIG 0x1C
54 
55 // I2C Slave settings
56 #define MPU60X0_REG_I2C_MST_CTRL 0x24
57 #define MPU60X0_REG_I2C_MST_STATUS 0x36
58 #define MPU60X0_REG_I2C_MST_DELAY 0x67
59 // Slave 0
60 #define MPU60X0_REG_I2C_SLV0_ADDR 0X25 // i2c addr
61 #define MPU60X0_REG_I2C_SLV0_REG 0X26 // slave reg
62 #define MPU60X0_REG_I2C_SLV0_CTRL 0X27 // set-bits
63 #define MPU60X0_REG_I2C_SLV0_DO 0X63 // DO
64 // Slave 1
65 #define MPU60X0_REG_I2C_SLV1_ADDR 0X28 // i2c addr
66 #define MPU60X0_REG_I2C_SLV1_REG 0X29 // slave reg
67 #define MPU60X0_REG_I2C_SLV1_CTRL 0X2A // set-bits
68 #define MPU60X0_REG_I2C_SLV1_DO 0X64 // DO
69 // Slave 2
70 #define MPU60X0_REG_I2C_SLV2_ADDR 0X2B // i2c addr
71 #define MPU60X0_REG_I2C_SLV2_REG 0X2C // slave reg
72 #define MPU60X0_REG_I2C_SLV2_CTRL 0X2D // set-bits
73 #define MPU60X0_REG_I2C_SLV2_DO 0X65 // DO
74 // Slave 3
75 #define MPU60X0_REG_I2C_SLV3_ADDR 0X2E // i2c addr
76 #define MPU60X0_REG_I2C_SLV3_REG 0X2F // slave reg
77 #define MPU60X0_REG_I2C_SLV3_CTRL 0X30 // set-bits
78 #define MPU60X0_REG_I2C_SLV3_DO 0X66 // DO
79 // Slave 4 - special
80 #define MPU60X0_REG_I2C_SLV4_ADDR 0X31 // i2c addr
81 #define MPU60X0_REG_I2C_SLV4_REG 0X32 // slave reg
82 #define MPU60X0_REG_I2C_SLV4_DO 0X33 // DO
83 #define MPU60X0_REG_I2C_SLV4_CTRL 0X34 // set-bits
84 #define MPU60X0_REG_I2C_SLV4_DI 0X35 // DI
85 
86 // Interrupt
87 #define MPU60X0_REG_INT_PIN_CFG 0x37
88 #define MPU60X0_REG_INT_ENABLE 0x38
89 #define MPU60X0_REG_INT_STATUS 0x3A
90 
91 // Accelero
92 #define MPU60X0_REG_ACCEL_XOUT_H 0x3B
93 #define MPU60X0_REG_ACCEL_XOUT_L 0x3C
94 #define MPU60X0_REG_ACCEL_YOUT_H 0x3D
95 #define MPU60X0_REG_ACCEL_YOUT_L 0x3E
96 #define MPU60X0_REG_ACCEL_ZOUT_H 0x3F
97 #define MPU60X0_REG_ACCEL_ZOUT_L 0x40
98 
99 // Temperature
100 #define MPU60X0_REG_TEMP_OUT_H 0x41
101 #define MPU60X0_REG_TEMP_OUT_L 0x42
102 
103 // Gyro
104 #define MPU60X0_REG_GYRO_XOUT_H 0x43
105 #define MPU60X0_REG_GYRO_XOUT_L 0x44
106 #define MPU60X0_REG_GYRO_YOUT_H 0x45
107 #define MPU60X0_REG_GYRO_YOUT_L 0x46
108 #define MPU60X0_REG_GYRO_ZOUT_H 0x47
109 #define MPU60X0_REG_GYRO_ZOUT_L 0x48
110 
111 // External Sensor Data
112 #define MPU60X0_EXT_SENS_DATA 0x49
113 #define MPU60X0_EXT_SENS_DATA_SIZE 24
114 
115 
116 #define MPU60X0_REG_WHO_AM_I 0x75
117 #ifdef ICM20608
118 #define MPU60X0_WHOAMI_REPLY 0xAF
119 #else
120 #define MPU60X0_WHOAMI_REPLY 0x68
121 #endif
122 
123 // Bit positions
124 #define MPU60X0_I2C_BYPASS_EN 1
125 
126 // in MPU60X0_REG_USER_CTRL
127 #define MPU60X0_SIG_COND_RESET 0
128 #define MPU60X0_I2C_MST_RESET 1
129 #define MPU60X0_FIFO_RESET 2
130 #define MPU60X0_I2C_IF_DIS 4
131 #define MPU60X0_I2C_MST_EN 5
132 #define MPU60X0_FIFO_EN 6
133 
134 // in MPU60X0_REG_I2C_MST_STATUS
135 #define MPU60X0_I2C_SLV4_DONE 6
136 
142  MPU60X0_DLPF_256HZ = 0x0, // internal sampling rate 8kHz
143  MPU60X0_DLPF_188HZ = 0x1, // internal sampling rate 1kHz
149 };
150 
159 };
160 
169 };
170 
191 };
192 
193 #endif /* MPU60X0_REGS_H */
Mpu60x0AccelRanges
Selectable accel range.
Definition: mpu60x0_regs.h:164
Mpu60x0GyroRanges
Selectable gyro range.
Definition: mpu60x0_regs.h:154
Mpu60x0DLPF
Digital Low Pass Filter Options DLFP is affecting both gyro and accels, with slightly different bandw...
Definition: mpu60x0_regs.h:141
Mpu60x0MstClk
I2C Master clock.
Definition: mpu60x0_regs.h:174