-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfxos8700.h
3243 lines (2519 loc) · 123 KB
/
fxos8700.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
/*
* Copyright (c) 2016, Freescale Semiconductor, Inc.
* Copyright 2016-2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @file fxos8700.h
* @brief The fxos8700.h file contains the register definitions for FXOS8700 sensor driver.
*/
#ifndef FXOS8700_H_
#define FXOS8700_H_
/**
* @brief FXOS8700 internal register addresses explained in the FXOS8700 data sheet.
*/
enum {
FXOS8700_STATUS = 0x00, /*!< Alias for ::FXOS8700_DR_STATUS or ::FXOS8700_F_STATUS. */
FXOS8700_OUT_X_MSB = 0x01, /*!< 14-bit X-axis measurement data bits 13:6. */
FXOS8700_OUT_X_LSB = 0x02, /*!< 14-bit X-axis measurement data bits 5:0. */
FXOS8700_OUT_Y_MSB = 0x03, /*!< 14-bit Y-axis measurement data bits 13:6. */
FXOS8700_OUT_Y_LSB = 0x04, /*!< 14-bit Y-axis measurement data bits 5:0. */
FXOS8700_OUT_Z_MSB = 0x05, /*!< 14-bit Z-axis measurement data bits 13:6. */
FXOS8700_OUT_Z_LSB = 0x06, /*!< 14-bit Z-axis measurement data bits 5:0. */
FXOS8700_F_SETUP = 0x09, /*!< FIFO setup. */
FXOS8700_TRIG_CFG = 0x0A, /*!< FIFO event trigger configuration register. */
FXOS8700_SYSMOD = 0x0B, /*!< Current system mode. */
FXOS8700_INT_SOURCE = 0x0C, /*!< Interrupt status. */
FXOS8700_WHO_AM_I = 0x0D, /*!< Device ID. */
FXOS8700_XYZ_DATA_CFG = 0x0E, /*!< Acceleration dynamic range and filter enable settings. */
FXOS8700_HP_FILTER_CUTOFF = 0x0F, /*!< Pulse detection highpass and lowpass filter enabling bits. */
FXOS8700_PL_STATUS = 0x10, /*!< Landscape/portrait orientation status. */
FXOS8700_PL_CFG = 0x11, /*!< Landscape/portrait configuration. */
FXOS8700_PL_COUNT = 0x12, /*!< Landscape/portrait debounce counter. */
FXOS8700_PL_BF_ZCOMP = 0x13, /*!< Back/front trip angle threshold. */
FXOS8700_PL_THS_REG = 0x14, /*!< Portrait to landscape trip threshold angle and hysteresis settings. */
FXOS8700_A_FFMT_CFG = 0x15, /*!< Freefall/motion function configuration. */
FXOS8700_A_FFMT_SRC = 0x16, /*!< Freefall/motion event source register. */
FXOS8700_A_FFMT_THS = 0x17, /*!< Freefall/motion threshold register. */
FXOS8700_A_FFMT_COUNT = 0x18, /*!< Freefall/motion debounce counter. */
FXOS8700_TRANSIENT_CFG = 0x1D, /*!< Transient function configuration. */
FXOS8700_TRANSIENT_SRC = 0x1E, /*!< Transient event status register. */
FXOS8700_TRANSIENT_THS = 0x1F, /*!< Transient event threshold. */
FXOS8700_TRANSIENT_COUNT = 0x20, /*!< Transient debounce counter. */
FXOS8700_PULSE_CFG = 0x21, /*!< Pulse function configuration. */
FXOS8700_PULSE_SRC = 0x22, /*!< Pulse function source register. */
FXOS8700_PULSE_THSX = 0x23, /*!< X-axis pulse threshold. */
FXOS8700_PULSE_THSY = 0x24, /*!< Y-axis pulse threshold. */
FXOS8700_PULSE_THSZ = 0x25, /*!< Z-axis pulse threshold. */
FXOS8700_PULSE_TMLT = 0x26, /*!< Time limit for pulse detection. */
FXOS8700_PULSE_LTCY = 0x27, /*!< Latency time for second pulse detection. */
FXOS8700_PULSE_WIND = 0x28, /*!< Window time for second pulse detection. */
FXOS8700_ASLP_COUNT = 0x29, /*!< The counter setting for auto-sleep period. */
FXOS8700_CTRL_REG1 = 0x2A, /*!< System ODR, accelerometer OSR (Output sample rate), operating mode. */
FXOS8700_CTRL_REG2 = 0x2B, /*!< Self-test, reset, accelerometer OSR, and sleep mode settings. */
FXOS8700_CTRL_REG3 = 0x2C, /*!< Sleep mode interrupt wake enable, interrupt polarity, push-pull/open drain configuration. */
FXOS8700_CTRL_REG4 = 0x2D, /*!< Interrupt enable register. */
FXOS8700_CTRL_REG5 = 0x2E, /*!< Interrupt pin (INT1/INT2) map. */
FXOS8700_OFF_X = 0x2F, /*!< X-axis accelerometer offset adjust. */
FXOS8700_OFF_Y = 0x30, /*!< Y-axis accelerometer offset adjust. */
FXOS8700_OFF_Z = 0x31, /*!< Z-axis accelerometer offset adjust. */
FXOS8700_M_DR_STATUS = 0x32, /*!< The magnetometer data ready status. */
FXOS8700_M_OUT_X_MSB = 0x33, /*!< MSB of the 16-bit magnetometer data for X-axis. */
FXOS8700_M_OUT_X_LSB = 0x34, /*!< LSB of the 16-bit magnetometer data for X-axis. */
FXOS8700_M_OUT_Y_MSB = 0x35, /*!< MSB of the 16-bit magnetometer data for Y-axis. */
FXOS8700_M_OUT_Y_LSB = 0x36, /*!< LSB of the 16-bit magnetometer data for Y-axis. */
FXOS8700_M_OUT_Z_MSB = 0x37, /*!< MSB of the 16-bit magnetometer data for Z-axis. */
FXOS8700_M_OUT_Z_LSB = 0x38, /*!< LSB of the 16-bit magnetometer data for Z-axis. */
FXOS8700_CMP_X_MSB = 0x39, /*!< Bits [13:8] of integrated X-axis acceleration data. */
FXOS8700_CMP_X_LSB = 0x3A, /*!< Bits [7:0] of integrated X-axis acceleration data. */
FXOS8700_CMP_Y_MSB = 0x3B, /*!< Bits [13:8] of integrated Y-axis acceleration data. */
FXOS8700_CMP_Y_LSB = 0x3C, /*!< Bits [7:0] of integrated Y-axis acceleration data. */
FXOS8700_CMP_Z_MSB = 0x3D, /*!< Bits [13:8] of integrated Z-axis acceleration data. */
FXOS8700_CMP_Z_LSB = 0x3E, /*!< Bits [7:0] of integrated Z-axis acceleration data. */
FXOS8700_M_OFF_X_MSB = 0x3F, /*!< MSB of magnetometer X-axis offset. */
FXOS8700_M_OFF_X_LSB = 0x40, /*!< LSB of magnetometer X-axis offset. */
FXOS8700_M_OFF_Y_MSB = 0x41, /*!< MSB of magnetometer Y-axis offset. */
FXOS8700_M_OFF_Y_LSB = 0x42, /*!< LSB of magnetometer Y-axis offset. */
FXOS8700_M_OFF_Z_MSB = 0x43, /*!< MSB of magnetometer Z-axis offset. */
FXOS8700_M_OFF_Z_LSB = 0x44, /*!< LSB of magnetometer Z-axis offset. */
FXOS8700_MAX_X_MSB = 0x45, /*!< Magnetometer X-axis maximum value MSB. */
FXOS8700_MAX_X_LSB = 0x46, /*!< Magnetometer X-axis maximum value LSB. */
FXOS8700_MAX_Y_MSB = 0x47, /*!< Magnetometer Y-axis maximum value MSB. */
FXOS8700_MAX_Y_LSB = 0x48, /*!< Magnetometer Y-axis maximum value LSB. */
FXOS8700_MAX_Z_MSB = 0x49, /*!< Magnetometer Z-axis maximum value MSB. */
FXOS8700_MAX_Z_LSB = 0x4A, /*!< Magnetometer Z-axis maximum value LSB. */
FXOS8700_MIN_X_MSB = 0x4B, /*!< Magnetometer X-axis minimum value MSB. */
FXOS8700_MIN_X_LSB = 0x4C, /*!< Magnetometer X-axis minimum value LSB. */
FXOS8700_MIN_Y_MSB = 0x4D, /*!< Magnetometer Y-axis minimum value MSB. */
FXOS8700_MIN_Y_LSB = 0x4E, /*!< Magnetometer Y-axis minimum value LSB. */
FXOS8700_MIN_Z_MSB = 0x4F, /*!< Magnetometer Z-axis minimum value MSB. */
FXOS8700_MIN_Z_LSB = 0x50, /*!< Magnetometer Z-axis minimum value LSB. */
FXOS8700_TEMP = 0x51, /*!< Device temperature with a valid range of -128 to 127 degrees C. */
FXOS8700_M_THS_CFG = 0x52, /*!< Magnetic threshold detection function configuration. */
FXOS8700_M_THS_SRC = 0x53, /*!< Magnetic threshold event source register. */
FXOS8700_M_THS_X_MSB = 0x54, /*!< X-axis magnetic threshold MSB. */
FXOS8700_M_THS_X_LSB = 0x55, /*!< X-axis magnetic threshold LSB. */
FXOS8700_M_THS_Y_MSB = 0x56, /*!< Y-axis magnetic threshold MSB. */
FXOS8700_M_THS_Y_LSB = 0x57, /*!< Y-axis magnetic threshold LSB. */
FXOS8700_M_THS_Z_MSB = 0x58, /*!< Z-axis magnetic threshold MSB. */
FXOS8700_M_THS_Z_LSB = 0x59, /*!< Z-axis magnetic threshold LSB. */
FXOS8700_M_THS_COUNT = 0x5A, /*!< Magnetic threshold debounce counter. */
FXOS8700_M_CTRL_REG1 = 0x5B, /*!< Control for magnetometer sensor functions. */
FXOS8700_M_CTRL_REG2 = 0x5C, /*!< Control for magnetometer sensor functions. */
FXOS8700_M_CTRL_REG3 = 0x5D, /*!< Control for magnetometer sensor functions. */
FXOS8700_M_INT_SRC = 0x5E, /*!< Magnetometer interrupt source. */
FXOS8700_A_VECM_CFG = 0x5F, /*!< Acceleration vector magnitude configuration register. */
FXOS8700_A_VECM_THS_MSB = 0x60, /*!< Acceleration vector magnitude threshold MSB. */
FXOS8700_A_VECM_THS_LSB = 0x61, /*!< Acceleration vector magnitude threshold LSB. */
FXOS8700_A_VECM_CNT = 0x62, /*!< Acceleration vector magnitude debounce count. */
FXOS8700_A_VECM_INITX_MSB = 0x63, /*!< Acceleration vector magnitude X-axis reference value MSB. */
FXOS8700_A_VECM_INITX_LSB = 0x64, /*!< Acceleration vector magnitude X-axis reference value LSB. */
FXOS8700_A_VECM_INITY_MSB = 0x65, /*!< Acceleration vector magnitude Y-axis reference value MSB. */
FXOS8700_A_VECM_INITY_LSB = 0x66, /*!< Acceleration vector magnitude Y-axis reference value LSB. */
FXOS8700_A_VECM_INITZ_MSB = 0x67, /*!< Acceleration vector magnitude Z-axis reference value MSB. */
FXOS8700_A_VECM_INITZ_LSB = 0x68, /*!< Acceleration vector magnitude Z-axis reference value LSB. */
FXOS8700_M_VECM_CFG = 0x69, /*!< Magnetic vector magnitude configuration register. */
FXOS8700_M_VECM_THS_MSB = 0x6A, /*!< Magnetic vector magnitude threshold MSB. */
FXOS8700_M_VECM_THS_LSB = 0x6B, /*!< Magnetic vector magnitude threshold LSB. */
FXOS8700_M_VECM_CNT = 0x6C, /*!< Magnetic vector magnitude debounce count. */
FXOS8700_M_VECM_INITX_MSB = 0x6D, /*!< Magnetic vector magnitude X-axis reference value MSB. */
FXOS8700_M_VECM_INITX_LSB = 0x6E, /*!< Magnetic vector magnitude X-axis reference value LSB. */
FXOS8700_M_VECM_INITY_MSB = 0x6F, /*!< Magnetic vector magnitude Y-axis reference value MSB. */
FXOS8700_M_VECM_INITY_LSB = 0x70, /*!< Magnetic vector magnitude Y-axis reference value LSB. */
FXOS8700_M_VECM_INITZ_MSB = 0x71, /*!< Magnetic vector magnitude Z-axis reference value MSB. */
FXOS8700_M_VECM_INITZ_LSB = 0x72, /*!< Magnetic vector magnitude Z-axis reference value LSB. */
FXOS8700_A_FFMT_THS_X_MSB = 0x73, /*!< X-axis FFMT threshold MSB. */
FXOS8700_A_FFMT_THS_X_LSB = 0x74, /*!< X-axis FFMT threshold LSB. */
FXOS8700_A_FFMT_THS_Y_MSB = 0x75, /*!< Y-axis FFMT threshold MSB. */
FXOS8700_A_FFMT_THS_Y_LSB = 0x76, /*!< Y-axis FFMT threshold LSB. */
FXOS8700_A_FFMT_THS_Z_MSB = 0x77, /*!< Z-axis FFMT threshold MSB. */
FXOS8700_A_FFMT_THS_Z_LSB = 0x78, /*!< Z-axis FFMT threshold LSB. */
};
#define FXOS8700_DEVICE_ADDR_SA_00 (0x1E)
#define FXOS8700_DEVICE_ADDR_SA_01 (0x1D)
#define FXOS8700_DEVICE_ADDR_SA_10 (0x1C)
#define FXOS8700_DEVICE_ADDR_SA_11 (0x1F)
#define FXOS8700_WHO_AM_I_PROD_VALUE (0xC7)
/**
* The following are the macro definitions to address each bit and its value in the hardware registers.
*/
/*--------------------------------
** Register: DR_STATUS
** Enum: FXOS8700_DR_STATUS
** --
** Offset : 0x00 - Alias for ::FXOS8700_DR_STATUS or ::FXOS8700_F_STATUS.
** ------------------------------*/
typedef union {
struct {
uint8_t xdr : 1;
uint8_t ydr : 1;
uint8_t zdr : 1;
uint8_t zyxdr : 1;
uint8_t xow : 1;
uint8_t yow : 1;
uint8_t zow : 1;
uint8_t zyxow : 1;
} b;
uint8_t w;
} FXOS8700_DR_STATUS_t;
/*
** DR_STATUS - Bit field mask definitions
*/
#define FXOS8700_DR_STATUS_XDR_MASK ((uint8_t) 0x01)
#define FXOS8700_DR_STATUS_XDR_SHIFT ((uint8_t) 0)
#define FXOS8700_DR_STATUS_YDR_MASK ((uint8_t) 0x02)
#define FXOS8700_DR_STATUS_YDR_SHIFT ((uint8_t) 1)
#define FXOS8700_DR_STATUS_ZDR_MASK ((uint8_t) 0x04)
#define FXOS8700_DR_STATUS_ZDR_SHIFT ((uint8_t) 2)
#define FXOS8700_DR_STATUS_ZYXDR_MASK ((uint8_t) 0x08)
#define FXOS8700_DR_STATUS_ZYXDR_SHIFT ((uint8_t) 3)
#define FXOS8700_DR_STATUS_XOW_MASK ((uint8_t) 0x10)
#define FXOS8700_DR_STATUS_XOW_SHIFT ((uint8_t) 4)
#define FXOS8700_DR_STATUS_YOW_MASK ((uint8_t) 0x20)
#define FXOS8700_DR_STATUS_YOW_SHIFT ((uint8_t) 5)
#define FXOS8700_DR_STATUS_ZOW_MASK ((uint8_t) 0x40)
#define FXOS8700_DR_STATUS_ZOW_SHIFT ((uint8_t) 6)
#define FXOS8700_DR_STATUS_ZYXOW_MASK ((uint8_t) 0x80)
#define FXOS8700_DR_STATUS_ZYXOW_SHIFT ((uint8_t) 7)
/*
** DR_STATUS - Bit field value definitions
*/
#define FXOS8700_DR_STATUS_XDR_DRDY ((uint8_t) 0x01) /* xdr is set to 1 whenever a new X-axis data */
/* acquisition is completed. xdr is cleared anytime */
/* the OUT_X_MSB register is read. */
#define FXOS8700_DR_STATUS_YDR_DRDY ((uint8_t) 0x02) /* ydr is set to 1 whenever a new Y-axis data */
/* acquisition is completed. xdr is cleared anytime */
/* the OUT_Y_MSB register is read. */
#define FXOS8700_DR_STATUS_ZDR_DRDY ((uint8_t) 0x04) /* zdr is set to 1 whenever a new Z-axis data */
/* acquisition is completed. xdr is cleared anytime */
/* the OUT_Z_MSB register is read. */
#define FXOS8700_DR_STATUS_ZYXDR_DRDY ((uint8_t) 0x08) /* zyxdr signals that a new acquisition for any of */
/* the enabled channels is available. zyxdr is */
/* cleared when the high-bytes of the acceleration */
/* data (OUT_X_MSB, OUT_Y_MSB, OUT_Z_MSB) are read. */
#define FXOS8700_DR_STATUS_XOW_OWR ((uint8_t) 0x10)
#define FXOS8700_DR_STATUS_YOW_OWR ((uint8_t) 0x20)
#define FXOS8700_DR_STATUS_ZOW_OWR ((uint8_t) 0x40)
#define FXOS8700_DR_STATUS_ZYXOW_OWR ((uint8_t) 0x80)
/*------------------------------*/
/*--------------------------------
** Register: F_STATUS
** Enum: FXOS8700_F_STATUS
** --
** Offset : 0x00 - Fifo Status register
** ------------------------------*/
typedef union {
struct {
uint8_t f_cnt : 6; /* These bits indicate the number of acceleration samples currently stored in */
/* the FIFO buffer. Count 0b00_0000 indicates that the FIFO is empty */
uint8_t f_wmrk_flag : 1;
uint8_t f_ovf : 1;
} b;
uint8_t w;
} FXOS8700_F_STATUS_t;
/*
** F_STATUS - Bit field mask definitions
*/
#define FXOS8700_F_STATUS_F_CNT_MASK ((uint8_t) 0x3F)
#define FXOS8700_F_STATUS_F_CNT_SHIFT ((uint8_t) 0)
#define FXOS8700_F_STATUS_F_WMRK_FLAG_MASK ((uint8_t) 0x40)
#define FXOS8700_F_STATUS_F_WMRK_FLAG_SHIFT ((uint8_t) 6)
#define FXOS8700_F_STATUS_F_OVF_MASK ((uint8_t) 0x80)
#define FXOS8700_F_STATUS_F_OVF_SHIFT ((uint8_t) 7)
/*
** F_STATUS - Bit field value definitions
*/
#define FXOS8700_F_STATUS_F_WMRK_FLAG_NOEVT ((uint8_t) 0x00) /* No FIFO watermark event detected */
#define FXOS8700_F_STATUS_F_WMRK_FLAG_EVTDET ((uint8_t) 0x40)
#define FXOS8700_F_STATUS_F_OVF_NOOVFL ((uint8_t) 0x00) /* No FIFO overflow events detected */
#define FXOS8700_F_STATUS_F_OVF_OVFLDET ((uint8_t) 0x80) /* FIFO overflow event detected */
/*------------------------------*/
/*--------------------------------
** Register: OUT_X_MSB
** Enum: FXOS8700_OUT_X_MSB
** --
** Offset : 0x01 - MSB of Accelerometer X value
** ------------------------------*/
typedef union {
struct {
uint8_t xd; /* - 14-bit X-axis measurement data bits 13:6. */
} b;
uint8_t w;
} FXOS8700_OUT_X_MSB_t;
/*
** OUT_X_MSB - Bit field mask definitions
*/
#define FXOS8700_OUT_X_MSB_XD_MASK ((uint8_t) 0xFF)
#define FXOS8700_OUT_X_MSB_XD_SHIFT ((uint8_t) 0)
/*------------------------------*/
/*--------------------------------
** Register: OUT_X_LSB
** Enum: FXOS8700_OUT_X_LSB
** --
** Offset : 0x02 - LSB of Accelerometer X value
** ------------------------------*/
typedef union {
struct {
uint8_t _reserved_ : 2;
uint8_t xd : 6; /* - 14-bit X-axis measurement data bits 5:0. */
} b;
uint8_t w;
} FXOS8700_OUT_X_LSB_t;
/*
** OUT_X_LSB - Bit field mask definitions
*/
#define FXOS8700_OUT_X_LSB_XD_MASK ((uint8_t) 0xFC)
#define FXOS8700_OUT_X_LSB_XD_SHIFT ((uint8_t) 2)
/*------------------------------*/
/*--------------------------------
** Register: OUT_Y_MSB
** Enum: FXOS8700_OUT_Y_MSB
** --
** Offset : 0x03 - 14-bit Y-axis measurement data bits 13:6.
** ------------------------------*/
typedef union {
struct {
uint8_t yd; /* - 14-bit Y-axis measurement data bits 13:6. */
} b;
uint8_t w;
} FXOS8700_OUT_Y_MSB_t;
/*
** OUT_Y_MSB - Bit field mask definitions
*/
#define FXOS8700_OUT_Y_MSB_YD_MASK ((uint8_t) 0xFF)
#define FXOS8700_OUT_Y_MSB_YD_SHIFT ((uint8_t) 0)
/*------------------------------*/
/*--------------------------------
** Register: OUT_Y_LSB
** Enum: FXOS8700_OUT_Y_LSB
** --
** Offset : 0x04 - 14-bit Y-axis measurement data bits 5:0.
** ------------------------------*/
typedef union {
struct {
uint8_t _reserved_ : 2;
uint8_t yd : 6; /* - 14-bit Y-axis measurement data bits 5:0. */
} b;
uint8_t w;
} FXOS8700_OUT_Y_LSB_t;
/*
** OUT_Y_LSB - Bit field mask definitions
*/
#define FXOS8700_OUT_Y_LSB_YD_MASK ((uint8_t) 0xFC)
#define FXOS8700_OUT_Y_LSB_YD_SHIFT ((uint8_t) 2)
/*------------------------------*/
/*--------------------------------
** Register: OUT_Z_MSB
** Enum: FXOS8700_OUT_Z_MSB
** --
** Offset : 0x05 - 14-bit Z-axis measurement data bits 13:6.
** ------------------------------*/
typedef union {
struct {
uint8_t zd; /* - 14-bit Z-axis measurement data bits 13:6. */
} b;
uint8_t w;
} FXOS8700_OUT_Z_MSB_t;
/*
** OUT_Z_MSB - Bit field mask definitions
*/
#define FXOS8700_OUT_Z_MSB_ZD_MASK ((uint8_t) 0xFF)
#define FXOS8700_OUT_Z_MSB_ZD_SHIFT ((uint8_t) 0)
/*------------------------------*/
/*--------------------------------
** Register: OUT_Z_LSB
** Enum: FXOS8700_OUT_Z_LSB
** --
** Offset : 0x06 - 14-bit Z-axis measurement data bits 5:0.
** ------------------------------*/
typedef union {
struct {
uint8_t _reserved_ : 2;
uint8_t zd : 6; /* - 14-bit Z-axis measurement data bits 5:0. */
} b;
uint8_t w;
} FXOS8700_OUT_Z_LSB_t;
/*
** OUT_Z_LSB - Bit field mask definitions
*/
#define FXOS8700_OUT_Z_LSB_ZD_MASK ((uint8_t) 0xFC)
#define FXOS8700_OUT_Z_LSB_ZD_SHIFT ((uint8_t) 2)
/*------------------------------*/
/*--------------------------------
** Register: F_SETUP
** Enum: FXOS8700_F_SETUP
** --
** Offset : 0x09 - FIFO setup.
** ------------------------------*/
typedef union {
struct {
uint8_t f_wmrk : 6; /* FIFO sample count watermark */
uint8_t f_mode : 2; /* - FIFO Buffer operating mode */
} b;
uint8_t w;
} FXOS8700_F_SETUP_t;
/*
** F_SETUP - Bit field mask definitions
*/
#define FXOS8700_F_SETUP_F_WMRK_MASK ((uint8_t) 0x3F)
#define FXOS8700_F_SETUP_F_WMRK_SHIFT ((uint8_t) 0)
#define FXOS8700_F_SETUP_F_MODE_MASK ((uint8_t) 0xC0)
#define FXOS8700_F_SETUP_F_MODE_SHIFT ((uint8_t) 6)
/*
** F_SETUP - Bit field value definitions
*/
#define FXOS8700_F_SETUP_F_MODE_FIFO_DISABLE ((uint8_t) 0x00) /* FIFO is disabled */
#define FXOS8700_F_SETUP_F_MODE_FIFO_CIRC ((uint8_t) 0x40) /* FIFO contains the most recent samples when */
/* overflowed (circular buffer). Oldest sample is */
/* discarded to be replaced by new sample */
#define FXOS8700_F_SETUP_F_MODE_FIFO_STOP_OVF ((uint8_t) 0x80) /* FIFO stops accepting new samples when overflowed */
#define FXOS8700_F_SETUP_F_MODE_FIFO_TRIGGER ((uint8_t) 0xc0) /* FIFO trigger mode */
/*------------------------------*/
/*--------------------------------
** Register: TRIG_CFG
** Enum: FXOS8700_TRIG_CFG
** --
** Offset : 0x0A - FIFO event trigger configuration register.
** ------------------------------*/
typedef union {
struct {
uint8_t _reserved_ : 1;
uint8_t trig_a_vecm : 1;
uint8_t trig_a_ffmt : 1;
uint8_t trig_pulse : 1;
uint8_t trig_lndprt : 1;
uint8_t trig_trans : 1;
} b;
uint8_t w;
} FXOS8700_TRIG_CFG_t;
/*
** TRIG_CFG - Bit field mask definitions
*/
#define FXOS8700_TRIG_CFG_TRIG_A_VECM_MASK ((uint8_t) 0x02)
#define FXOS8700_TRIG_CFG_TRIG_A_VECM_SHIFT ((uint8_t) 1)
#define FXOS8700_TRIG_CFG_TRIG_A_FFMT_MASK ((uint8_t) 0x04)
#define FXOS8700_TRIG_CFG_TRIG_A_FFMT_SHIFT ((uint8_t) 2)
#define FXOS8700_TRIG_CFG_TRIG_PULSE_MASK ((uint8_t) 0x08)
#define FXOS8700_TRIG_CFG_TRIG_PULSE_SHIFT ((uint8_t) 3)
#define FXOS8700_TRIG_CFG_TRIG_LNDPRT_MASK ((uint8_t) 0x10)
#define FXOS8700_TRIG_CFG_TRIG_LNDPRT_SHIFT ((uint8_t) 4)
#define FXOS8700_TRIG_CFG_TRIG_TRANS_MASK ((uint8_t) 0x20)
#define FXOS8700_TRIG_CFG_TRIG_TRANS_SHIFT ((uint8_t) 5)
/*
** TRIG_CFG - Bit field value definitions
*/
#define FXOS8700_TRIG_CFG_TRIG_A_VECM_EN ((uint8_t) 0x02) /* Acceleration vector-magnitude FIFO trigger enable */
#define FXOS8700_TRIG_CFG_TRIG_A_VECM_DIS ((uint8_t) 0x00) /* Acceleration vector-magnitude FIFO trigger disable */
#define FXOS8700_TRIG_CFG_TRIG_A_FFMT_EN ((uint8_t) 0x04) /* Freefall/motion interrupt FIFO trigger enable */
#define FXOS8700_TRIG_CFG_TRIG_A_FFMT_DIS ((uint8_t) 0x00) /* Freefall/motion interrupt FIFO trigger disable */
#define FXOS8700_TRIG_CFG_TRIG_PULSE_EN ((uint8_t) 0x08) /* Pluse interrupt FIFO trigger enable */
#define FXOS8700_TRIG_CFG_TRIG_PULSE_DIS ((uint8_t) 0x00) /* Pluse FIFO trigger enable */
#define FXOS8700_TRIG_CFG_TRIG_LNDPRT_EN ((uint8_t) 0x10) /* Landscape/portrait orientation interrupt FIFO */
/* trigger enable */
#define FXOS8700_TRIG_CFG_TRIG_LNDPRT_DIS ((uint8_t) 0x00) /* Landscape/portrait orientation interrupt FIFO */
/* trigger disable */
#define FXOS8700_TRIG_CFG_TRIG_TRANS_EN ((uint8_t) 0x20) /* Transient interrupt FIFO trigger enable */
#define FXOS8700_TRIG_CFG_TRIG_TRANS_DIS ((uint8_t) 0x00) /* Transient interrupt FIFO trigger disable */
/*------------------------------*/
/*--------------------------------
** Register: SYSMOD
** Enum: FXOS8700_SYSMOD
** --
** Offset : 0x0B - Current system mode.
** ------------------------------*/
typedef union {
struct {
uint8_t sysmod : 2;
uint8_t fgt : 5;
uint8_t fgerr : 1;
} b;
uint8_t w;
} FXOS8700_SYSMOD_t;
/*
** SYSMOD - Bit field mask definitions
*/
#define FXOS8700_SYSMOD_SYSMOD_MASK ((uint8_t) 0x03)
#define FXOS8700_SYSMOD_SYSMOD_SHIFT ((uint8_t) 0)
#define FXOS8700_SYSMOD_FGT_MASK ((uint8_t) 0x7C)
#define FXOS8700_SYSMOD_FGT_SHIFT ((uint8_t) 2)
#define FXOS8700_SYSMOD_FGERR_MASK ((uint8_t) 0x80)
#define FXOS8700_SYSMOD_FGERR_SHIFT ((uint8_t) 7)
/*
** SYSMOD - Bit field value definitions
*/
#define FXOS8700_SYSMOD_SYSMOD_STANDBY ((uint8_t) 0x00) /* Standby mode */
#define FXOS8700_SYSMOD_SYSMOD_WAKE ((uint8_t) 0x01) /* Wake mode */
#define FXOS8700_SYSMOD_SYSMOD_SLEEP ((uint8_t) 0x02) /* Sleep mode */
/*------------------------------*/
/*--------------------------------
** Register: INT_SOURCE
** Enum: FXOS8700_INT_SOURCE
** --
** Offset : 0x0C - Interrupt status.
** ------------------------------*/
typedef union {
struct {
uint8_t src_drdy : 1;
uint8_t src_a_vecm : 1;
uint8_t src_ffmt : 1;
uint8_t src_pulse : 1;
uint8_t src_lndprt : 1;
uint8_t src_trans : 1;
uint8_t src_fifo : 1;
uint8_t src_aslp : 1;
} b;
uint8_t w;
} FXOS8700_INT_SOURCE_t;
/*
** INT_SOURCE - Bit field mask definitions
*/
#define FXOS8700_INT_SOURCE_SRC_DRDY_MASK ((uint8_t) 0x01)
#define FXOS8700_INT_SOURCE_SRC_DRDY_SHIFT ((uint8_t) 0)
#define FXOS8700_INT_SOURCE_SRC_A_VECM_MASK ((uint8_t) 0x02)
#define FXOS8700_INT_SOURCE_SRC_A_VECM_SHIFT ((uint8_t) 1)
#define FXOS8700_INT_SOURCE_SRC_FFMT_MASK ((uint8_t) 0x04)
#define FXOS8700_INT_SOURCE_SRC_FFMT_SHIFT ((uint8_t) 2)
#define FXOS8700_INT_SOURCE_SRC_PULSE_MASK ((uint8_t) 0x08)
#define FXOS8700_INT_SOURCE_SRC_PULSE_SHIFT ((uint8_t) 3)
#define FXOS8700_INT_SOURCE_SRC_LNDPRT_MASK ((uint8_t) 0x10)
#define FXOS8700_INT_SOURCE_SRC_LNDPRT_SHIFT ((uint8_t) 4)
#define FXOS8700_INT_SOURCE_SRC_TRANS_MASK ((uint8_t) 0x20)
#define FXOS8700_INT_SOURCE_SRC_TRANS_SHIFT ((uint8_t) 5)
#define FXOS8700_INT_SOURCE_SRC_FIFO_MASK ((uint8_t) 0x40)
#define FXOS8700_INT_SOURCE_SRC_FIFO_SHIFT ((uint8_t) 6)
#define FXOS8700_INT_SOURCE_SRC_ASLP_MASK ((uint8_t) 0x80)
#define FXOS8700_INT_SOURCE_SRC_ASLP_SHIFT ((uint8_t) 7)
/*------------------------------*/
/*--------------------------------
** Register: WHO_AM_I
** Enum: FXOS8700_WHO_AM_I
** --
** Offset : 0x0D - Device ID.
** ------------------------------*/
typedef uint8_t FXOS8700_WHO_AM_I_t;
/*--------------------------------
** Register: XYZ_DATA_CFG
** Enum: FXOS8700_XYZ_DATA_CFG
** --
** Offset : 0x0E - Acceleration dynamic range and filter enable settings.
** ------------------------------*/
typedef union {
struct {
uint8_t fs : 2;
uint8_t _reserved_ : 2;
uint8_t hpf_out : 1; /* - Enable high-pass filter on acceleration output data */
} b;
uint8_t w;
} FXOS8700_XYZ_DATA_CFG_t;
/*
** XYZ_DATA_CFG - Bit field mask definitions
*/
#define FXOS8700_XYZ_DATA_CFG_FS_MASK ((uint8_t) 0x03)
#define FXOS8700_XYZ_DATA_CFG_FS_SHIFT ((uint8_t) 0)
#define FXOS8700_XYZ_DATA_CFG_HPF_OUT_MASK ((uint8_t) 0x10)
#define FXOS8700_XYZ_DATA_CFG_HPF_OUT_SHIFT ((uint8_t) 4)
/*
** XYZ_DATA_CFG - Bit field value definitions
*/
#define FXOS8700_XYZ_DATA_CFG_HPF_OUT_EN ((uint8_t) 0x10) /* Enable high-pass filter on acceleration output */
/* data */
#define FXOS8700_XYZ_DATA_CFG_HPF_OUT_DISABLE ((uint8_t) 0x00) /* High-pass filter is disabled */
#define FXOS8700_XYZ_DATA_CFG_FS_2G_0P244 ((uint8_t) 0x00) /* 0.244 mg/LSB */
#define FXOS8700_XYZ_DATA_CFG_FS_4G_0P488 ((uint8_t) 0x01) /* 0.488 mg/LSB */
#define FXOS8700_XYZ_DATA_CFG_FS_8G_0P976 ((uint8_t) 0x02) /* 0.976 mg/LSB */
/*------------------------------*/
/*--------------------------------
** Register: HP_FILTER_CUTOFF
** Enum: FXOS8700_HP_FILTER_CUTOFF
** --
** Offset : 0x0F - Pulse detection highpass and lowpass filter enabling bits.
** ------------------------------*/
typedef union {
struct {
uint8_t sel : 2;
uint8_t _reserved_ : 2;
uint8_t pulse_lpf_en : 1;
uint8_t pulse_hpf_byp : 1;
} b;
uint8_t w;
} FXOS8700_HP_FILTER_CUTOFF_t;
/*
** HP_FILTER_CUTOFF - Bit field mask definitions
*/
#define FXOS8700_HP_FILTER_CUTOFF_SEL_MASK ((uint8_t) 0x03)
#define FXOS8700_HP_FILTER_CUTOFF_SEL_SHIFT ((uint8_t) 0)
#define FXOS8700_HP_FILTER_CUTOFF_PULSE_LPF_EN_MASK ((uint8_t) 0x10)
#define FXOS8700_HP_FILTER_CUTOFF_PULSE_LPF_EN_SHIFT ((uint8_t) 4)
#define FXOS8700_HP_FILTER_CUTOFF_PULSE_HPF_BYP_MASK ((uint8_t) 0x20)
#define FXOS8700_HP_FILTER_CUTOFF_PULSE_HPF_BYP_SHIFT ((uint8_t) 5)
/*
** HP_FILTER_CUTOFF - Bit field value definitions
*/
#define FXOS8700_HP_FILTER_CUTOFF_PULSE_HPF_BYP_EN ((uint8_t) 0x00) /* HPF enabled for pulse processing */
#define FXOS8700_HP_FILTER_CUTOFF_PULSE_HPF_BYP_BYPASS ((uint8_t) 0x20) /* HPF bypassed for pulse processing */
#define FXOS8700_HP_FILTER_CUTOFF_PULSE_LPF_EN_EN ((uint8_t) 0x10) /* LPF enabled for pulse processing */
#define FXOS8700_HP_FILTER_CUTOFF_PULSE_LPF_EN_DISABLE ((uint8_t) 0x00) /* LPF bypassed for pulse processing */
#define FXOS8700_HP_FILTER_CUTOFF_SEL_EN ((uint8_t) 0x01) /* HPF cutoff frequency selection Enabled */
#define FXOS8700_HP_FILTER_CUTOFF_SEL_DISABLE ((uint8_t) 0x00) /* HPF cutoff frequency selection Disabled */
/*------------------------------*/
/*--------------------------------
** Register: PL_STATUS
** Enum: FXOS8700_PL_STATUS
** --
** Offset : 0x10 - Landscape/portrait orientation status.
** ------------------------------*/
typedef union {
struct {
uint8_t bafro : 1;
uint8_t lapo : 2;
uint8_t _reserved_ : 3;
uint8_t lo : 1;
uint8_t newlp : 1;
} b;
uint8_t w;
} FXOS8700_PL_STATUS_t;
/*
** PL_STATUS - Bit field mask definitions
*/
#define FXOS8700_PL_STATUS_BAFRO_MASK ((uint8_t) 0x01)
#define FXOS8700_PL_STATUS_BAFRO_SHIFT ((uint8_t) 0)
#define FXOS8700_PL_STATUS_LAPO_MASK ((uint8_t) 0x06)
#define FXOS8700_PL_STATUS_LAPO_SHIFT ((uint8_t) 1)
#define FXOS8700_PL_STATUS_LO_MASK ((uint8_t) 0x40)
#define FXOS8700_PL_STATUS_LO_SHIFT ((uint8_t) 6)
#define FXOS8700_PL_STATUS_NEWLP_MASK ((uint8_t) 0x80)
#define FXOS8700_PL_STATUS_NEWLP_SHIFT ((uint8_t) 7)
/*------------------------------*/
/*--------------------------------
** Register: PL_CFG
** Enum: FXOS8700_PL_CFG
** --
** Offset : 0x11 - Landscape/portrait configuration.
** ------------------------------*/
typedef union {
struct {
uint8_t _reserved_ : 6;
uint8_t pl_en : 1;
uint8_t dbcntm : 1;
} b;
uint8_t w;
} FXOS8700_PL_CFG_t;
/*
** PL_CFG - Bit field mask definitions
*/
#define FXOS8700_PL_CFG_PL_EN_MASK ((uint8_t) 0x40)
#define FXOS8700_PL_CFG_PL_EN_SHIFT ((uint8_t) 6)
#define FXOS8700_PL_CFG_DBCNTM_MASK ((uint8_t) 0x80)
#define FXOS8700_PL_CFG_DBCNTM_SHIFT ((uint8_t) 7)
/*
** PL_CFG - Bit field value definitions
*/
#define FXOS8700_PL_CFG_DBCNTM_DECREMENT_MODE ((uint8_t) 0x00) /* Decrements debounce whenever condition of interest is */
/* no longer valid */
#define FXOS8700_PL_CFG_DBCNTM_CLEAR_MODE ((uint8_t) 0x80) /* Clears counter whenever condition of interest is no */
/* longer valid */
#define FXOS8700_PL_CFG_PL_EN_DISABLE ((uint8_t) 0x00) /* Portrait/Landscape detection is disabled. */
#define FXOS8700_PL_CFG_PL_EN_ENABLE ((uint8_t) 0x40) /* Portrait/Landscape detection is enabled. */
/*------------------------------*/
/*--------------------------------
** Register: PL_COUNT
** Enum: FXOS8700_PL_COUNT
** --
** Offset : 0x12 - Landscape/portrait debounce counter.
** ------------------------------*/
typedef union {
struct {
uint8_t dbnce;
} b;
uint8_t w;
} FXOS8700_PL_COUNT_t;
/*
** PL_COUNT - Bit field mask definitions
*/
#define FXOS8700_PL_COUNT_DBNCE_MASK ((uint8_t) 0xFF)
#define FXOS8700_PL_COUNT_DBNCE_SHIFT ((uint8_t) 0)
/*------------------------------*/
/*--------------------------------
** Register: PL_BF_ZCOMP
** Enum: FXOS8700_PL_BF_ZCOMP
** --
** Offset : 0x13 - Back/front trip angle threshold.
** ------------------------------*/
typedef union {
struct {
uint8_t zlock : 3;
uint8_t _reserved_ : 3;
uint8_t bkfr : 2;
} b;
uint8_t w;
} FXOS8700_PL_BF_ZCOMP_t;
/*
** PL_BF_ZCOMP - Bit field mask definitions
*/
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_MASK ((uint8_t) 0x07)
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_SHIFT ((uint8_t) 0)
#define FXOS8700_PL_BF_ZCOMP_BKFR_MASK ((uint8_t) 0xC0)
#define FXOS8700_PL_BF_ZCOMP_BKFR_SHIFT ((uint8_t) 6)
/*
** PL_BF_ZCOMP - Bit field value definitions
*/
#define FXOS8700_PL_BF_ZCOMP_BKFR_BF_LT80_GT280__FB_LT260_GT100 ((uint8_t) 0x00)
#define FXOS8700_PL_BF_ZCOMP_BKFR_BF_LT75_GT285__FB_LT255_GT105 ((uint8_t) 0x40)
#define FXOS8700_PL_BF_ZCOMP_BKFR_BF_LT70_GT290__FB_LT250_GT110 ((uint8_t) 0x80)
#define FXOS8700_PL_BF_ZCOMP_BKFR_BF_LT65_GT295__FB_LT245_GT115 ((uint8_t) 0xc0)
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_13P6MIN_14P5MAX ((uint8_t) 0x00)
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_17P1MIN_18P2MAX ((uint8_t) 0x01)
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_20P7MIN_22P0MAX ((uint8_t) 0x02)
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_24P4MIN_25P9MAX ((uint8_t) 0x04)
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_28P1MIN_30P0MAX ((uint8_t) 0x04)
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_32P0MIN_34P2MAX ((uint8_t) 0x05)
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_36P1MIN_38P7MAX ((uint8_t) 0x06)
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_40P4MIN_43P4MAX ((uint8_t) 0x07)
/*------------------------------*/
/*--------------------------------
** Register: PL_THS_REG
** Enum: FXOS8700_PL_THS_REG
** --
** Offset : 0x14 - Portrait to landscape trip threshold angle and hysteresis settings.
** ------------------------------*/
typedef union {
struct {
uint8_t hys : 3;
uint8_t pl_ths : 5;
} b;
uint8_t w;
} FXOS8700_PL_THS_REG_t;
/*
** PL_THS_REG - Bit field mask definitions
*/
#define FXOS8700_PL_THS_REG_HYS_MASK ((uint8_t) 0x07)
#define FXOS8700_PL_THS_REG_HYS_SHIFT ((uint8_t) 0)
#define FXOS8700_PL_THS_REG_PL_THS_MASK ((uint8_t) 0xF8)
#define FXOS8700_PL_THS_REG_PL_THS_SHIFT ((uint8_t) 3)
/*
** PL_THS_REG - Bit field value definitions
*/
#define FXOS8700_PL_THS_REG_PL_THS_15DEG ((uint8_t) 0x38)
#define FXOS8700_PL_THS_REG_PL_THS_20DEG ((uint8_t) 0x48)
#define FXOS8700_PL_THS_REG_PL_THS_30DEG ((uint8_t) 0x60)
#define FXOS8700_PL_THS_REG_PL_THS_35DEG ((uint8_t) 0x68)
#define FXOS8700_PL_THS_REG_PL_THS_40DEG ((uint8_t) 0x78)
#define FXOS8700_PL_THS_REG_PL_THS_45DEG ((uint8_t) 0x80)
#define FXOS8700_PL_THS_REG_PL_THS_55DEG ((uint8_t) 0x98)
#define FXOS8700_PL_THS_REG_PL_THS_60DEG ((uint8_t) 0xa0)
#define FXOS8700_PL_THS_REG_PL_THS_70DEG ((uint8_t) 0xb8)
#define FXOS8700_PL_THS_REG_PL_THS_75DEG ((uint8_t) 0xc8)
#define FXOS8700_PL_THS_REG_HYS_LP45_PL45 ((uint8_t) 0x00)
#define FXOS8700_PL_THS_REG_HYS_LP49_PL41 ((uint8_t) 0x01)
#define FXOS8700_PL_THS_REG_HYS_LP52_PL38 ((uint8_t) 0x02)
#define FXOS8700_PL_THS_REG_HYS_LP56_PL34 ((uint8_t) 0x03)
#define FXOS8700_PL_THS_REG_HYS_LP59_PL31 ((uint8_t) 0x04)
#define FXOS8700_PL_THS_REG_HYS_LP62_PL28 ((uint8_t) 0x05)
#define FXOS8700_PL_THS_REG_HYS_LP66_PL24 ((uint8_t) 0x06)
#define FXOS8700_PL_THS_REG_HYS_LP69_PL21 ((uint8_t) 0x07)
/*------------------------------*/
/*--------------------------------
** Register: A_FFMT_CFG
** Enum: FXOS8700_A_FFMT_CFG
** --
** Offset : 0x15 - Freefall/motion function configuration.
** ------------------------------*/
typedef union {
struct {
uint8_t _reserved_ : 3;
uint8_t xefe : 1;
uint8_t yefe : 1;
uint8_t zefe : 1;
uint8_t oae : 1;
uint8_t ele : 1;
} b;
uint8_t w;
} FXOS8700_A_FFMT_CFG_t;
/*
** A_FFMT_CFG - Bit field mask definitions
*/
#define FXOS8700_A_FFMT_CFG_XEFE_MASK ((uint8_t) 0x08)
#define FXOS8700_A_FFMT_CFG_XEFE_SHIFT ((uint8_t) 3)
#define FXOS8700_A_FFMT_CFG_YEFE_MASK ((uint8_t) 0x10)
#define FXOS8700_A_FFMT_CFG_YEFE_SHIFT ((uint8_t) 4)
#define FXOS8700_A_FFMT_CFG_ZEFE_MASK ((uint8_t) 0x20)
#define FXOS8700_A_FFMT_CFG_ZEFE_SHIFT ((uint8_t) 5)
#define FXOS8700_A_FFMT_CFG_OAE_MASK ((uint8_t) 0x40)
#define FXOS8700_A_FFMT_CFG_OAE_SHIFT ((uint8_t) 6)
#define FXOS8700_A_FFMT_CFG_ELE_MASK ((uint8_t) 0x80)
#define FXOS8700_A_FFMT_CFG_ELE_SHIFT ((uint8_t) 7)
/*
** A_FFMT_CFG - Bit field value definitions
*/
#define FXOS8700_A_FFMT_CFG_ELE_EN ((uint8_t) 0x80) /* Event flag latch enabled */
#define FXOS8700_A_FFMT_CFG_ELE_DIS ((uint8_t) 0x00) /* Event flag latch disabled */
#define FXOS8700_A_FFMT_CFG_OAE_FREEFALL ((uint8_t) 0x00) /* Freefall flag */
#define FXOS8700_A_FFMT_CFG_OAE_MOTION ((uint8_t) 0x40) /* Motion flag */
#define FXOS8700_A_FFMT_CFG_ZEFE_DIS ((uint8_t) 0x00) /* Event detection disabled */
#define FXOS8700_A_FFMT_CFG_ZEFE_RAISE_EVENT ((uint8_t) 0x20) /* Raise event flag on measured Z-axis acceleration */
/* above/below threshold */
#define FXOS8700_A_FFMT_CFG_YEFE_DIS ((uint8_t) 0x00) /* Event detection disabled */
#define FXOS8700_A_FFMT_CFG_YEFE_RAISE_EVENT ((uint8_t) 0x10) /* Raise event flag on measured Y-axis acceleration */
/* above/below threshold */
#define FXOS8700_A_FFMT_CFG_XEFE_DIS ((uint8_t) 0x00) /* Event detection disabled */
#define FXOS8700_A_FFMT_CFG_XEFE_RAISE_EVENT ((uint8_t) 0x08) /* Raise event flag on measured X-axis acceleration */
/* above/below threshold */
/*------------------------------*/
/*--------------------------------
** Register: A_FFMT_SRC
** Enum: FXOS8700_A_FFMT_SRC
** --
** Offset : 0x16 - Freefall/motion event source register.
** ------------------------------*/
typedef union {
struct {
uint8_t xhp : 1;
uint8_t xhe : 1;
uint8_t yhp : 1;
uint8_t yhe : 1;
uint8_t zhp : 1;
uint8_t zhe : 1;
uint8_t _reserved_ : 1;
uint8_t ea : 1;
} b;
uint8_t w;
} FXOS8700_A_FFMT_SRC_t;
/*
** A_FFMT_SRC - Bit field mask definitions
*/
#define FXOS8700_A_FFMT_SRC_XHP_MASK ((uint8_t) 0x01)
#define FXOS8700_A_FFMT_SRC_XHP_SHIFT ((uint8_t) 0)
#define FXOS8700_A_FFMT_SRC_XHE_MASK ((uint8_t) 0x02)
#define FXOS8700_A_FFMT_SRC_XHE_SHIFT ((uint8_t) 1)
#define FXOS8700_A_FFMT_SRC_YHP_MASK ((uint8_t) 0x04)
#define FXOS8700_A_FFMT_SRC_YHP_SHIFT ((uint8_t) 2)
#define FXOS8700_A_FFMT_SRC_YHE_MASK ((uint8_t) 0x08)
#define FXOS8700_A_FFMT_SRC_YHE_SHIFT ((uint8_t) 3)