-
Notifications
You must be signed in to change notification settings - Fork 0
/
registermap.py
162 lines (157 loc) · 3.55 KB
/
registermap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
'''
This script must use with mpu9250.py
'''
# MPU6500 Register Address
MPU6500_ADDRESS = 0x68
SELF_TEST_X_GYRO = 0x00
SELF_TEST_Y_GYRO = 0x01
SELF_TEST_Z_GYRO = 0x02
SELF_TEST_X_ACCEL = 0x0D
SELF_TEST_Y_ACCEL = 0x0E
SELF_TEST_Z_ACCEL = 0x0F
XG_OFFSET_H = 0x13
XG_OFFSET_L = 0x14
YG_OFFSET_H = 0x15
YG_OFFSET_L = 0x16
ZG_OFFSET_H = 0x17
ZG_OFFSET_L = 0x18
SMPLRT_DIV = 0x19
CONFIG = 0x1A
GYRO_CONFIG = 0x1B
ACCEL_CONFIG = 0x1C
ACCEL_CONFIG_2 = 0x1D
LP_ACCEL_ODR = 0x1E
WOM_THR = 0x1F
FIFO_EN = 0x23
I2C_MST_CTRL = 0x24
I2C_SLV0_ADDR = 0x25
I2C_SLV0_REG = 0x26
I2C_SLV0_CTRL = 0x27
I2C_SLV1_ADDR = 0x28
I2C_SLV1_REG = 0x29
I2C_SLV1_CTRL = 0x2A
I2C_SLV2_ADDR = 0x2B
I2C_SLV2_REG = 0x2C
I2C_SLV2_CTRL = 0x2D
I2C_SLV3_ADDR = 0x2E
I2C_SLV3_REG = 0x2F
I2C_SLV3_CTRL = 0x30
I2C_SLV4_ADDR = 0x31
I2C_SLV4_REG = 0x32
I2C_SLV4_DO = 0x33
I2C_SLV4_CTRL = 0x34
I2C_SLV4_DI = 0x35
I2C_MST_STATUS = 0x36
INT_PIN_CFG = 0x37
INT_ENABLE = 0x38
INT_STATUS = 0x3A
ACCEL_XOUT_H = 0x3B
ACCEL_XOUT_L = 0x3C
ACCEL_YOUT_H = 0x3D
ACCEL_YOUT_L = 0x3E
ACCEL_ZOUT_H = 0x3F
ACCEL_ZOUT_L = 0x40
TEMP_OUT_H = 0x41
TEMP_OUT_L = 0x42
GYRO_XOUT_H = 0x43
GYRO_XOUT_L = 0x44
GYRO_YOUT_H = 0x45
GYRO_YOUT_L = 0x46
GYRO_ZOUT_H = 0x47
GYRO_ZOUT_L = 0x48
EXT_SENS_DATA_00 = 0x49
EXT_SENS_DATA_01 = 0x4A
EXT_SENS_DATA_02 = 0x4B
EXT_SENS_DATA_03 = 0x4C
EXT_SENS_DATA_04 = 0x4D
EXT_SENS_DATA_05 = 0x4E
EXT_SENS_DATA_06 = 0x4F
EXT_SENS_DATA_07 = 0x50
EXT_SENS_DATA_08 = 0x51
EXT_SENS_DATA_09 = 0x52
EXT_SENS_DATA_10 = 0x53
EXT_SENS_DATA_11 = 0x54
EXT_SENS_DATA_12 = 0x55
EXT_SENS_DATA_13 = 0x56
EXT_SENS_DATA_14 = 0x57
EXT_SENS_DATA_15 = 0x58
EXT_SENS_DATA_16 = 0x59
EXT_SENS_DATA_17 = 0x5A
EXT_SENS_DATA_18 = 0x5B
EXT_SENS_DATA_19 = 0x5C
EXT_SENS_DATA_20 = 0x5D
EXT_SENS_DATA_21 = 0x5E
EXT_SENS_DATA_22 = 0x5F
EXT_SENS_DATA_23 = 0x60
I2C_SLV0_DO = 0x63
I2C_SLV1_DO = 0x64
I2C_SLV2_DO = 0x65
I2C_SLV3_DO = 0x66
I2C_MST_DELAY_CTRL = 0x67
SIGNAL_PATH_RESET = 0x68
MOT_DETECT_CTRL = 0x69
USER_CTRL = 0x6A
PWR_MGMT_1 = 0x6B
PWR_MGMT_2 = 0x6C
FIFO_COUNTH = 0x72
FIFO_COUNTL = 0x73
FIFO_R_W = 0x74
WHO_AM_I = 0x75 # It is described in one byte and fixed value 0x70.
XA_OFFSET_H = 0x77
XA_OFFSET_L = 0x78
YA_OFFSET_H = 0x7A
YA_OFFSET_L = 0x7B
ZA_OFFSET_H = 0x7D
ZA_OFFSET_L = 0x7E
# AK8963 Register Map
AK8963_ADDRESS = 0x0C
WIA = 0x00 # It is described in one byte and fixed value 0x48.
INFO = 0x01
ST1 = 0x02
HXL = 0x03
HXH = 0x04
HYL = 0x05
HYH = 0x06
HZL = 0x07
HZH = 0x08
ST2 = 0x09
CNTL1 = 0x0A
CNTL2 = 0x0B
ASTC = 0x0C
TS1 = 0x0D
I2CDIS = 0x0F
ASAX = 0x10
ASAY = 0x11
ASAZ = 0x12
# MPU6500 Data Range Configuration
ACCEL_FULL_SCALE_2G = 0x00
ACCEL_FULL_SCALE_4G = 0x08
ACCEL_FULL_SCALE_8G = 0x10
ACCEL_FULL_SCALE_16G = 0x18
GYRO_FULL_SCALE_250DPS = 0x00
GYRO_FULL_SCALE_500DPS = 0x08
GYRO_FULL_SCALE_1000DPS = 0x10
GYRO_FULL_SCALE_2000DPS = 0x18
# MPU6500 Digital Low Pass Filter Level
MPU6500_DLPF_CFG_0 = 0x00
MPU6500_DLPF_CFG_1 = 0x01
MPU6500_DLPF_CFG_2 = 0x02
MPU6500_DLPF_CFG_3 = 0x03
MPU6500_DLPF_CFG_4 = 0x04
MPU6500_DLPF_CFG_5 = 0x05
MPU6500_DLPF_CFG_6 = 0x06
MPU6500_DLPF_CFG_7 = 0x07
# AK8963 Mode Configuration of CNTL1
AK8963_CNTL1_PDM = 0x10 # Power-down mode
AK8963_CNTL1_SMM = 0x11 # Single measurement mode
AK8963_CNTL1_CMM1 = 0x12 # Continuous measurement mode 1 8Hz
AK8963_CNTL1_CMM2 = 0x16 # Continuous measurement mode 2 100Hz
AK8963_CNTL1_ETMM = 0x14 # External trigger measurement mode
AK8963_CNTL1_STM = 0x18 # Self-test mode
AK8963_CNTL1_FROMAM = 0x1F # Fuse ROM access mode
# Scaling Factor of each data.
# It use to convert data to physical value.
GYRO_SCALING_FACTOR = 131
ACCEL_SCALING_FACTOR = 16384
MAG_SCALING_FACTOR = 0.6
TEMP_SCALING_FACTOR = 321