-
Notifications
You must be signed in to change notification settings - Fork 39
/
bma2x2.h
5696 lines (5534 loc) · 194 KB
/
bma2x2.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
/** \mainpage
*
****************************************************************************
* Copyright (C) 2011 - 2014 Bosch Sensortec GmbH
*
* File : bma2x2.h
*
* Date : 2014/12/12
*
* Revision : 2.0.3 $
*
* Usage: Sensor Driver file for BMA2x2 sensor
*
****************************************************************************
* \section License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the copyright holder nor the names of the
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
* OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
*
* The information provided is believed to be accurate and reliable.
* The copyright holder assumes no responsibility
* for the consequences of use
* of such information nor for any infringement of patents or
* other rights of third parties which may result from its use.
* No license is granted by implication or otherwise under any patent or
* patent rights of the copyright holder.
**************************************************************************/
/*! \file bma2x2.h
\brief BMA2x2 Sensor Driver Support Header File */
#ifndef __BMA2x2_H__
#define __BMA2x2_H__
/****************************************************************/
/**\name DATA TYPES INCLUDES */
/************************************************************/
/*!
* @brief The following definition uses for define the data types
*
* @note While porting the API please consider the following
* @note Please check the version of C standard
* @note Are you using Linux platform
*/
/*!
* @brief For the Linux platform support
* Please use the types.h for your data types definitions
*/
#ifdef __KERNEL__
#include <linux/types.h>
/* singed integer type*/
typedef int8_t s8;/**< used for signed 8bit */
typedef int16_t s16;/**< used for signed 16bit */
typedef int32_t s32;/**< used for signed 32bit */
typedef int64_t s64;/**< used for signed 64bit */
typedef u_int8_t u8;/**< used for unsigned 8bit */
typedef u_int16_t u16;/**< used for unsigned 16bit */
typedef u_int32_t u32;/**< used for unsigned 32bit */
typedef u_int64_t u64;/**< used for unsigned 64bit */
#else /* ! __KERNEL__ */
/**********************************************************
* These definition uses for define the C
* standard version data types
***********************************************************/
# if !defined(__STDC_VERSION__)
/************************************************
* compiler is C11 C standard
************************************************/
#if (__STDC_VERSION__ == 201112L)
/************************************************/
#include <stdint.h>
/************************************************/
/*unsigned integer types*/
typedef uint8_t u8;/**< used for unsigned 8bit */
typedef uint16_t u16;/**< used for unsigned 16bit */
typedef uint32_t u32;/**< used for unsigned 32bit */
typedef uint64_t u64;/**< used for unsigned 64bit */
/*signed integer types*/
typedef int8_t s8;/**< used for signed 8bit */
typedef int16_t s16;/**< used for signed 16bit */
typedef int32_t s32;/**< used for signed 32bit */
typedef int64_t s64;/**< used for signed 64bit */
/************************************************
* compiler is C99 C standard
************************************************/
#elif (__STDC_VERSION__ == 199901L)
/* stdint.h is a C99 supported c library.
which is used to fixed the integer size*/
/************************************************/
#include <stdint.h>
/************************************************/
/*unsigned integer types*/
typedef uint8_t u8;/**< used for unsigned 8bit */
typedef uint16_t u16;/**< used for unsigned 16bit */
typedef uint32_t u32;/**< used for unsigned 32bit */
typedef uint64_t u64;/**< used for unsigned 64bit */
/*signed integer types*/
typedef int8_t s8;/**< used for signed 8bit */
typedef int16_t s16;/**< used for signed 16bit */
typedef int32_t s32;/**< used for signed 32bit */
typedef int64_t s64;/**< used for signed 64bit */
/************************************************
* compiler is C89 or other C standard
************************************************/
#else /* !defined(__STDC_VERSION__) */
/*!
* @brief By default it is defined as 32 bit machine configuration
* define your data types based on your
* machine/compiler/controller configuration
*/
#define MACHINE_32_BIT
/*! @brief
* If your machine support 16 bit
* define the MACHINE_16_BIT
*/
#ifdef MACHINE_16_BIT
#include <limits.h>
/*signed integer types*/
typedef signed char s8;/**< used for signed 8bit */
typedef signed short int s16;/**< used for signed 16bit */
typedef signed long int s32;/**< used for signed 32bit */
#if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
typedef long int s64;/**< used for signed 64bit */
typedef unsigned long int u64;/**< used for unsigned 64bit */
#elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
typedef long long int s64;/**< used for signed 64bit */
typedef unsigned long long int u64;/**< used for unsigned 64bit */
#else
#warning Either the correct data type for signed 64 bit integer \
could not be found, or 64 bit integers are not supported in your environment.
#warning If 64 bit integers are supported on your platform, \
please set s64 manually.
#endif
/*unsigned integer types*/
typedef unsigned char u8;/**< used for unsigned 8bit */
typedef unsigned short int u16;/**< used for unsigned 16bit */
typedef unsigned long int u32;/**< used for unsigned 32bit */
/* If your machine support 32 bit
define the MACHINE_32_BIT*/
#elif defined MACHINE_32_BIT
/*signed integer types*/
typedef signed char s8;/**< used for signed 8bit */
typedef signed short int s16;/**< used for signed 16bit */
typedef signed int s32;/**< used for signed 32bit */
typedef signed long long int s64;/**< used for signed 64bit */
/*unsigned integer types*/
typedef unsigned char u8;/**< used for unsigned 8bit */
typedef unsigned short int u16;/**< used for unsigned 16bit */
typedef unsigned int u32;/**< used for unsigned 32bit */
typedef unsigned long long int u64;/**< used for unsigned 64bit */
/* If your machine support 64 bit
define the MACHINE_64_BIT*/
#elif defined MACHINE_64_BIT
/*signed integer types*/
typedef signed char s8;/**< used for signed 8bit */
typedef signed short int s16;/**< used for signed 16bit */
typedef signed int s32;/**< used for signed 32bit */
typedef signed long int s64;/**< used for signed 64bit */
/*unsigned integer types*/
typedef unsigned char u8;/**< used for unsigned 8bit */
typedef unsigned short int u16;/**< used for unsigned 16bit */
typedef unsigned int u32;/**< used for unsigned 32bit */
typedef unsigned long int u64;/**< used for unsigned 64bit */
#else
#warning The data types defined above which not supported \
define the data types manually
#endif
#endif
/*** This else will execute for the compilers
* which are not supported the C standards
* Like C89/C99/C11***/
#else
/*!
* @brief By default it is defined as 32 bit machine configuration
* define your data types based on your
* machine/compiler/controller configuration
*/
#define MACHINE_32_BIT
/* If your machine support 16 bit
define the MACHINE_16_BIT*/
#ifdef MACHINE_16_BIT
#include <limits.h>
/*signed integer types*/
typedef signed char s8;/**< used for signed 8bit */
typedef signed short int s16;/**< used for signed 16bit */
typedef signed long int s32;/**< used for signed 32bit */
#if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
typedef long int s64;/**< used for signed 64bit */
typedef unsigned long int u64;/**< used for unsigned 64bit */
#elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
typedef long long int s64;/**< used for signed 64bit */
typedef unsigned long long int u64;/**< used for unsigned 64bit */
#else
#warning Either the correct data type for signed 64 bit integer \
could not be found, or 64 bit integers are not supported in your environment.
#warning If 64 bit integers are supported on your platform, \
please set s64 manually.
#endif
/*unsigned integer types*/
typedef unsigned char u8;/**< used for unsigned 8bit */
typedef unsigned short int u16;/**< used for unsigned 16bit */
typedef unsigned long int u32;/**< used for unsigned 32bit */
/*! @brief If your machine support 32 bit
define the MACHINE_32_BIT*/
#elif defined MACHINE_32_BIT
/*signed integer types*/
typedef signed char s8;/**< used for signed 8bit */
typedef signed short int s16;/**< used for signed 16bit */
typedef signed int s32;/**< used for signed 32bit */
typedef signed long long int s64;/**< used for signed 64bit */
/*unsigned integer types*/
typedef unsigned char u8;/**< used for unsigned 8bit */
typedef unsigned short int u16;/**< used for unsigned 16bit */
typedef unsigned int u32;/**< used for unsigned 32bit */
typedef unsigned long long int u64;/**< used for unsigned 64bit */
/* If your machine support 64 bit
define the MACHINE_64_BIT*/
#elif defined MACHINE_64_BIT
/*signed integer types*/
typedef signed char s8;/**< used for signed 8bit */
typedef signed short int s16;/**< used for signed 16bit */
typedef signed int s32;/**< used for signed 32bit */
typedef signed long int s64;/**< used for signed 64bit */
/*unsigned integer types*/
typedef unsigned char u8;/**< used for unsigned 8bit */
typedef unsigned short int u16;/**< used for unsigned 16bit */
typedef unsigned int u32;/**< used for unsigned 32bit */
typedef unsigned long int u64;/**< used for unsigned 64bit */
#else
#warning The data types defined above which not supported \
define the data types manually
#endif
#endif
#endif
/***************************************************************/
/**\name BUS READ AND WRITE FUNCTION POINTERS */
/***************************************************************/
/*!
* @brief Define the calling convention of YOUR bus communication routine.
* @note This includes types of parameters.
* This example shows the configuration for an SPI bus link.
* If your communication function looks like this:
* write_my_bus_xy(u8 device_addr,
* u8 register_addr, u8 * data, u8 length);
* The BMA2x2_WR_FUNC_PTR would equal:
* BMA2x2_WR_FUNC_PTR char
* (* bus_write)(u8, u8, u8 *, u8)
* Parameters can be mixed as needed refer to
* the \ref BMA2x2_BUS_WRITE_FUNC macro.
*/
#define BMA2x2_WR_FUNC_PTR s8(*bus_write)\
(u8, u8, u8 *, u8)
/*!
* @brief link macro between API function calls and bus write function
* @note The bus write function can change since
* this is a system dependant issue.
* If the bus_write parameter calling order is like:
* reg_addr, reg_data, wr_len it would be as it is here.
* If the parameters are differently ordered or your communication function
* like I2C need to know the device address,
* you can change this macro accordingly.
* define BMA2x2_BUS_WRITE_FUNC(dev_addr, reg_addr, reg_data, wr_len)\
* bus_write(dev_addr, reg_addr, reg_data, wr_len)
* This macro lets all API functions call YOUR communication routine in
* a way that equals your definition in the
* ref BMA2x2_WR_FUNC_PTR definition.
*/
#define BMA2x2_BUS_WRITE_FUNC(dev_addr, reg_addr, reg_data, wr_len)\
bus_write(dev_addr, reg_addr, reg_data, wr_len)
/*!
* @brief Define the calling convention of YOUR bus communication routine.
* @note This includes types of parameters. This example
*shows the configuration for an SPI bus link.
*If your communication function looks like this:
*read_my_bus_xy(u8 device_addr,
*u8 register_addr, u8* data, u8 length);
*The BMA2x2_RD_FUNC_PTR would equal:
*BMA2x2_RD_FUNC_PTR s8
*(* bus_read)(u8, u8, u8*, u8)
*Parameters can be mixed as needed refer to the
ref BMA2x2_BUS_READ_FUNC macro.
*/
#define BMA2x2_SPI_RD_MASK 0x80
/* for spi read transactions on SPI the MSB has to be set */
#define BMA2x2_RD_FUNC_PTR s8(*bus_read)\
(u8, u8, u8 *, u8)
#define BMA2x2_BRD_FUNC_PTR s8(*burst_read)\
(u8, u8, u8 *, u32)
/*!
* @brief link macro between API function calls and bus read function
* @note The bus write function can change since
* this is a system dependant issue.
* If the bus_read parameter calling order is like:
* reg_addr, reg_data, wr_len it would be as it is here.
* If the parameters are differently ordered or your
* communication function like I2C need to know the device address,
* you can change this macro accordingly.
* define BMA2x2_BUS_READ_FUNC(dev_addr, reg_addr, reg_data, wr_len)\
* bus_read(dev_addr, reg_addr, reg_data, wr_len)
* This macro lets all API functions call YOUR
* communication routine in a way that equals your definition in the
* ref BMA2x2_WR_FUNC_PTR definition.
* @note: this macro also includes the "MSB='1'" for reading BMA2x2 addresses.
*/
#define BMA2x2_BUS_READ_FUNC(dev_addr, reg_addr, reg_data, r_len)\
bus_read(dev_addr, reg_addr, reg_data, r_len)
#define BMA2x2_BURST_READ_FUNC(device_addr,\
register_addr, register_data, rd_len)\
burst_read(device_addr, register_addr, register_data, rd_len)
/**************************************************************/
/**\name I2C ADDRESS DEFINITIONS */
/**************************************************************/
/**< The following definition of I2C address is used for the following sensors
* BMA255
* BMA355
* BMA280
* BMA282
* BMA223
* BMA254
* BMA284
* BMA250E
* BMA222E
*/
#define BMA2x2_I2C_ADDR1 0x18
#define BMA2x2_I2C_ADDR2 0x19
/**< The following definition of I2C address is used for the following sensors
* BMC150
* BMC056
* BMC156
*/
#define BMA2x2_I2C_ADDR3 0x10
#define BMA2x2_I2C_ADDR4 0x11
/**************************************************************/
/**\name CONSTANTS DEFINITION */
/**************************************************************/
#define C_BMA2x2_ZERO_U8X ((u8)0)
#define C_BMA2x2_ONE_U8X ((u8)1)
#define C_BMA2x2_TWO_U8X ((u8)2)
#define C_BMA2x2_THREE_U8X ((u8)3)
#define C_BMA2x2_FOUR_U8X ((u8)4)
#define C_BMA2x2_FIVE_U8X ((u8)5)
#define C_BMA2x2_SIX_U8X ((u8)6)
#define C_BMA2x2_SEVEN_U8X ((u8)7)
#define C_BMA2x2_EIGHT_U8X ((u8)8)
#define C_BMA2x2_NINE_U8X ((u8)9)
#define C_BMA2x2_TWELVE_U8X ((u8)12)
#define C_BMA2x2_FIFETEEN_U8X ((u8)15)
#define C_BMA2x2_SIXTEEN_U8X ((u8)16)
#define C_BMA2x2_THIRTYTWO_U8X ((u8)32)
/**************************************************************/
/**\name ERROR CODE DEFINITIONS */
/**************************************************************/
#define E_OUT_OF_RANGE ((s8)-2)
#define E_BMA2x2_NULL_PTR ((s8)-127)
#define BMA2x2_NULL ((u8)0)
#define ERROR ((s8)-1)
#define SUCCESS ((u8)0)
/**************************************************************/
/**\name RETURN TYPE DEFINITION */
/**************************************************************/
#define BMA2x2_RETURN_FUNCTION_TYPE s8
/**< This refers BMA2x2 return type as char */
/**************************************************************/
/**\name REGISTER ADDRESS DEFINITIONS */
/**************************************************************/
#define BMA2x2_EEP_OFFSET 0x16
#define BMA2x2_IMAGE_BASE 0x38
#define BMA2x2_IMAGE_LEN 22
#define BMA2x2_CHIP_ID_REG 0x00
#define BMA2x2_X_AXIS_LSB_REG 0x02
#define BMA2x2_X_AXIS_MSB_REG 0x03
#define BMA2x2_Y_AXIS_LSB_REG 0x04
#define BMA2x2_Y_AXIS_MSB_REG 0x05
#define BMA2x2_Z_AXIS_LSB_REG 0x06
#define BMA2x2_Z_AXIS_MSB_REG 0x07
#define BMA2x2_TEMP_REG 0x08
#define BMA2x2_STAT1_REG 0x09
#define BMA2x2_STAT2_REG 0x0A
#define BMA2x2_STAT_TAP_SLOPE_REG 0x0B
#define BMA2x2_STAT_ORIENT_HIGH_REG 0x0C
#define BMA2x2_STAT_FIFO_REG 0x0E
#define BMA2x2_RANGE_SELECT_REG 0x0F
#define BMA2x2_BW_SELECT_REG 0x10
#define BMA2x2_MODE_CTRL_REG 0x11
#define BMA2x2_LOW_NOISE_CTRL_REG 0x12
#define BMA2x2_DATA_CTRL_REG 0x13
#define BMA2x2_RST_REG 0x14
#define BMA2x2_INTR_ENABLE1_REG 0x16
#define BMA2x2_INTR_ENABLE2_REG 0x17
#define BMA2x2_INTR_SLOW_NO_MOTION_REG 0x18
#define BMA2x2_INTR1_PAD_SELECT_REG 0x19
#define BMA2x2_INTR_DATA_SELECT_REG 0x1A
#define BMA2x2_INTR2_PAD_SELECT_REG 0x1B
#define BMA2x2_INTR_SOURCE_REG 0x1E
#define BMA2x2_INTR_SET_REG 0x20
#define BMA2x2_INTR_CTRL_REG 0x21
#define BMA2x2_LOW_DURN_REG 0x22
#define BMA2x2_LOW_THRES_REG 0x23
#define BMA2x2_LOW_HIGH_HYST_REG 0x24
#define BMA2x2_HIGH_DURN_REG 0x25
#define BMA2x2_HIGH_THRES_REG 0x26
#define BMA2x2_SLOPE_DURN_REG 0x27
#define BMA2x2_SLOPE_THRES_REG 0x28
#define BMA2x2_SLOW_NO_MOTION_THRES_REG 0x29
#define BMA2x2_TAP_PARAM_REG 0x2A
#define BMA2x2_TAP_THRES_REG 0x2B
#define BMA2x2_ORIENT_PARAM_REG 0x2C
#define BMA2x2_THETA_BLOCK_REG 0x2D
#define BMA2x2_THETA_FLAT_REG 0x2E
#define BMA2x2_FLAT_HOLD_TIME_REG 0x2F
#define BMA2x2_FIFO_WML_TRIG 0x30
#define BMA2x2_SELFTEST_REG 0x32
#define BMA2x2_EEPROM_CTRL_REG 0x33
#define BMA2x2_SERIAL_CTRL_REG 0x34
#define BMA2x2_OFFSET_CTRL_REG 0x36
#define BMA2x2_OFFSET_PARAMS_REG 0x37
#define BMA2x2_OFFSET_X_AXIS_REG 0x38
#define BMA2x2_OFFSET_Y_AXIS_REG 0x39
#define BMA2x2_OFFSET_Z_AXIS_REG 0x3A
#define BMA2x2_GP0_REG 0x3B
#define BMA2x2_GP1_REG 0x3C
#define BMA2x2_FIFO_MODE_REG 0x3E
#define BMA2x2_FIFO_DATA_OUTPUT_REG 0x3F
/**************************************************************/
/**\name ACCEL RESOLUTION DEFINITION */
/**************************************************************/
#define BMA2x2_12_RESOLUTION 0
#define BMA2x2_10_RESOLUTION 1
#define BMA2x2_14_RESOLUTION 2
/**************************************************************/
/**\name ACCEL DELAY DEFINITION */
/**************************************************************/
/* register write and read delays */
#define BMA2x2_MDELAY_DATA_TYPE u32
#define BMA2x2_EE_W_DELAY 28
/**************************************************************/
/**\name STRUCTURE DEFINITIONS */
/**************************************************************/
/*!
* @brief read accel xyz data for 10,14 and 12 bit resolution
*/
struct bma2x2_accel_data {
s16 x,/**< accel x data 10,14 and 12 resolution*/
y,/**< accel y data 10,14 and 12 resolution*/
z;/**< accel z data 10,14 and 12 resolution*/
};
/*!
* @brief read accel xyz data for 10,14 and 12 bit resolution
* and temperature output
*/
struct bma2x2_accel_data_temp {
s16 x,/**< accel x data 10,14 and 12 resolution*/
y,/**< accel y data 10,14 and 12 resolution*/
z;/**< accel z data 10,14 and 12 resolution*/
s8 temp;/**< accel temperature data*/
};
/*!
* @brief read accel xyz data for 8 bit resolution
*/
struct bma2x2_accel_eight_resolution {
s8 x,/**< accel x data with eight bit resolution*/
y,/**< accel y data with eight bit resolution*/
z;/**< accel z data with eight bit resolution*/
};
/*!
* @brief read accel xyz data for 8 bit resolution and temperature
*/
struct bma2x2_accel_eight_resolution_temp {
s8 x,/**< accel x data with eight bit resolution*/
y,/**< accel y data with eight bit resolution*/
z;/**< accel z data with eight bit resolution*/
s8 temp;/**< accel temperature data*/
};
/*!
* @brief bma2x2 initialization struct
* struct bma2x2_t is used for assigning the following parameters.
*
* Bus write function pointer: BMA2x2_WR_FUNC_PTR
* Bus read function pointer: BMA2x2_RD_FUNC_PTR
* Burst read function pointer: BMA2x2_BRD_FUNC_PTR
* Delay function pointer: delay_msec
*
* I2C address: dev_addr
* Chip id of the sensor: chip_id
*/
struct bma2x2_t {
u8 v_power_mode_u8;/**< save current bma2x2 operation mode */
u8 chip_id;/**< chip_id of bma2x2 */
u8 ctrl_mode_reg;/**< the value of power mode register 0x11*/
u8 low_mode_reg;/**< the value of power mode register 0x12*/
u8 dev_addr;/**< initializes bma2x2's I2C device address*/
u8 fifo_config;/**< store the fifo configuration register*/
BMA2x2_WR_FUNC_PTR;/**< function pointer to the SPI/I2C write function */
BMA2x2_RD_FUNC_PTR;/**< function pointer to the SPI/I2C read function */
BMA2x2_BRD_FUNC_PTR;/**< function pointer to the SPI/I2C burst read function */
void(*delay_msec)(BMA2x2_MDELAY_DATA_TYPE);
/**< function pointer to a pause in mili seconds function
*/
};
/*********************************************************************/
/**\name REGISTER BIT MASK, BIT LENGTH, BIT POSITION DEFINITIONS */
/********************************************************************/
/******************************/
/**\name CHIP ID */
/******************************/
#define BMA2x2_CHIP_ID__POS 0
#define BMA2x2_CHIP_ID__MSK 0xFF
#define BMA2x2_CHIP_ID__LEN 8
#define BMA2x2_CHIP_ID__REG BMA2x2_CHIP_ID_REG
/******************************/
/**\name DATA REGISTER-X */
/******************************/
#define BMA2x2_NEW_DATA_X__POS 0
#define BMA2x2_NEW_DATA_X__LEN 1
#define BMA2x2_NEW_DATA_X__MSK 0x01
#define BMA2x2_NEW_DATA_X__REG BMA2x2_X_AXIS_LSB_REG
#define BMA2x2_ACCEL_X14_LSB__POS 2
#define BMA2x2_ACCEL_X14_LSB__LEN 6
#define BMA2x2_ACCEL_X14_LSB__MSK 0xFC
#define BMA2x2_ACCEL_X14_LSB__REG BMA2x2_X_AXIS_LSB_REG
#define BMA2x2_ACCEL_X12_LSB__POS 4
#define BMA2x2_ACCEL_X12_LSB__LEN 4
#define BMA2x2_ACCEL_X12_LSB__MSK 0xF0
#define BMA2x2_ACCEL_X12_LSB__REG BMA2x2_X_AXIS_LSB_REG
#define BMA2x2_ACCEL_X10_LSB__POS 6
#define BMA2x2_ACCEL_X10_LSB__LEN 2
#define BMA2x2_ACCEL_X10_LSB__MSK 0xC0
#define BMA2x2_ACCEL_X10_LSB__REG BMA2x2_X_AXIS_LSB_REG
#define BMA2x2_ACCEL_X8_LSB__POS 0
#define BMA2x2_ACCEL_X8_LSB__LEN 0
#define BMA2x2_ACCEL_X8_LSB__MSK 0x00
#define BMA2x2_ACCEL_X8_LSB__REG BMA2x2_X_AXIS_LSB_REG
#define BMA2x2_ACCEL_X_MSB__POS 0
#define BMA2x2_ACCEL_X_MSB__LEN 8
#define BMA2x2_ACCEL_X_MSB__MSK 0xFF
#define BMA2x2_ACCEL_X_MSB__REG BMA2x2_X_AXIS_MSB_REG
/******************************/
/**\name DATA REGISTER-Y */
/******************************/
#define BMA2x2_NEW_DATA_Y__POS 0
#define BMA2x2_NEW_DATA_Y__LEN 1
#define BMA2x2_NEW_DATA_Y__MSK 0x01
#define BMA2x2_NEW_DATA_Y__REG BMA2x2_Y_AXIS_LSB_REG
#define BMA2x2_ACCEL_Y14_LSB__POS 2
#define BMA2x2_ACCEL_Y14_LSB__LEN 6
#define BMA2x2_ACCEL_Y14_LSB__MSK 0xFC
#define BMA2x2_ACCEL_Y14_LSB__REG BMA2x2_Y_AXIS_LSB_REG
#define BMA2x2_ACCEL_Y12_LSB__POS 4
#define BMA2x2_ACCEL_Y12_LSB__LEN 4
#define BMA2x2_ACCEL_Y12_LSB__MSK 0xF0
#define BMA2x2_ACCEL_Y12_LSB__REG BMA2x2_Y_AXIS_LSB_REG
#define BMA2x2_ACCEL_Y10_LSB__POS 6
#define BMA2x2_ACCEL_Y10_LSB__LEN 2
#define BMA2x2_ACCEL_Y10_LSB__MSK 0xC0
#define BMA2x2_ACCEL_Y10_LSB__REG BMA2x2_Y_AXIS_LSB_REG
#define BMA2x2_ACCEL_Y8_LSB__POS 0
#define BMA2x2_ACCEL_Y8_LSB__LEN 0
#define BMA2x2_ACCEL_Y8_LSB__MSK 0x00
#define BMA2x2_ACCEL_Y8_LSB__REG BMA2x2_Y_AXIS_LSB_REG
#define BMA2x2_ACCEL_Y_MSB__POS 0
#define BMA2x2_ACCEL_Y_MSB__LEN 8
#define BMA2x2_ACCEL_Y_MSB__MSK 0xFF
#define BMA2x2_ACCEL_Y_MSB__REG BMA2x2_Y_AXIS_MSB_REG
/******************************/
/**\name DATA REGISTER-Z */
/******************************/
#define BMA2x2_NEW_DATA_Z__POS 0
#define BMA2x2_NEW_DATA_Z__LEN 1
#define BMA2x2_NEW_DATA_Z__MSK 0x01
#define BMA2x2_NEW_DATA_Z__REG BMA2x2_Z_AXIS_LSB_REG
#define BMA2x2_ACCEL_Z14_LSB__POS 2
#define BMA2x2_ACCEL_Z14_LSB__LEN 6
#define BMA2x2_ACCEL_Z14_LSB__MSK 0xFC
#define BMA2x2_ACCEL_Z14_LSB__REG BMA2x2_Z_AXIS_LSB_REG
#define BMA2x2_ACCEL_Z12_LSB__POS 4
#define BMA2x2_ACCEL_Z12_LSB__LEN 4
#define BMA2x2_ACCEL_Z12_LSB__MSK 0xF0
#define BMA2x2_ACCEL_Z12_LSB__REG BMA2x2_Z_AXIS_LSB_REG
#define BMA2x2_ACCEL_Z10_LSB__POS 6
#define BMA2x2_ACCEL_Z10_LSB__LEN 2
#define BMA2x2_ACCEL_Z10_LSB__MSK 0xC0
#define BMA2x2_ACCEL_Z10_LSB__REG BMA2x2_Z_AXIS_LSB_REG
#define BMA2x2_ACCEL_Z8_LSB__POS 0
#define BMA2x2_ACCEL_Z8_LSB__LEN 0
#define BMA2x2_ACCEL_Z8_LSB__MSK 0x00
#define BMA2x2_ACCEL_Z8_LSB__REG BMA2x2_Z_AXIS_LSB_REG
#define BMA2x2_ACCEL_Z_MSB__POS 0
#define BMA2x2_ACCEL_Z_MSB__LEN 8
#define BMA2x2_ACCEL_Z_MSB__MSK 0xFF
#define BMA2x2_ACCEL_Z_MSB__REG BMA2x2_Z_AXIS_MSB_REG
/******************************/
/**\name TEMPERATURE */
/******************************/
#define BMA2x2_ACCEL_TEMP_MSB__POS 0
#define BMA2x2_ACCEL_TEMP_MSB__LEN 8
#define BMA2x2_ACCEL_TEMP_MSB__MSK 0xFF
#define BMA2x2_ACCEL_TEMP_MSB__REG BMA2x2_TEMPERATURE_REG
/***************************************/
/**\name INTERRUPT STATUS OF LOW-G */
/**************************************/
#define BMA2x2_LOW_G_INTR_STAT__POS 0
#define BMA2x2_LOW_G_INTR_STAT__LEN 1
#define BMA2x2_LOW_G_INTR_STAT__MSK 0x01
#define BMA2x2_LOW_G_INTR_STAT__REG BMA2x2_STAT1_REG
/***************************************/
/**\name INTERRUPT STATUS OF HIGH-G */
/**************************************/
#define BMA2x2_HIGH_G_INTR_STAT__POS 1
#define BMA2x2_HIGH_G_INTR_STAT__LEN 1
#define BMA2x2_HIGH_G_INTR_STAT__MSK 0x02
#define BMA2x2_HIGH_G_INTR_STAT__REG BMA2x2_STAT1_REG
/***************************************/
/**\name INTERRUPT STATUS OF SLOPE */
/**************************************/
#define BMA2x2_SLOPE_INTR_STAT__POS 2
#define BMA2x2_SLOPE_INTR_STAT__LEN 1
#define BMA2x2_SLOPE_INTR_STAT__MSK 0x04
#define BMA2x2_SLOPE_INTR_STAT__REG BMA2x2_STAT1_REG
/*******************************************/
/**\name INTERRUPT STATUS OF SLOW NO MOTION*/
/*******************************************/
#define BMA2x2_SLOW_NO_MOTION_INTR_STAT__POS 3
#define BMA2x2_SLOW_NO_MOTION_INTR_STAT__LEN 1
#define BMA2x2_SLOW_NO_MOTION_INTR_STAT__MSK 0x08
#define BMA2x2_SLOW_NO_MOTION_INTR_STAT__REG BMA2x2_STAT1_REG
/***************************************/
/**\name INTERRUPT STATUS OF DOUBLE TAP */
/**************************************/
#define BMA2x2_DOUBLE_TAP_INTR_STAT__POS 4
#define BMA2x2_DOUBLE_TAP_INTR_STAT__LEN 1
#define BMA2x2_DOUBLE_TAP_INTR_STAT__MSK 0x10
#define BMA2x2_DOUBLE_TAP_INTR_STAT__REG BMA2x2_STAT1_REG
/***************************************/
/**\name INTERRUPT STATUS OF SINGLE TAP */
/**************************************/
#define BMA2x2_SINGLE_TAP_INTR_STAT__POS 5
#define BMA2x2_SINGLE_TAP_INTR_STAT__LEN 1
#define BMA2x2_SINGLE_TAP_INTR_STAT__MSK 0x20
#define BMA2x2_SINGLE_TAP_INTR_STAT__REG BMA2x2_STAT1_REG
/***************************************/
/**\name INTERRUPT STATUS OF ORIENT*/
/**************************************/
#define BMA2x2_ORIENT_INTR_STAT__POS 6
#define BMA2x2_ORIENT_INTR_STAT__LEN 1
#define BMA2x2_ORIENT_INTR_STAT__MSK 0x40
#define BMA2x2_ORIENT_INTR_STAT__REG BMA2x2_STAT1_REG
/***************************************/
/**\name INTERRUPT STATUS OF FLAT */
/**************************************/
#define BMA2x2_FLAT_INTR_STAT__POS 7
#define BMA2x2_FLAT_INTR_STAT__LEN 1
#define BMA2x2_FLAT_INTR_STAT__MSK 0x80
#define BMA2x2_FLAT_INTR_STAT__REG BMA2x2_STAT1_REG
/***************************************/
/**\name INTERRUPT STATUS OF FIFO FULL */
/**************************************/
#define BMA2x2_FIFO_FULL_INTR_STAT__POS 5
#define BMA2x2_FIFO_FULL_INTR_STAT__LEN 1
#define BMA2x2_FIFO_FULL_INTR_STAT__MSK 0x20
#define BMA2x2_FIFO_FULL_INTR_STAT__REG BMA2x2_STAT2_REG
/*******************************************/
/**\name INTERRUPT STATUS OF FIFO WATERMARK*/
/******************************************/
#define BMA2x2_FIFO_WM_INTR_STAT__POS 6
#define BMA2x2_FIFO_WM_INTR_STAT__LEN 1
#define BMA2x2_FIFO_WM_INTR_STAT__MSK 0x40
#define BMA2x2_FIFO_WM_INTR_STAT__REG BMA2x2_STAT2_REG
/***************************************/
/**\name INTERRUPT STATUS OF DATA */
/**************************************/
#define BMA2x2_DATA_INTR_STAT__POS 7
#define BMA2x2_DATA_INTR_STAT__LEN 1
#define BMA2x2_DATA_INTR_STAT__MSK 0x80
#define BMA2x2_DATA_INTR_STAT__REG BMA2x2_STAT2_REG
/*********************************************/
/**\name INTERRUPT STATUS SLOPE XYZ AND SIGN */
/*********************************************/
#define BMA2x2_SLOPE_FIRST_X__POS 0
#define BMA2x2_SLOPE_FIRST_X__LEN 1
#define BMA2x2_SLOPE_FIRST_X__MSK 0x01
#define BMA2x2_SLOPE_FIRST_X__REG BMA2x2_STAT_TAP_SLOPE_REG
#define BMA2x2_SLOPE_FIRST_Y__POS 1
#define BMA2x2_SLOPE_FIRST_Y__LEN 1
#define BMA2x2_SLOPE_FIRST_Y__MSK 0x02
#define BMA2x2_SLOPE_FIRST_Y__REG BMA2x2_STAT_TAP_SLOPE_REG
#define BMA2x2_SLOPE_FIRST_Z__POS 2
#define BMA2x2_SLOPE_FIRST_Z__LEN 1
#define BMA2x2_SLOPE_FIRST_Z__MSK 0x04
#define BMA2x2_SLOPE_FIRST_Z__REG BMA2x2_STAT_TAP_SLOPE_REG
#define BMA2x2_SLOPE_SIGN_STAT__POS 3
#define BMA2x2_SLOPE_SIGN_STAT__LEN 1
#define BMA2x2_SLOPE_SIGN_STAT__MSK 0x08
#define BMA2x2_SLOPE_SIGN_STAT__REG BMA2x2_STAT_TAP_SLOPE_REG
/*********************************************/
/**\name INTERRUPT STATUS TAP XYZ AND SIGN */
/*********************************************/
#define BMA2x2_TAP_FIRST_X__POS 4
#define BMA2x2_TAP_FIRST_X__LEN 1
#define BMA2x2_TAP_FIRST_X__MSK 0x10
#define BMA2x2_TAP_FIRST_X__REG BMA2x2_STAT_TAP_SLOPE_REG
#define BMA2x2_TAP_FIRST_Y__POS 5
#define BMA2x2_TAP_FIRST_Y__LEN 1
#define BMA2x2_TAP_FIRST_Y__MSK 0x20
#define BMA2x2_TAP_FIRST_Y__REG BMA2x2_STAT_TAP_SLOPE_REG
#define BMA2x2_TAP_FIRST_Z__POS 6
#define BMA2x2_TAP_FIRST_Z__LEN 1
#define BMA2x2_TAP_FIRST_Z__MSK 0x40
#define BMA2x2_TAP_FIRST_Z__REG BMA2x2_STAT_TAP_SLOPE_REG
#define BMA2x2_TAP_SIGN_STAT__POS 7
#define BMA2x2_TAP_SIGN_STAT__LEN 1
#define BMA2x2_TAP_SIGN_STAT__MSK 0x80
#define BMA2x2_TAP_SIGN_STAT__REG BMA2x2_STAT_TAP_SLOPE_REG
/*********************************************/
/**\name INTERRUPT STATUS HIGH_G XYZ AND SIGN */
/*********************************************/
#define BMA2x2_HIGH_G_FIRST_X__POS 0
#define BMA2x2_HIGH_G_FIRST_X__LEN 1
#define BMA2x2_HIGH_G_FIRST_X__MSK 0x01
#define BMA2x2_HIGH_G_FIRST_X__REG BMA2x2_STAT_ORIENT_HIGH_REG
#define BMA2x2_HIGH_G_FIRST_Y__POS 1
#define BMA2x2_HIGH_G_FIRST_Y__LEN 1
#define BMA2x2_HIGH_G_FIRST_Y__MSK 0x02
#define BMA2x2_HIGH_G_FIRST_Y__REG BMA2x2_STAT_ORIENT_HIGH_REG
#define BMA2x2_HIGH_G_FIRST_Z__POS 2
#define BMA2x2_HIGH_G_FIRST_Z__LEN 1
#define BMA2x2_HIGH_G_FIRST_Z__MSK 0x04
#define BMA2x2_HIGH_G_FIRST_Z__REG BMA2x2_STAT_ORIENT_HIGH_REG
#define BMA2x2_HIGH_G_SIGN_STAT__POS 3
#define BMA2x2_HIGH_G_SIGN_STAT__LEN 1
#define BMA2x2_HIGH_G_SIGN_STAT__MSK 0x08
#define BMA2x2_HIGH_G_SIGN_STAT__REG BMA2x2_STAT_ORIENT_HIGH_REG
/*********************************************/
/**\name INTERRUPT STATUS ORIENT */
/*********************************************/
#define BMA2x2_ORIENT_STAT__POS 4
#define BMA2x2_ORIENT_STAT__LEN 3
#define BMA2x2_ORIENT_STAT__MSK 0x70
#define BMA2x2_ORIENT_STAT__REG BMA2x2_STAT_ORIENT_HIGH_REG
/*********************************************/
/**\name INTERRUPT STATUS FLAT */
/*********************************************/
#define BMA2x2_FLAT_STAT__POS 7
#define BMA2x2_FLAT_STAT__LEN 1
#define BMA2x2_FLAT_STAT__MSK 0x80
#define BMA2x2_FLAT_STAT__REG BMA2x2_STAT_ORIENT_HIGH_REG
/*********************************************/
/**\name INTERRUPT STATUS OF FIFO FRAME COUNT */
/*********************************************/
#define BMA2x2_FIFO_FRAME_COUNT_STAT__POS 0
#define BMA2x2_FIFO_FRAME_COUNT_STAT__LEN 7
#define BMA2x2_FIFO_FRAME_COUNT_STAT__MSK 0x7F
#define BMA2x2_FIFO_FRAME_COUNT_STAT__REG BMA2x2_STAT_FIFO_REG
/*********************************************/
/**\name INTERRUPT STATUS OF FIFO OVERRUN */
/*********************************************/
#define BMA2x2_FIFO_OVERRUN_STAT__POS 7
#define BMA2x2_FIFO_OVERRUN_STAT__LEN 1
#define BMA2x2_FIFO_OVERRUN_STAT__MSK 0x80
#define BMA2x2_FIFO_OVERRUN_STAT__REG BMA2x2_STAT_FIFO_REG
/****************************/
/**\name RANGE */
/****************************/
#define BMA2x2_RANGE_SELECT__POS 0
#define BMA2x2_RANGE_SELECT__LEN 4
#define BMA2x2_RANGE_SELECT__MSK 0x0F
#define BMA2x2_RANGE_SELECT__REG BMA2x2_RANGE_SELECT_REG
/****************************/
/**\name BANDWIDTH */
/****************************/
#define BMA2x2_BW__POS 0
#define BMA2x2_BW__LEN 5
#define BMA2x2_BW__MSK 0x1F
#define BMA2x2_BW__REG BMA2x2_BW_SELECT_REG
/****************************/
/**\name SLEEP DURATION */
/****************************/
#define BMA2x2_SLEEP_DURN__POS 1
#define BMA2x2_SLEEP_DURN__LEN 4
#define BMA2x2_SLEEP_DURN__MSK 0x1E
#define BMA2x2_SLEEP_DURN__REG BMA2x2_MODE_CTRL_REG
/****************************/
/**\name POWER MODEPOWER MODE */
/****************************/
#define BMA2x2_MODE_CTRL__POS 5
#define BMA2x2_MODE_CTRL__LEN 3
#define BMA2x2_MODE_CTRL__MSK 0xE0
#define BMA2x2_MODE_CTRL__REG BMA2x2_MODE_CTRL_REG
/****************************/
/**\name SLEEP TIMER */
/****************************/
#define BMA2x2_SLEEP_TIMER__POS 5
#define BMA2x2_SLEEP_TIMER__LEN 1
#define BMA2x2_SLEEP_TIMER__MSK 0x20
#define BMA2x2_SLEEP_TIMER__REG BMA2x2_LOW_NOISE_CTRL_REG
/****************************/
/**\name LOWPOWER MODE */
/****************************/
#define BMA2x2_LOW_POWER_MODE__POS 6
#define BMA2x2_LOW_POWER_MODE__LEN 1
#define BMA2x2_LOW_POWER_MODE__MSK 0x40
#define BMA2x2_LOW_POWER_MODE__REG BMA2x2_LOW_NOISE_CTRL_REG
/*******************************************/
/**\name DISABLE MSB SHADOWING PROCEDURE */
/*******************************************/
#define BMA2x2_DIS_SHADOW_PROC__POS 6
#define BMA2x2_DIS_SHADOW_PROC__LEN 1
#define BMA2x2_DIS_SHADOW_PROC__MSK 0x40
#define BMA2x2_DIS_SHADOW_PROC__REG BMA2x2_DATA_CTRL_REG
/***************************************************/
/**\name FILTERED OR UNFILTERED ACCELERATION DATA */
/***************************************************/
#define BMA2x2_ENABLE_DATA_HIGH_BW__POS 7
#define BMA2x2_ENABLE_DATA_HIGH_BW__LEN 1
#define BMA2x2_ENABLE_DATA_HIGH_BW__MSK 0x80
#define BMA2x2_ENABLE_DATA_HIGH_BW__REG BMA2x2_DATA_CTRL_REG
/***************************************************/
/**\name SOFT RESET VALUE */
/***************************************************/
#define BMA2x2_ENABLE_SOFT_RESET_VALUE 0xB6
/**********************************************/
/**\name INTERRUPT ENABLE OF SLOPE-XYZ */
/**********************************************/
#define BMA2x2_ENABLE_SLOPE_X_INTR__POS 0
#define BMA2x2_ENABLE_SLOPE_X_INTR__LEN 1
#define BMA2x2_ENABLE_SLOPE_X_INTR__MSK 0x01
#define BMA2x2_ENABLE_SLOPE_X_INTR__REG BMA2x2_INTR_ENABLE1_REG
#define BMA2x2_ENABLE_SLOPE_Y_INTR__POS 1
#define BMA2x2_ENABLE_SLOPE_Y_INTR__LEN 1
#define BMA2x2_ENABLE_SLOPE_Y_INTR__MSK 0x02
#define BMA2x2_ENABLE_SLOPE_Y_INTR__REG BMA2x2_INTR_ENABLE1_REG
#define BMA2x2_ENABLE_SLOPE_Z_INTR__POS 2
#define BMA2x2_ENABLE_SLOPE_Z_INTR__LEN 1
#define BMA2x2_ENABLE_SLOPE_Z_INTR__MSK 0x04
#define BMA2x2_ENABLE_SLOPE_Z_INTR__REG BMA2x2_INTR_ENABLE1_REG
/**********************************************/
/**\name INTERRUPT ENABLE OF DOUBLE TAP */
/**********************************************/
#define BMA2x2_ENABLE_DOUBLE_TAP_INTR__POS 4
#define BMA2x2_ENABLE_DOUBLE_TAP_INTR__LEN 1
#define BMA2x2_ENABLE_DOUBLE_TAP_INTR__MSK 0x10
#define BMA2x2_ENABLE_DOUBLE_TAP_INTR__REG BMA2x2_INTR_ENABLE1_REG
/**********************************************/
/**\name INTERRUPT ENABLE OF SINGLE TAP */
/**********************************************/
#define BMA2x2_ENABLE_SINGLE_TAP_INTR__POS 5
#define BMA2x2_ENABLE_SINGLE_TAP_INTR__LEN 1
#define BMA2x2_ENABLE_SINGLE_TAP_INTR__MSK 0x20
#define BMA2x2_ENABLE_SINGLE_TAP_INTR__REG BMA2x2_INTR_ENABLE1_REG
/**********************************************/
/**\name INTERRUPT ENABLE OF ORIENT */
/**********************************************/
#define BMA2x2_ENABLE_ORIENT_INTR__POS 6
#define BMA2x2_ENABLE_ORIENT_INTR__LEN 1
#define BMA2x2_ENABLE_ORIENT_INTR__MSK 0x40
#define BMA2x2_ENABLE_ORIENT_INTR__REG BMA2x2_INTR_ENABLE1_REG
/**********************************************/
/**\name INTERRUPT ENABLE OF FLAT */
/**********************************************/
#define BMA2x2_ENABLE_FLAT_INTR__POS 7
#define BMA2x2_ENABLE_FLAT_INTR__LEN 1
#define BMA2x2_ENABLE_FLAT_INTR__MSK 0x80
#define BMA2x2_ENABLE_FLAT_INTR__REG BMA2x2_INTR_ENABLE1_REG
/**********************************************/
/**\name INTERRUPT ENABLE OF HIGH_G-XYZ */
/**********************************************/
#define BMA2x2_ENABLE_HIGH_G_X_INTR__POS 0
#define BMA2x2_ENABLE_HIGH_G_X_INTR__LEN 1
#define BMA2x2_ENABLE_HIGH_G_X_INTR__MSK 0x01
#define BMA2x2_ENABLE_HIGH_G_X_INTR__REG BMA2x2_INTR_ENABLE2_REG
#define BMA2x2_ENABLE_HIGH_G_Y_INTR__POS 1
#define BMA2x2_ENABLE_HIGH_G_Y_INTR__LEN 1