-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRTIMUDefs.h
1119 lines (933 loc) · 38.2 KB
/
RTIMUDefs.h
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
////////////////////////////////////////////////////////////////////////////
//
// This file is part of RTIMULib
//
// Copyright (c) 2014-2015, richards-tech, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
// Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// The MPU-9250 and SPI driver code is based on code generously supplied by
// [email protected] (www.clickdrive.io)
#ifndef _RTIMUDEFS_H
#define _RTIMUDEFS_H
// IMU type codes
//
// For compatibility, only add new codes at the end to avoid renumbering
#define RTIMU_TYPE_AUTODISCOVER 0 // audodiscover the IMU
#define RTIMU_TYPE_NULL 1 // if no physical hardware
#define RTIMU_TYPE_MPU9150 2 // InvenSense MPU9150
#define RTIMU_TYPE_GD20HM303D 3 // STM L3GD20H/LSM303D (Pololu Altimu)
#define RTIMU_TYPE_GD20M303DLHC 4 // STM L3GD20/LSM303DHLC (old Adafruit IMU)
#define RTIMU_TYPE_LSM9DS0 5 // STM LSM9DS0 (eg Sparkfun IMU)
#define RTIMU_TYPE_LSM9DS1 6 // STM LSM9DS1
#define RTIMU_TYPE_MPU9250 7 // InvenSense MPU9250
#define RTIMU_TYPE_GD20HM303DLHC 8 // STM L3GD20H/LSM303DHLC (new Adafruit IMU)
#define RTIMU_TYPE_BMX055 9 // Bosch BMX055
#define RTIMU_TYPE_BNO055 10 // Bosch BNO055
//----------------------------------------------------------
//
// MPU-9150
// MPU9150 I2C Slave Addresses
#define MPU9150_ADDRESS0 0x68
#define MPU9150_ADDRESS1 0x69
#define MPU9150_ID 0x68
// thes magnetometers are on aux bus
#define AK8975_ADDRESS 0x0c
#define HMC5883_ADDRESS 0x1e
// Register map
#define MPU9150_YG_OFFS_TC 0x01
#define MPU9150_SMPRT_DIV 0x19
#define MPU9150_LPF_CONFIG 0x1a
#define MPU9150_GYRO_CONFIG 0x1b
#define MPU9150_ACCEL_CONFIG 0x1c
#define MPU9150_FIFO_EN 0x23
#define MPU9150_I2C_MST_CTRL 0x24
#define MPU9150_I2C_SLV0_ADDR 0x25
#define MPU9150_I2C_SLV0_REG 0x26
#define MPU9150_I2C_SLV0_CTRL 0x27
#define MPU9150_I2C_SLV1_ADDR 0x28
#define MPU9150_I2C_SLV1_REG 0x29
#define MPU9150_I2C_SLV1_CTRL 0x2a
#define MPU9150_I2C_SLV4_CTRL 0x34
#define MPU9150_INT_PIN_CFG 0x37
#define MPU9150_INT_ENABLE 0x38
#define MPU9150_INT_STATUS 0x3a
#define MPU9150_ACCEL_XOUT_H 0x3b
#define MPU9150_GYRO_XOUT_H 0x43
#define MPU9150_EXT_SENS_DATA_00 0x49
#define MPU9150_I2C_SLV1_DO 0x64
#define MPU9150_I2C_MST_DELAY_CTRL 0x67
#define MPU9150_USER_CTRL 0x6a
#define MPU9150_PWR_MGMT_1 0x6b
#define MPU9150_PWR_MGMT_2 0x6c
#define MPU9150_FIFO_COUNT_H 0x72
#define MPU9150_FIFO_R_W 0x74
#define MPU9150_WHO_AM_I 0x75
// sample rate defines (applies to gyros and accels, not mags)
#define MPU9150_SAMPLERATE_MIN 5 // 5 samples per second is the lowest
#define MPU9150_SAMPLERATE_MAX 1000 // 1000 samples per second is the absolute maximum
// compass rate defines
#define MPU9150_COMPASSRATE_MIN 1 // 1 samples per second is the lowest
#define MPU9150_COMPASSRATE_MAX 100 // 100 samples per second is maximum
// LPF options (gyros and accels)
#define MPU9150_LPF_256 0 // gyro: 256Hz, accel: 260Hz
#define MPU9150_LPF_188 1 // gyro: 188Hz, accel: 184Hz
#define MPU9150_LPF_98 2 // gyro: 98Hz, accel: 98Hz
#define MPU9150_LPF_42 3 // gyro: 42Hz, accel: 44Hz
#define MPU9150_LPF_20 4 // gyro: 20Hz, accel: 21Hz
#define MPU9150_LPF_10 5 // gyro: 10Hz, accel: 10Hz
#define MPU9150_LPF_5 6 // gyro: 5Hz, accel: 5Hz
// Gyro FSR options
#define MPU9150_GYROFSR_250 0 // +/- 250 degrees per second
#define MPU9150_GYROFSR_500 8 // +/- 500 degrees per second
#define MPU9150_GYROFSR_1000 0x10 // +/- 1000 degrees per second
#define MPU9150_GYROFSR_2000 0x18 // +/- 2000 degrees per second
// Accel FSR options
#define MPU9150_ACCELFSR_2 0 // +/- 2g
#define MPU9150_ACCELFSR_4 8 // +/- 4g
#define MPU9150_ACCELFSR_8 0x10 // +/- 8g
#define MPU9150_ACCELFSR_16 0x18 // +/- 16g
// AK8975 compass registers
#define AK8975_DEVICEID 0x0 // the device ID
#define AK8975_ST1 0x02 // status 1
#define AK8975_CNTL 0x0a // control reg
#define AK8975_ASAX 0x10 // start of the fuse ROM data
// HMC5883 compass registers
#define HMC5883_CONFIG_A 0x00 // configuration A
#define HMC5883_CONFIG_B 0x01 // configuration B
#define HMC5883_MODE 0x02 // mode
#define HMC5883_DATA_X_HI 0x03 // data x msb
#define HMC5883_STATUS 0x09 // status
#define HMC5883_ID 0x0a // id
//----------------------------------------------------------
//
// MPU-9250
// MPU9250 I2C Slave Addresses
#define MPU9250_ADDRESS0 0x68
#define MPU9250_ADDRESS1 0x69
#define MPU9250_ID 0x71
#define AK8963_ADDRESS 0x0c
// Register map
#define MPU9250_SMPRT_DIV 0x19
#define MPU9250_GYRO_LPF 0x1a
#define MPU9250_GYRO_CONFIG 0x1b
#define MPU9250_ACCEL_CONFIG 0x1c
#define MPU9250_ACCEL_LPF 0x1d
#define MPU9250_FIFO_EN 0x23
#define MPU9250_I2C_MST_CTRL 0x24
#define MPU9250_I2C_SLV0_ADDR 0x25
#define MPU9250_I2C_SLV0_REG 0x26
#define MPU9250_I2C_SLV0_CTRL 0x27
#define MPU9250_I2C_SLV1_ADDR 0x28
#define MPU9250_I2C_SLV1_REG 0x29
#define MPU9250_I2C_SLV1_CTRL 0x2a
#define MPU9250_I2C_SLV2_ADDR 0x2b
#define MPU9250_I2C_SLV2_REG 0x2c
#define MPU9250_I2C_SLV2_CTRL 0x2d
#define MPU9250_I2C_SLV4_CTRL 0x34
#define MPU9250_INT_PIN_CFG 0x37
#define MPU9250_INT_ENABLE 0x38
#define MPU9250_INT_STATUS 0x3a
#define MPU9250_ACCEL_XOUT_H 0x3b
#define MPU9250_GYRO_XOUT_H 0x43
#define MPU9250_EXT_SENS_DATA_00 0x49
#define MPU9250_I2C_SLV1_DO 0x64
#define MPU9250_I2C_MST_DELAY_CTRL 0x67
#define MPU9250_USER_CTRL 0x6a
#define MPU9250_PWR_MGMT_1 0x6b
#define MPU9250_PWR_MGMT_2 0x6c
#define MPU9250_FIFO_COUNT_H 0x72
#define MPU9250_FIFO_R_W 0x74
#define MPU9250_WHO_AM_I 0x75
// sample rate defines (applies to gyros and accels, not mags)
#define MPU9250_SAMPLERATE_MIN 5 // 5 samples per second is the lowest
#define MPU9250_SAMPLERATE_MAX 32000 // 32000 samples per second is the absolute maximum
// compass rate defines
#define MPU9250_COMPASSRATE_MIN 1 // 1 samples per second is the lowest
#define MPU9250_COMPASSRATE_MAX 100 // 100 samples per second is maximum
// Gyro LPF options
#define MPU9250_GYRO_LPF_8800 0x11 // 8800Hz, 0.64mS delay
#define MPU9250_GYRO_LPF_3600 0x10 // 3600Hz, 0.11mS delay
#define MPU9250_GYRO_LPF_250 0x00 // 250Hz, 0.97mS delay
#define MPU9250_GYRO_LPF_184 0x01 // 184Hz, 2.9mS delay
#define MPU9250_GYRO_LPF_92 0x02 // 92Hz, 3.9mS delay
#define MPU9250_GYRO_LPF_41 0x03 // 41Hz, 5.9mS delay
#define MPU9250_GYRO_LPF_20 0x04 // 20Hz, 9.9mS delay
#define MPU9250_GYRO_LPF_10 0x05 // 10Hz, 17.85mS delay
#define MPU9250_GYRO_LPF_5 0x06 // 5Hz, 33.48mS delay
// Gyro FSR options
#define MPU9250_GYROFSR_250 0 // +/- 250 degrees per second
#define MPU9250_GYROFSR_500 8 // +/- 500 degrees per second
#define MPU9250_GYROFSR_1000 0x10 // +/- 1000 degrees per second
#define MPU9250_GYROFSR_2000 0x18 // +/- 2000 degrees per second
// Accel FSR options
#define MPU9250_ACCELFSR_2 0 // +/- 2g
#define MPU9250_ACCELFSR_4 8 // +/- 4g
#define MPU9250_ACCELFSR_8 0x10 // +/- 8g
#define MPU9250_ACCELFSR_16 0x18 // +/- 16g
// Accel LPF options
#define MPU9250_ACCEL_LPF_1130 0x08 // 1130Hz, 0.75mS delay
#define MPU9250_ACCEL_LPF_460 0x00 // 460Hz, 1.94mS delay
#define MPU9250_ACCEL_LPF_184 0x01 // 184Hz, 5.80mS delay
#define MPU9250_ACCEL_LPF_92 0x02 // 92Hz, 7.80mS delay
#define MPU9250_ACCEL_LPF_41 0x03 // 41Hz, 11.80mS delay
#define MPU9250_ACCEL_LPF_20 0x04 // 20Hz, 19.80mS delay
#define MPU9250_ACCEL_LPF_10 0x05 // 10Hz, 35.70mS delay
#define MPU9250_ACCEL_LPF_5 0x06 // 5Hz, 66.96mS delay
// AK8963 compass registers
#define AK8963_DEVICEID 0x48 // the device ID
#define AK8963_ST1 0x02 // status 1
#define AK8963_CNTL 0x0a // control reg
#define AK8963_ASAX 0x10 // start of the fuse ROM data
//----------------------------------------------------------
//
// L3GD20
// I2C Slave Addresses
#define L3GD20_ADDRESS0 0x6a
#define L3GD20_ADDRESS1 0x6b
#define L3GD20_ID 0xd4
// L3GD20 Register map
#define L3GD20_WHO_AM_I 0x0f
#define L3GD20_CTRL1 0x20
#define L3GD20_CTRL2 0x21
#define L3GD20_CTRL3 0x22
#define L3GD20_CTRL4 0x23
#define L3GD20_CTRL5 0x24
#define L3GD20_OUT_TEMP 0x26
#define L3GD20_STATUS 0x27
#define L3GD20_OUT_X_L 0x28
#define L3GD20_OUT_X_H 0x29
#define L3GD20_OUT_Y_L 0x2a
#define L3GD20_OUT_Y_H 0x2b
#define L3GD20_OUT_Z_L 0x2c
#define L3GD20_OUT_Z_H 0x2d
#define L3GD20_FIFO_CTRL 0x2e
#define L3GD20_FIFO_SRC 0x2f
#define L3GD20_IG_CFG 0x30
#define L3GD20_IG_SRC 0x31
#define L3GD20_IG_THS_XH 0x32
#define L3GD20_IG_THS_XL 0x33
#define L3GD20_IG_THS_YH 0x34
#define L3GD20_IG_THS_YL 0x35
#define L3GD20_IG_THS_ZH 0x36
#define L3GD20_IG_THS_ZL 0x37
#define L3GD20_IG_DURATION 0x38
// Gyro sample rate defines
#define L3GD20_SAMPLERATE_95 0
#define L3GD20_SAMPLERATE_190 1
#define L3GD20_SAMPLERATE_380 2
#define L3GD20_SAMPLERATE_760 3
// Gyro banwidth defines
#define L3GD20_BANDWIDTH_0 0
#define L3GD20_BANDWIDTH_1 1
#define L3GD20_BANDWIDTH_2 2
#define L3GD20_BANDWIDTH_3 3
// Gyro FSR defines
#define L3GD20_FSR_250 0
#define L3GD20_FSR_500 1
#define L3GD20_FSR_2000 2
// Gyro high pass filter defines
#define L3GD20_HPF_0 0
#define L3GD20_HPF_1 1
#define L3GD20_HPF_2 2
#define L3GD20_HPF_3 3
#define L3GD20_HPF_4 4
#define L3GD20_HPF_5 5
#define L3GD20_HPF_6 6
#define L3GD20_HPF_7 7
#define L3GD20_HPF_8 8
#define L3GD20_HPF_9 9
//----------------------------------------------------------
//
// L3GD20H
// I2C Slave Addresses
#define L3GD20H_ADDRESS0 0x6a
#define L3GD20H_ADDRESS1 0x6b
#define L3GD20H_ID 0xd7
// L3GD20H Register map
#define L3GD20H_WHO_AM_I 0x0f
#define L3GD20H_CTRL1 0x20
#define L3GD20H_CTRL2 0x21
#define L3GD20H_CTRL3 0x22
#define L3GD20H_CTRL4 0x23
#define L3GD20H_CTRL5 0x24
#define L3GD20H_OUT_TEMP 0x26
#define L3GD20H_STATUS 0x27
#define L3GD20H_OUT_X_L 0x28
#define L3GD20H_OUT_X_H 0x29
#define L3GD20H_OUT_Y_L 0x2a
#define L3GD20H_OUT_Y_H 0x2b
#define L3GD20H_OUT_Z_L 0x2c
#define L3GD20H_OUT_Z_H 0x2d
#define L3GD20H_FIFO_CTRL 0x2e
#define L3GD20H_FIFO_SRC 0x2f
#define L3GD20H_IG_CFG 0x30
#define L3GD20H_IG_SRC 0x31
#define L3GD20H_IG_THS_XH 0x32
#define L3GD20H_IG_THS_XL 0x33
#define L3GD20H_IG_THS_YH 0x34
#define L3GD20H_IG_THS_YL 0x35
#define L3GD20H_IG_THS_ZH 0x36
#define L3GD20H_IG_THS_ZL 0x37
#define L3GD20H_IG_DURATION 0x38
#define L3GD20H_LOW_ODR 0x39
// Gyro sample rate defines
#define L3GD20H_SAMPLERATE_12_5 0
#define L3GD20H_SAMPLERATE_25 1
#define L3GD20H_SAMPLERATE_50 2
#define L3GD20H_SAMPLERATE_100 3
#define L3GD20H_SAMPLERATE_200 4
#define L3GD20H_SAMPLERATE_400 5
#define L3GD20H_SAMPLERATE_800 6
// Gyro banwidth defines
#define L3GD20H_BANDWIDTH_0 0
#define L3GD20H_BANDWIDTH_1 1
#define L3GD20H_BANDWIDTH_2 2
#define L3GD20H_BANDWIDTH_3 3
// Gyro FSR defines
#define L3GD20H_FSR_245 0
#define L3GD20H_FSR_500 1
#define L3GD20H_FSR_2000 2
// Gyro high pass filter defines
#define L3GD20H_HPF_0 0
#define L3GD20H_HPF_1 1
#define L3GD20H_HPF_2 2
#define L3GD20H_HPF_3 3
#define L3GD20H_HPF_4 4
#define L3GD20H_HPF_5 5
#define L3GD20H_HPF_6 6
#define L3GD20H_HPF_7 7
#define L3GD20H_HPF_8 8
#define L3GD20H_HPF_9 9
//----------------------------------------------------------
//
// LSM303D
#define LSM303D_ADDRESS0 0x1e
#define LSM303D_ADDRESS1 0x1d
#define LSM303D_ID 0x49
// LSM303D Register Map
#define LSM303D_TEMP_OUT_L 0x05
#define LSM303D_TEMP_OUT_H 0x06
#define LSM303D_STATUS_M 0x07
#define LSM303D_OUT_X_L_M 0x08
#define LSM303D_OUT_X_H_M 0x09
#define LSM303D_OUT_Y_L_M 0x0a
#define LSM303D_OUT_Y_H_M 0x0b
#define LSM303D_OUT_Z_L_M 0x0c
#define LSM303D_OUT_Z_H_M 0x0d
#define LSM303D_WHO_AM_I 0x0f
#define LSM303D_INT_CTRL_M 0x12
#define LSM303D_INT_SRC_M 0x13
#define LSM303D_INT_THS_L_M 0x14
#define LSM303D_INT_THS_H_M 0x15
#define LSM303D_OFFSET_X_L_M 0x16
#define LSM303D_OFFSET_X_H_M 0x17
#define LSM303D_OFFSET_Y_L_M 0x18
#define LSM303D_OFFSET_Y_H_M 0x19
#define LSM303D_OFFSET_Z_L_M 0x1a
#define LSM303D_OFFSET_Z_H_M 0x1b
#define LSM303D_REFERENCE_X 0x1c
#define LSM303D_REFERENCE_Y 0x1d
#define LSM303D_REFERENCE_Z 0x1e
#define LSM303D_CTRL0 0x1f
#define LSM303D_CTRL1 0x20
#define LSM303D_CTRL2 0x21
#define LSM303D_CTRL3 0x22
#define LSM303D_CTRL4 0x23
#define LSM303D_CTRL5 0x24
#define LSM303D_CTRL6 0x25
#define LSM303D_CTRL7 0x26
#define LSM303D_STATUS_A 0x27
#define LSM303D_OUT_X_L_A 0x28
#define LSM303D_OUT_X_H_A 0x29
#define LSM303D_OUT_Y_L_A 0x2a
#define LSM303D_OUT_Y_H_A 0x2b
#define LSM303D_OUT_Z_L_A 0x2c
#define LSM303D_OUT_Z_H_A 0x2d
#define LSM303D_FIFO_CTRL 0x2e
#define LSM303D_FIFO_SRC 0x2f
#define LSM303D_IG_CFG1 0x30
#define LSM303D_IG_SRC1 0x31
#define LSM303D_IG_THS1 0x32
#define LSM303D_IG_DUR1 0x33
#define LSM303D_IG_CFG2 0x34
#define LSM303D_IG_SRC2 0x35
#define LSM303D_IG_THS2 0x36
#define LSM303D_IG_DUR2 0x37
#define LSM303D_CLICK_CFG 0x38
#define LSM303D_CLICK_SRC 0x39
#define LSM303D_CLICK_THS 0x3a
#define LSM303D_TIME_LIMIT 0x3b
#define LSM303D_TIME_LATENCY 0x3c
#define LSM303D_TIME_WINDOW 0x3d
#define LSM303D_ACT_THIS 0x3e
#define LSM303D_ACT_DUR 0x3f
// Accel sample rate defines
#define LSM303D_ACCEL_SAMPLERATE_3_125 1
#define LSM303D_ACCEL_SAMPLERATE_6_25 2
#define LSM303D_ACCEL_SAMPLERATE_12_5 3
#define LSM303D_ACCEL_SAMPLERATE_25 4
#define LSM303D_ACCEL_SAMPLERATE_50 5
#define LSM303D_ACCEL_SAMPLERATE_100 6
#define LSM303D_ACCEL_SAMPLERATE_200 7
#define LSM303D_ACCEL_SAMPLERATE_400 8
#define LSM303D_ACCEL_SAMPLERATE_800 9
#define LSM303D_ACCEL_SAMPLERATE_1600 10
// Accel FSR
#define LSM303D_ACCEL_FSR_2 0
#define LSM303D_ACCEL_FSR_4 1
#define LSM303D_ACCEL_FSR_6 2
#define LSM303D_ACCEL_FSR_8 3
#define LSM303D_ACCEL_FSR_16 4
// Accel filter bandwidth
#define LSM303D_ACCEL_LPF_773 0
#define LSM303D_ACCEL_LPF_194 1
#define LSM303D_ACCEL_LPF_362 2
#define LSM303D_ACCEL_LPF_50 3
// Compass sample rate defines
#define LSM303D_COMPASS_SAMPLERATE_3_125 0
#define LSM303D_COMPASS_SAMPLERATE_6_25 1
#define LSM303D_COMPASS_SAMPLERATE_12_5 2
#define LSM303D_COMPASS_SAMPLERATE_25 3
#define LSM303D_COMPASS_SAMPLERATE_50 4
#define LSM303D_COMPASS_SAMPLERATE_100 5
// Compass FSR
#define LSM303D_COMPASS_FSR_2 0
#define LSM303D_COMPASS_FSR_4 1
#define LSM303D_COMPASS_FSR_8 2
#define LSM303D_COMPASS_FSR_12 3
//----------------------------------------------------------
//
// LSM303DLHC
#define LSM303DLHC_ACCEL_ADDRESS 0x19
#define LSM303DLHC_COMPASS_ADDRESS 0x1e
// LSM303DLHC Accel Register Map
#define LSM303DLHC_CTRL1_A 0x20
#define LSM303DLHC_CTRL2_A 0x21
#define LSM303DLHC_CTRL3_A 0x22
#define LSM303DLHC_CTRL4_A 0x23
#define LSM303DLHC_CTRL5_A 0x24
#define LSM303DLHC_CTRL6_A 0x25
#define LSM303DLHC_REF_A 0x26
#define LSM303DLHC_STATUS_A 0x27
#define LSM303DLHC_OUT_X_L_A 0x28
#define LSM303DLHC_OUT_X_H_A 0x29
#define LSM303DLHC_OUT_Y_L_A 0x2a
#define LSM303DLHC_OUT_Y_H_A 0x2b
#define LSM303DLHC_OUT_Z_L_A 0x2c
#define LSM303DLHC_OUT_Z_H_A 0x2d
#define LSM303DLHC_FIFO_CTRL_A 0x2e
#define LSM303DLHC_FIFO_SRC_A 0x2f
// LSM303DLHC Compass Register Map
#define LSM303DLHC_CRA_M 0x00
#define LSM303DLHC_CRB_M 0x01
#define LSM303DLHC_CRM_M 0x02
#define LSM303DLHC_OUT_X_H_M 0x03
#define LSM303DLHC_OUT_X_L_M 0x04
#define LSM303DLHC_OUT_Y_H_M 0x05
#define LSM303DLHC_OUT_Y_L_M 0x06
#define LSM303DLHC_OUT_Z_H_M 0x07
#define LSM303DLHC_OUT_Z_L_M 0x08
#define LSM303DLHC_STATUS_M 0x09
#define LSM303DLHC_TEMP_OUT_L_M 0x31
#define LSM303DLHC_TEMP_OUT_H_M 0x32
// Accel sample rate defines
#define LSM303DLHC_ACCEL_SAMPLERATE_1 1
#define LSM303DLHC_ACCEL_SAMPLERATE_10 2
#define LSM303DLHC_ACCEL_SAMPLERATE_25 3
#define LSM303DLHC_ACCEL_SAMPLERATE_50 4
#define LSM303DLHC_ACCEL_SAMPLERATE_100 5
#define LSM303DLHC_ACCEL_SAMPLERATE_200 6
#define LSM303DLHC_ACCEL_SAMPLERATE_400 7
// Accel FSR
#define LSM303DLHC_ACCEL_FSR_2 0
#define LSM303DLHC_ACCEL_FSR_4 1
#define LSM303DLHC_ACCEL_FSR_8 2
#define LSM303DLHC_ACCEL_FSR_16 3
// Compass sample rate defines
#define LSM303DLHC_COMPASS_SAMPLERATE_0_75 0
#define LSM303DLHC_COMPASS_SAMPLERATE_1_5 1
#define LSM303DLHC_COMPASS_SAMPLERATE_3 2
#define LSM303DLHC_COMPASS_SAMPLERATE_7_5 3
#define LSM303DLHC_COMPASS_SAMPLERATE_15 4
#define LSM303DLHC_COMPASS_SAMPLERATE_30 5
#define LSM303DLHC_COMPASS_SAMPLERATE_75 6
#define LSM303DLHC_COMPASS_SAMPLERATE_220 7
// Compass FSR
#define LSM303DLHC_COMPASS_FSR_1_3 1
#define LSM303DLHC_COMPASS_FSR_1_9 2
#define LSM303DLHC_COMPASS_FSR_2_5 3
#define LSM303DLHC_COMPASS_FSR_4 4
#define LSM303DLHC_COMPASS_FSR_4_7 5
#define LSM303DLHC_COMPASS_FSR_5_6 6
#define LSM303DLHC_COMPASS_FSR_8_1 7
//----------------------------------------------------------
//
// LSM9DS0
// I2C Slave Addresses
#define LSM9DS0_GYRO_ADDRESS0 0x6a
#define LSM9DS0_GYRO_ADDRESS1 0x6b
#define LSM9DS0_GYRO_ID 0xd4
#define LSM9DS0_ACCELMAG_ADDRESS0 0x1e
#define LSM9DS0_ACCELMAG_ADDRESS1 0x1d
#define LSM9DS0_ACCELMAG_ID 0x49
// LSM9DS0 Register map
#define LSM9DS0_GYRO_WHO_AM_I 0x0f
#define LSM9DS0_GYRO_CTRL1 0x20
#define LSM9DS0_GYRO_CTRL2 0x21
#define LSM9DS0_GYRO_CTRL3 0x22
#define LSM9DS0_GYRO_CTRL4 0x23
#define LSM9DS0_GYRO_CTRL5 0x24
#define LSM9DS0_GYRO_OUT_TEMP 0x26
#define LSM9DS0_GYRO_STATUS 0x27
#define LSM9DS0_GYRO_OUT_X_L 0x28
#define LSM9DS0_GYRO_OUT_X_H 0x29
#define LSM9DS0_GYRO_OUT_Y_L 0x2a
#define LSM9DS0_GYRO_OUT_Y_H 0x2b
#define LSM9DS0_GYRO_OUT_Z_L 0x2c
#define LSM9DS0_GYRO_OUT_Z_H 0x2d
#define LSM9DS0_GYRO_FIFO_CTRL 0x2e
#define LSM9DS0_GYRO_FIFO_SRC 0x2f
#define LSM9DS0_GYRO_IG_CFG 0x30
#define LSM9DS0_GYRO_IG_SRC 0x31
#define LSM9DS0_GYRO_IG_THS_XH 0x32
#define LSM9DS0_GYRO_IG_THS_XL 0x33
#define LSM9DS0_GYRO_IG_THS_YH 0x34
#define LSM9DS0_GYRO_IG_THS_YL 0x35
#define LSM9DS0_GYRO_IG_THS_ZH 0x36
#define LSM9DS0_GYRO_IG_THS_ZL 0x37
#define LSM9DS0_GYRO_IG_DURATION 0x38
// Gyro sample rate defines
#define LSM9DS0_GYRO_SAMPLERATE_95 0
#define LSM9DS0_GYRO_SAMPLERATE_190 1
#define LSM9DS0_GYRO_SAMPLERATE_380 2
#define LSM9DS0_GYRO_SAMPLERATE_760 3
// Gyro banwidth defines
#define LSM9DS0_GYRO_BANDWIDTH_0 0
#define LSM9DS0_GYRO_BANDWIDTH_1 1
#define LSM9DS0_GYRO_BANDWIDTH_2 2
#define LSM9DS0_GYRO_BANDWIDTH_3 3
// Gyro FSR defines
#define LSM9DS0_GYRO_FSR_250 0
#define LSM9DS0_GYRO_FSR_500 1
#define LSM9DS0_GYRO_FSR_2000 2
// Gyro high pass filter defines
#define LSM9DS0_GYRO_HPF_0 0
#define LSM9DS0_GYRO_HPF_1 1
#define LSM9DS0_GYRO_HPF_2 2
#define LSM9DS0_GYRO_HPF_3 3
#define LSM9DS0_GYRO_HPF_4 4
#define LSM9DS0_GYRO_HPF_5 5
#define LSM9DS0_GYRO_HPF_6 6
#define LSM9DS0_GYRO_HPF_7 7
#define LSM9DS0_GYRO_HPF_8 8
#define LSM9DS0_GYRO_HPF_9 9
// Accel/Mag Register Map
#define LSM9DS0_TEMP_OUT_L 0x05
#define LSM9DS0_TEMP_OUT_H 0x06
#define LSM9DS0_STATUS_M 0x07
#define LSM9DS0_OUT_X_L_M 0x08
#define LSM9DS0_OUT_X_H_M 0x09
#define LSM9DS0_OUT_Y_L_M 0x0a
#define LSM9DS0_OUT_Y_H_M 0x0b
#define LSM9DS0_OUT_Z_L_M 0x0c
#define LSM9DS0_OUT_Z_H_M 0x0d
#define LSM9DS0_WHO_AM_I 0x0f
#define LSM9DS0_INT_CTRL_M 0x12
#define LSM9DS0_INT_SRC_M 0x13
#define LSM9DS0_INT_THS_L_M 0x14
#define LSM9DS0_INT_THS_H_M 0x15
#define LSM9DS0_OFFSET_X_L_M 0x16
#define LSM9DS0_OFFSET_X_H_M 0x17
#define LSM9DS0_OFFSET_Y_L_M 0x18
#define LSM9DS0_OFFSET_Y_H_M 0x19
#define LSM9DS0_OFFSET_Z_L_M 0x1a
#define LSM9DS0_OFFSET_Z_H_M 0x1b
#define LSM9DS0_REFERENCE_X 0x1c
#define LSM9DS0_REFERENCE_Y 0x1d
#define LSM9DS0_REFERENCE_Z 0x1e
#define LSM9DS0_CTRL0 0x1f
#define LSM9DS0_CTRL1 0x20
#define LSM9DS0_CTRL2 0x21
#define LSM9DS0_CTRL3 0x22
#define LSM9DS0_CTRL4 0x23
#define LSM9DS0_CTRL5 0x24
#define LSM9DS0_CTRL6 0x25
#define LSM9DS0_CTRL7 0x26
#define LSM9DS0_STATUS_A 0x27
#define LSM9DS0_OUT_X_L_A 0x28
#define LSM9DS0_OUT_X_H_A 0x29
#define LSM9DS0_OUT_Y_L_A 0x2a
#define LSM9DS0_OUT_Y_H_A 0x2b
#define LSM9DS0_OUT_Z_L_A 0x2c
#define LSM9DS0_OUT_Z_H_A 0x2d
#define LSM9DS0_FIFO_CTRL 0x2e
#define LSM9DS0_FIFO_SRC 0x2f
#define LSM9DS0_IG_CFG1 0x30
#define LSM9DS0_IG_SRC1 0x31
#define LSM9DS0_IG_THS1 0x32
#define LSM9DS0_IG_DUR1 0x33
#define LSM9DS0_IG_CFG2 0x34
#define LSM9DS0_IG_SRC2 0x35
#define LSM9DS0_IG_THS2 0x36
#define LSM9DS0_IG_DUR2 0x37
#define LSM9DS0_CLICK_CFG 0x38
#define LSM9DS0_CLICK_SRC 0x39
#define LSM9DS0_CLICK_THS 0x3a
#define LSM9DS0_TIME_LIMIT 0x3b
#define LSM9DS0_TIME_LATENCY 0x3c
#define LSM9DS0_TIME_WINDOW 0x3d
#define LSM9DS0_ACT_THIS 0x3e
#define LSM9DS0_ACT_DUR 0x3f
// Accel sample rate defines
#define LSM9DS0_ACCEL_SAMPLERATE_3_125 1
#define LSM9DS0_ACCEL_SAMPLERATE_6_25 2
#define LSM9DS0_ACCEL_SAMPLERATE_12_5 3
#define LSM9DS0_ACCEL_SAMPLERATE_25 4
#define LSM9DS0_ACCEL_SAMPLERATE_50 5
#define LSM9DS0_ACCEL_SAMPLERATE_100 6
#define LSM9DS0_ACCEL_SAMPLERATE_200 7
#define LSM9DS0_ACCEL_SAMPLERATE_400 8
#define LSM9DS0_ACCEL_SAMPLERATE_800 9
#define LSM9DS0_ACCEL_SAMPLERATE_1600 10
// Accel FSR
#define LSM9DS0_ACCEL_FSR_2 0
#define LSM9DS0_ACCEL_FSR_4 1
#define LSM9DS0_ACCEL_FSR_6 2
#define LSM9DS0_ACCEL_FSR_8 3
#define LSM9DS0_ACCEL_FSR_16 4
// Accel filter bandwidth
#define LSM9DS0_ACCEL_LPF_773 0
#define LSM9DS0_ACCEL_LPF_194 1
#define LSM9DS0_ACCEL_LPF_362 2
#define LSM9DS0_ACCEL_LPF_50 3
// Compass sample rate defines
#define LSM9DS0_COMPASS_SAMPLERATE_3_125 0
#define LSM9DS0_COMPASS_SAMPLERATE_6_25 1
#define LSM9DS0_COMPASS_SAMPLERATE_12_5 2
#define LSM9DS0_COMPASS_SAMPLERATE_25 3
#define LSM9DS0_COMPASS_SAMPLERATE_50 4
#define LSM9DS0_COMPASS_SAMPLERATE_100 5
// Compass FSR
#define LSM9DS0_COMPASS_FSR_2 0
#define LSM9DS0_COMPASS_FSR_4 1
#define LSM9DS0_COMPASS_FSR_8 2
#define LSM9DS0_COMPASS_FSR_12 3
//----------------------------------------------------------
//
// LSM9DS1
// I2C Slave Addresses
#define LSM9DS1_ADDRESS0 0x6a
#define LSM9DS1_ADDRESS1 0x6b
#define LSM9DS1_ID 0x68
#define LSM9DS1_MAG_ADDRESS0 0x1c
#define LSM9DS1_MAG_ADDRESS1 0x1d
#define LSM9DS1_MAG_ADDRESS2 0x1e
#define LSM9DS1_MAG_ADDRESS3 0x1f
#define LSM9DS1_MAG_ID 0x3d
// LSM9DS1 Register map
#define LSM9DS1_ACT_THS 0x04
#define LSM9DS1_ACT_DUR 0x05
#define LSM9DS1_INT_GEN_CFG_XL 0x06
#define LSM9DS1_INT_GEN_THS_X_XL 0x07
#define LSM9DS1_INT_GEN_THS_Y_XL 0x08
#define LSM9DS1_INT_GEN_THS_Z_XL 0x09
#define LSM9DS1_INT_GEN_DUR_XL 0x0A
#define LSM9DS1_REFERENCE_G 0x0B
#define LSM9DS1_INT1_CTRL 0x0C
#define LSM9DS1_INT2_CTRL 0x0D
#define LSM9DS1_WHO_AM_I 0x0F
#define LSM9DS1_CTRL1 0x10
#define LSM9DS1_CTRL2 0x11
#define LSM9DS1_CTRL3 0x12
#define LSM9DS1_ORIENT_CFG_G 0x13
#define LSM9DS1_INT_GEN_SRC_G 0x14
#define LSM9DS1_OUT_TEMP_L 0x15
#define LSM9DS1_OUT_TEMP_H 0x16
#define LSM9DS1_STATUS 0x17
#define LSM9DS1_OUT_X_L_G 0x18
#define LSM9DS1_OUT_X_H_G 0x19
#define LSM9DS1_OUT_Y_L_G 0x1A
#define LSM9DS1_OUT_Y_H_G 0x1B
#define LSM9DS1_OUT_Z_L_G 0x1C
#define LSM9DS1_OUT_Z_H_G 0x1D
#define LSM9DS1_CTRL4 0x1E
#define LSM9DS1_CTRL5 0x1F
#define LSM9DS1_CTRL6 0x20
#define LSM9DS1_CTRL7 0x21
#define LSM9DS1_CTRL8 0x22
#define LSM9DS1_CTRL9 0x23
#define LSM9DS1_CTRL10 0x24
#define LSM9DS1_INT_GEN_SRC_XL 0x26
#define LSM9DS1_STATUS2 0x27
#define LSM9DS1_OUT_X_L_XL 0x28
#define LSM9DS1_OUT_X_H_XL 0x29
#define LSM9DS1_OUT_Y_L_XL 0x2A
#define LSM9DS1_OUT_Y_H_XL 0x2B
#define LSM9DS1_OUT_Z_L_XL 0x2C
#define LSM9DS1_OUT_Z_H_XL 0x2D
#define LSM9DS1_FIFO_CTRL 0x2E
#define LSM9DS1_FIFO_SRC 0x2F
#define LSM9DS1_INT_GEN_CFG_G 0x30
#define LSM9DS1_INT_GEN_THS_XH_G 0x31
#define LSM9DS1_INT_GEN_THS_XL_G 0x32
#define LSM9DS1_INT_GEN_THS_YH_G 0x33
#define LSM9DS1_INT_GEN_THS_YL_G 0x34
#define LSM9DS1_INT_GEN_THS_ZH_G 0x35
#define LSM9DS1_INT_GEN_THS_ZL_G 0x36
#define LSM9DS1_INT_GEN_DUR_G 0x37
// Gyro sample rate defines
#define LSM9DS1_GYRO_SAMPLERATE_14_9 0
#define LSM9DS1_GYRO_SAMPLERATE_59_5 1
#define LSM9DS1_GYRO_SAMPLERATE_119 2
#define LSM9DS1_GYRO_SAMPLERATE_238 3
#define LSM9DS1_GYRO_SAMPLERATE_476 4
#define LSM9DS1_GYRO_SAMPLERATE_952 5
// Gyro banwidth defines
#define LSM9DS1_GYRO_BANDWIDTH_0 0
#define LSM9DS1_GYRO_BANDWIDTH_1 1
#define LSM9DS1_GYRO_BANDWIDTH_2 2
#define LSM9DS1_GYRO_BANDWIDTH_3 3
// Gyro FSR defines
#define LSM9DS1_GYRO_FSR_250 0
#define LSM9DS1_GYRO_FSR_500 1
#define LSM9DS1_GYRO_FSR_2000 2
// Gyro high pass filter defines
#define LSM9DS1_GYRO_HPF_0 0
#define LSM9DS1_GYRO_HPF_1 1
#define LSM9DS1_GYRO_HPF_2 2
#define LSM9DS1_GYRO_HPF_3 3
#define LSM9DS1_GYRO_HPF_4 4
#define LSM9DS1_GYRO_HPF_5 5
#define LSM9DS1_GYRO_HPF_6 6
#define LSM9DS1_GYRO_HPF_7 7
#define LSM9DS1_GYRO_HPF_8 8
#define LSM9DS1_GYRO_HPF_9 9
// Mag Register Map
#define LSM9DS1_MAG_OFFSET_X_L 0x05
#define LSM9DS1_MAG_OFFSET_X_H 0x06
#define LSM9DS1_MAG_OFFSET_Y_L 0x07
#define LSM9DS1_MAG_OFFSET_Y_H 0x08
#define LSM9DS1_MAG_OFFSET_Z_L 0x09
#define LSM9DS1_MAG_OFFSET_Z_H 0x0A
#define LSM9DS1_MAG_WHO_AM_I 0x0F
#define LSM9DS1_MAG_CTRL1 0x20
#define LSM9DS1_MAG_CTRL2 0x21
#define LSM9DS1_MAG_CTRL3 0x22
#define LSM9DS1_MAG_CTRL4 0x23
#define LSM9DS1_MAG_CTRL5 0x24
#define LSM9DS1_MAG_STATUS 0x27
#define LSM9DS1_MAG_OUT_X_L 0x28
#define LSM9DS1_MAG_OUT_X_H 0x29
#define LSM9DS1_MAG_OUT_Y_L 0x2A
#define LSM9DS1_MAG_OUT_Y_H 0x2B
#define LSM9DS1_MAG_OUT_Z_L 0x2C
#define LSM9DS1_MAG_OUT_Z_H 0x2D
#define LSM9DS1_MAG_INT_CFG 0x30
#define LSM9DS1_MAG_INT_SRC 0x31
#define LSM9DS1_MAG_INT_THS_L 0x32
#define LSM9DS1_MAG_INT_THS_H 0x33
// Accel sample rate defines
#define LSM9DS1_ACCEL_SAMPLERATE_14_9 1
#define LSM9DS1_ACCEL_SAMPLERATE_59_5 2
#define LSM9DS1_ACCEL_SAMPLERATE_119 3
#define LSM9DS1_ACCEL_SAMPLERATE_238 4
#define LSM9DS1_ACCEL_SAMPLERATE_476 5
#define LSM9DS1_ACCEL_SAMPLERATE_952 6
// Accel FSR
#define LSM9DS1_ACCEL_FSR_2 0
#define LSM9DS1_ACCEL_FSR_16 1
#define LSM9DS1_ACCEL_FSR_4 2
#define LSM9DS1_ACCEL_FSR_8 3
// Accel filter bandwidth
#define LSM9DS1_ACCEL_LPF_408 0
#define LSM9DS1_ACCEL_LPF_211 1
#define LSM9DS1_ACCEL_LPF_105 2
#define LSM9DS1_ACCEL_LPF_50 3
// Compass sample rate defines
#define LSM9DS1_COMPASS_SAMPLERATE_0_625 0
#define LSM9DS1_COMPASS_SAMPLERATE_1_25 1
#define LSM9DS1_COMPASS_SAMPLERATE_2_5 2
#define LSM9DS1_COMPASS_SAMPLERATE_5 3
#define LSM9DS1_COMPASS_SAMPLERATE_10 4
#define LSM9DS1_COMPASS_SAMPLERATE_20 5
#define LSM9DS1_COMPASS_SAMPLERATE_40 6
#define LSM9DS1_COMPASS_SAMPLERATE_80 7
// Compass FSR
#define LSM9DS1_COMPASS_FSR_4 0
#define LSM9DS1_COMPASS_FSR_8 1
#define LSM9DS1_COMPASS_FSR_12 2
#define LSM9DS1_COMPASS_FSR_16 3
//----------------------------------------------------------
//
// BMX055
// I2C Slave Addresses
#define BMX055_GYRO_ADDRESS0 0x68
#define BMX055_GYRO_ADDRESS1 0x69
#define BMX055_GYRO_ID 0x0f
#define BMX055_ACCEL_ADDRESS0 0x18
#define BMX055_ACCEL_ADDRESS1 0x19
#define BMX055_ACCEL_ID 0xfa
#define BMX055_MAG_ADDRESS0 0x10
#define BMX055_MAG_ADDRESS1 0x11
#define BMX055_MAG_ADDRESS2 0x12
#define BMX055_MAG_ADDRESS3 0x13
#define BMX055_MAG_ID 0x32
// BMX055 Register map
#define BMX055_GYRO_WHO_AM_I 0x00
#define BMX055_GYRO_X_LSB 0x02
#define BMX055_GYRO_X_MSB 0x03
#define BMX055_GYRO_Y_LSB 0x04
#define BMX055_GYRO_Y_MSB 0x05
#define BMX055_GYRO_Z_LSB 0x06
#define BMX055_GYRO_Z_MSB 0x07
#define BMX055_GYRO_INT_STATUS_0 0x09
#define BMX055_GYRO_INT_STATUS_1 0x0a
#define BMX055_GYRO_INT_STATUS_2 0x0b
#define BMX055_GYRO_INT_STATUS_3 0x0c
#define BMX055_GYRO_FIFO_STATUS 0x0e
#define BMX055_GYRO_RANGE 0x0f
#define BMX055_GYRO_BW 0x10
#define BMX055_GYRO_LPM1 0x11
#define BMX055_GYRO_LPM2 0x12
#define BMX055_GYRO_RATE_HBW 0x13
#define BMX055_GYRO_SOFT_RESET 0x14
#define BMX055_GYRO_INT_EN_0 0x15
#define BMX055_GYRO_1A 0x1a
#define BMX055_GYRO_1B 0x1b
#define BMX055_GYRO_SOC 0x31
#define BMX055_GYRO_FOC 0x32
#define BMX055_GYRO_FIFO_CONFIG_0 0x3d
#define BMX055_GYRO_FIFO_CONFIG_1 0x3e
#define BMX055_GYRO_FIFO_DATA 0x3f
#define BMX055_ACCEL_WHO_AM_I 0x00
#define BMX055_ACCEL_X_LSB 0x02
#define BMX055_ACCEL_X_MSB 0x03
#define BMX055_ACCEL_Y_LSB 0x04
#define BMX055_ACCEL_Y_MSB 0x05
#define BMX055_ACCEL_Z_LSB 0x06
#define BMX055_ACCEL_Z_MSB 0x07
#define BMX055_ACCEL_TEMP 0x08
#define BMX055_ACCEL_INT_STATUS_0 0x09
#define BMX055_ACCEL_INT_STATUS_1 0x0a
#define BMX055_ACCEL_INT_STATUS_2 0x0b
#define BMX055_ACCEL_INT_STATUS_3 0x0c
#define BMX055_ACCEL_FIFO_STATUS 0x0e
#define BMX055_ACCEL_PMU_RANGE 0x0f
#define BMX055_ACCEL_PMU_BW 0x10
#define BMX055_ACCEL_PMU_LPW 0x11
#define BMX055_ACCEL_PMU_LOW_POWER 0x12
#define BMX055_ACCEL_HBW 0x13
#define BMX055_ACCEL_SOFT_RESET 0x14
#define BMX055_ACCEL_FIFO_CONFIG_0 0x30
#define BMX055_ACCEL_OFC_CTRL 0x36