Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
mpu9250_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 MPU9250_REGS_H
29 #define MPU9250_REGS_H
30 
31 /* default I2C address */
32 #define MPU9250_ADDR 0xD0
33 #define MPU9250_ADDR_ALT 0xD2
34 
35 #define MPU9250_MAG_ADDR 0x18
36 
37 #define MPU9250_SPI_READ 0x80
38 
39 // Power and Interface
40 #define MPU9250_REG_AUX_VDDIO 0x01 // Must be set to 0 on MPU6000
41 #define MPU9250_REG_USER_CTRL 0x6A
42 #define MPU9250_REG_PWR_MGMT_1 0x6B
43 #define MPU9250_REG_PWR_MGMT_2 0x6C
44 
45 // FIFO
46 #define MPU9250_REG_FIFO_EN 0x23
47 #define MPU9250_REG_FIFO_COUNT_H 0x72
48 #define MPU9250_REG_FIFO_COUNT_L 0x73
49 #define MPU9250_REG_FIFO_R_W 0x74
50 
51 // Measurement Settings
52 #define MPU9250_REG_SMPLRT_DIV 0x19
53 #define MPU9250_REG_CONFIG 0x1A
54 #define MPU9250_REG_GYRO_CONFIG 0x1B
55 #define MPU9250_REG_ACCEL_CONFIG 0x1C
56 #define MPU9250_REG_ACCEL_CONFIG_2 0x1D
57 
58 
59 // I2C Slave settings
60 #define MPU9250_REG_I2C_MST_CTRL 0x24
61 #define MPU9250_REG_I2C_MST_STATUS 0x36
62 #define MPU9250_REG_I2C_MST_DELAY 0x67
63 // Slave 0
64 #define MPU9250_REG_I2C_SLV0_ADDR 0X25 // i2c addr
65 #define MPU9250_REG_I2C_SLV0_REG 0X26 // slave reg
66 #define MPU9250_REG_I2C_SLV0_CTRL 0X27 // set-bits
67 #define MPU9250_REG_I2C_SLV0_DO 0X63 // DO
68 // Slave 1
69 #define MPU9250_REG_I2C_SLV1_ADDR 0X28 // i2c addr
70 #define MPU9250_REG_I2C_SLV1_REG 0X29 // slave reg
71 #define MPU9250_REG_I2C_SLV1_CTRL 0X2A // set-bits
72 #define MPU9250_REG_I2C_SLV1_DO 0X64 // DO
73 // Slave 2
74 #define MPU9250_REG_I2C_SLV2_ADDR 0X2B // i2c addr
75 #define MPU9250_REG_I2C_SLV2_REG 0X2C // slave reg
76 #define MPU9250_REG_I2C_SLV2_CTRL 0X2D // set-bits
77 #define MPU9250_REG_I2C_SLV2_DO 0X65 // DO
78 // Slave 3
79 #define MPU9250_REG_I2C_SLV3_ADDR 0X2E // i2c addr
80 #define MPU9250_REG_I2C_SLV3_REG 0X2F // slave reg
81 #define MPU9250_REG_I2C_SLV3_CTRL 0X30 // set-bits
82 #define MPU9250_REG_I2C_SLV3_DO 0X66 // DO
83 // Slave 4 - special
84 #define MPU9250_REG_I2C_SLV4_ADDR 0X31 // i2c addr
85 #define MPU9250_REG_I2C_SLV4_REG 0X32 // slave reg
86 #define MPU9250_REG_I2C_SLV4_DO 0X33 // DO
87 #define MPU9250_REG_I2C_SLV4_CTRL 0X34 // set-bits
88 #define MPU9250_REG_I2C_SLV4_DI 0X35 // DI
89 
90 // Interrupt
91 #define MPU9250_REG_INT_PIN_CFG 0x37
92 #define MPU9250_REG_INT_ENABLE 0x38
93 #define MPU9250_REG_INT_STATUS 0x3A
94 
95 // Accelero
96 #define MPU9250_REG_ACCEL_XOUT_H 0x3B
97 #define MPU9250_REG_ACCEL_XOUT_L 0x3C
98 #define MPU9250_REG_ACCEL_YOUT_H 0x3D
99 #define MPU9250_REG_ACCEL_YOUT_L 0x3E
100 #define MPU9250_REG_ACCEL_ZOUT_H 0x3F
101 #define MPU9250_REG_ACCEL_ZOUT_L 0x40
102 
103 // Temperature
104 #define MPU9250_REG_TEMP_OUT_H 0x41
105 #define MPU9250_REG_TEMP_OUT_L 0x42
106 
107 // Gyro
108 #define MPU9250_REG_GYRO_XOUT_H 0x43
109 #define MPU9250_REG_GYRO_XOUT_L 0x44
110 #define MPU9250_REG_GYRO_YOUT_H 0x45
111 #define MPU9250_REG_GYRO_YOUT_L 0x46
112 #define MPU9250_REG_GYRO_ZOUT_H 0x47
113 #define MPU9250_REG_GYRO_ZOUT_L 0x48
114 
115 // External Sensor Data
116 #define MPU9250_EXT_SENS_DATA 0x49
117 #define MPU9250_EXT_SENS_DATA_SIZE 24
118 
119 
120 #define MPU9250_REG_WHO_AM_I 0x75
121 #define MPU9250_WHOAMI_REPLY 0x71
122 
123 // Bit positions
124 #define MPU9250_I2C_BYPASS_EN 1
125 
126 // in MPU9250_REG_USER_CTRL
127 #define MPU9250_SIG_COND_RESET 0
128 #define MPU9250_I2C_MST_RESET 1
129 #define MPU9250_FIFO_RESET 2
130 #define MPU9250_I2C_IF_DIS 4
131 #define MPU9250_I2C_MST_EN 5
132 #define MPU9250_FIFO_EN 6
133 
134 // in MPU9250_REG_I2C_MST_STATUS
135 #define MPU9250_I2C_SLV4_DONE 6
136 
140  MPU9250_DLPF_GYRO_250HZ = 0x0, // internal sampling rate 8kHz
141  MPU9250_DLPF_GYRO_184HZ = 0x1, // internal sampling rate 1kHz
147 };
148 
150  MPU9250_DLPF_ACCEL_460HZ = 0x0, // internal sampling rate 8kHz
151  MPU9250_DLPF_ACCEL_184HZ = 0x1, // internal sampling rate 1kHz
157 };
158 
167 };
168 
177 };
178 
199 };
200 
201 #endif /* MPU9250_REGS_H */
MPU9250_MST_CLK_364KHZ
@ MPU9250_MST_CLK_364KHZ
Definition: mpu9250_regs.h:189
MPU9250_MST_CLK_348KHZ
@ MPU9250_MST_CLK_348KHZ
Definition: mpu9250_regs.h:190
MPU9250_GYRO_RANGE_250
@ MPU9250_GYRO_RANGE_250
Definition: mpu9250_regs.h:163
MPU9250_DLPF_ACCEL_41HZ
@ MPU9250_DLPF_ACCEL_41HZ
Definition: mpu9250_regs.h:153
MPU9250_DLPF_ACCEL_184HZ
@ MPU9250_DLPF_ACCEL_184HZ
Definition: mpu9250_regs.h:151
MPU9250_MST_CLK_286KHZ
@ MPU9250_MST_CLK_286KHZ
Definition: mpu9250_regs.h:195
MPU9250_MST_CLK_500KHZ
@ MPU9250_MST_CLK_500KHZ
Definition: mpu9250_regs.h:183
MPU9250_MST_CLK_308KHZ
@ MPU9250_MST_CLK_308KHZ
Definition: mpu9250_regs.h:193
MPU9250_DLPF_GYRO_20HZ
@ MPU9250_DLPF_GYRO_20HZ
Definition: mpu9250_regs.h:144
MPU9250_MST_CLK_258KHZ
@ MPU9250_MST_CLK_258KHZ
Definition: mpu9250_regs.h:198
MPU9250_DLPF_ACCEL_460HZ
@ MPU9250_DLPF_ACCEL_460HZ
Definition: mpu9250_regs.h:150
MPU9250_DLPF_GYRO_41HZ
@ MPU9250_DLPF_GYRO_41HZ
Definition: mpu9250_regs.h:143
Mpu9250MstClk
Mpu9250MstClk
I2C Master clock.
Definition: mpu9250_regs.h:182
MPU9250_GYRO_RANGE_2000
@ MPU9250_GYRO_RANGE_2000
Definition: mpu9250_regs.h:166
MPU9250_MST_CLK_381KHZ
@ MPU9250_MST_CLK_381KHZ
Definition: mpu9250_regs.h:188
MPU9250_ACCEL_RANGE_8G
@ MPU9250_ACCEL_RANGE_8G
Definition: mpu9250_regs.h:175
Mpu9250GyroRanges
Mpu9250GyroRanges
Selectable gyro range.
Definition: mpu9250_regs.h:162
MPU9250_MST_CLK_444KHZ
@ MPU9250_MST_CLK_444KHZ
Definition: mpu9250_regs.h:185
MPU9250_DLPF_GYRO_184HZ
@ MPU9250_DLPF_GYRO_184HZ
Definition: mpu9250_regs.h:141
MPU9250_DLPF_GYRO_250HZ
@ MPU9250_DLPF_GYRO_250HZ
Definition: mpu9250_regs.h:140
MPU9250_MST_CLK_276KHZ
@ MPU9250_MST_CLK_276KHZ
Definition: mpu9250_regs.h:196
MPU9250_MST_CLK_320KHZ
@ MPU9250_MST_CLK_320KHZ
Definition: mpu9250_regs.h:192
MPU9250_GYRO_RANGE_1000
@ MPU9250_GYRO_RANGE_1000
Definition: mpu9250_regs.h:165
MPU9250_MST_CLK_400KHZ
@ MPU9250_MST_CLK_400KHZ
Definition: mpu9250_regs.h:187
MPU9250_MST_CLK_471KHZ
@ MPU9250_MST_CLK_471KHZ
Definition: mpu9250_regs.h:184
MPU9250_DLPF_GYRO_05HZ
@ MPU9250_DLPF_GYRO_05HZ
Definition: mpu9250_regs.h:146
MPU9250_ACCEL_RANGE_4G
@ MPU9250_ACCEL_RANGE_4G
Definition: mpu9250_regs.h:174
Mpu9250DLPFAccel
Mpu9250DLPFAccel
Definition: mpu9250_regs.h:149
MPU9250_DLPF_ACCEL_20HZ
@ MPU9250_DLPF_ACCEL_20HZ
Definition: mpu9250_regs.h:154
MPU9250_ACCEL_RANGE_2G
@ MPU9250_ACCEL_RANGE_2G
Definition: mpu9250_regs.h:173
MPU9250_DLPF_ACCEL_92HZ
@ MPU9250_DLPF_ACCEL_92HZ
Definition: mpu9250_regs.h:152
MPU9250_MST_CLK_421KHZ
@ MPU9250_MST_CLK_421KHZ
Definition: mpu9250_regs.h:186
MPU9250_DLPF_ACCEL_10HZ
@ MPU9250_DLPF_ACCEL_10HZ
Definition: mpu9250_regs.h:155
MPU9250_MST_CLK_296KHZ
@ MPU9250_MST_CLK_296KHZ
Definition: mpu9250_regs.h:194
MPU9250_DLPF_GYRO_92HZ
@ MPU9250_DLPF_GYRO_92HZ
Definition: mpu9250_regs.h:142
MPU9250_ACCEL_RANGE_16G
@ MPU9250_ACCEL_RANGE_16G
Definition: mpu9250_regs.h:176
MPU9250_DLPF_GYRO_10HZ
@ MPU9250_DLPF_GYRO_10HZ
Definition: mpu9250_regs.h:145
MPU9250_MST_CLK_267KHZ
@ MPU9250_MST_CLK_267KHZ
Definition: mpu9250_regs.h:197
Mpu9250AccelRanges
Mpu9250AccelRanges
Selectable accel range.
Definition: mpu9250_regs.h:172
MPU9250_GYRO_RANGE_500
@ MPU9250_GYRO_RANGE_500
Definition: mpu9250_regs.h:164
MPU9250_DLPF_ACCEL_05HZ
@ MPU9250_DLPF_ACCEL_05HZ
Definition: mpu9250_regs.h:156
MPU9250_MST_CLK_333KHZ
@ MPU9250_MST_CLK_333KHZ
Definition: mpu9250_regs.h:191
Mpu9250DLPFGyro
Mpu9250DLPFGyro
Digital Low Pass Filter Options.
Definition: mpu9250_regs.h:139