SAILAPIGuide  1_10_00_06
bmi160.h
Go to the documentation of this file.
1 
59 /* user defined code to be added here ... */
60 #ifndef __BMI160_H__
61 #define __BMI160_H__
62 
75 #ifdef __KERNEL__
76 
77 #include <linux/types.h>
78 /* singed integer type*/
79 typedef int8_t s8;
80 typedef int16_t s16;
81 typedef int32_t s32;
82 typedef int64_t s64;
84 typedef u_int8_t u8;
85 typedef u_int16_t u16;
86 typedef u_int32_t u32;
87 typedef u_int64_t u64;
91 #else /* ! __KERNEL__ */
92 /**********************************************************
93 * These definition uses for define the C
94 * standard version data types
95 ***********************************************************/
96 # if defined(__STDC_VERSION__)
97 
98 /************************************************
99  * compiler is C11 C standard
100 ************************************************/
101 #if (__STDC_VERSION__ == 201112L)
102 
103 /************************************************/
104 #include <stdint.h>
105 /************************************************/
106 
107 /*unsigned integer types*/
108 typedef uint8_t u8;
109 typedef uint16_t u16;
110 typedef uint32_t u32;
111 typedef uint64_t u64;
113 /*signed integer types*/
114 typedef int8_t s8;
115 typedef int16_t s16;
116 typedef int32_t s32;
117 typedef int64_t s64;
118 /************************************************
119  * compiler is C99 C standard
120 ************************************************/
121 
122 #elif (__STDC_VERSION__ == 199901L)
123 
124 /* stdint.h is a C99 supported c library.
125 which is used to fixed the integer size*/
126 /************************************************/
127 #include <stdint.h>
128 /************************************************/
129 
130 /*unsigned integer types*/
131 typedef uint8_t u8;
132 typedef uint16_t u16;
133 typedef uint32_t u32;
134 typedef uint64_t u64;
136 /*signed integer types*/
137 typedef int8_t s8;
138 typedef int16_t s16;
139 typedef int32_t s32;
140 typedef int64_t s64;
141 /************************************************
142  * compiler is C89 or other C standard
143 ************************************************/
144 
145 #else /* !defined(__STDC_VERSION__) */
146 
151 #define MACHINE_32_BIT
152 
157 #ifdef MACHINE_16_BIT
158 #include <limits.h>
159 /*signed integer types*/
160 typedef signed char s8;
161 typedef signed short int s16;
162 typedef signed long int s32;
164 #if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
165 typedef long int s64;
166 typedef unsigned long int u64;
167 #elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
168 typedef long long int s64;
169 typedef unsigned long long int u64;
170 #else
171 #warning Either the correct data type for signed 64 bit integer \
172 could not be found, or 64 bit integers are not supported in your environment.
173 #warning If 64 bit integers are supported on your platform, \
174 please set s64 manually.
175 #endif
176 
177 /*unsigned integer types*/
178 typedef unsigned char u8;
179 typedef unsigned short int u16;
180 typedef unsigned long int u32;
182 /* If your machine support 32 bit
183 define the MACHINE_32_BIT*/
184 #elif defined MACHINE_32_BIT
185 /*signed integer types*/
186 typedef signed char s8;
187 typedef signed short int s16;
188 typedef signed int s32;
189 typedef signed long long int s64;
191 /*unsigned integer types*/
192 typedef unsigned char u8;
193 typedef unsigned short int u16;
194 typedef unsigned int u32;
195 typedef unsigned long long int u64;
197 /* If your machine support 64 bit
198 define the MACHINE_64_BIT*/
199 #elif defined MACHINE_64_BIT
200 /*signed integer types*/
201 typedef signed char s8;
202 typedef signed short int s16;
203 typedef signed int s32;
204 typedef signed long int s64;
206 /*unsigned integer types*/
207 typedef unsigned char u8;
208 typedef unsigned short int u16;
209 typedef unsigned int u32;
210 typedef unsigned long int u64;
212 #else
213 #warning The data types defined above which not supported \
214 define the data types manually
215 #endif
216 #endif
217 
218 /*** This else will execute for the compilers
219  * which are not supported the C standards
220  * Like C89/C99/C11***/
221 #else
222 
227 #define MACHINE_32_BIT
228 
229 /* If your machine support 16 bit
230 define the MACHINE_16_BIT*/
231 #ifdef MACHINE_16_BIT
232 #include <limits.h>
233 /*signed integer types*/
234 typedef signed char s8;
235 typedef signed short int s16;
236 typedef signed long int s32;
238 #if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
239 typedef long int s64;
240 typedef unsigned long int u64;
241 #elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
242 typedef long long int s64;
243 typedef unsigned long long int u64;
244 #else
245 #warning Either the correct data type for signed 64 bit integer \
246 could not be found, or 64 bit integers are not supported in your environment.
247 #warning If 64 bit integers are supported on your platform, \
248 please set s64 manually.
249 #endif
250 
251 /*unsigned integer types*/
252 typedef unsigned char u8;
253 typedef unsigned short int u16;
254 typedef unsigned long int u32;
258 #elif defined MACHINE_32_BIT
259 /*signed integer types*/
260 typedef signed char s8;
261 typedef signed short int s16;
262 typedef signed int s32;
263 typedef signed long long int s64;
265 /*unsigned integer types*/
266 typedef unsigned char u8;
267 typedef unsigned short int u16;
268 typedef unsigned int u32;
269 typedef unsigned long long int u64;
271 /* If your machine support 64 bit
272 define the MACHINE_64_BIT*/
273 #elif defined MACHINE_64_BIT
274 /*signed integer types*/
275 typedef signed char s8;
276 typedef signed short int s16;
277 typedef signed int s32;
278 typedef signed long int s64;
280 /*unsigned integer types*/
281 typedef unsigned char u8;
282 typedef unsigned short int u16;
283 typedef unsigned int u32;
284 typedef unsigned long int u64;
286 #else
287 #warning The data types defined above which not supported \
288 define the data types manually
289 #endif
290 #endif
291 #endif
292 /***************************************************************/
294 /***************************************************************/
315 #define BMI160_WR_FUNC_PTR s8 (*bus_write)(u8, u8,\
316 u8 *, u8)
317 
337 #define BMI160_BUS_WRITE_FUNC(dev_addr, reg_addr, reg_data, wr_len)\
338  bus_write(dev_addr, reg_addr, reg_data, wr_len)
339 
358 #define BMI160_SPI_RD_MASK (0x80) /* for spi read transactions on SPI the
359  MSB has to be set */
360 #define BMI160_RD_FUNC_PTR s8 (*bus_read)(u8,\
361  u8, u8 *, u8)
362 
363 #define BMI160_BRD_FUNC_PTR s8 \
364 (*burst_read)(u8, u8, u8 *, u32)
365 
389 #define BMI160_BUS_READ_FUNC(dev_addr, reg_addr, reg_data, r_len)\
390  bus_read(dev_addr, reg_addr, reg_data, r_len)
391 
392 #define BMI160_BURST_READ_FUNC(device_addr, \
393 register_addr, register_data, rd_len)\
394 burst_read(device_addr, register_addr, register_data, rd_len)
396 /* enable the macro for FIFO functionalities when FIFO is used*/
397 #define FIFO_ENABLE
398 /* enable the macro of the secondary interface which is used */
399 /* used to select the secondary interface as YAS537 */
400 #define YAS537
401 /*#define YAS532*/ /* used to select the secondary interface as YAS532 */
402 /*#define AKM09911*/ /* used to select the secondary interface as AKM09911 */
403 /*#define AKM09912 */ /* used to select the secondary interface as AKM09912 */
404 
405 #define BMI160_MDELAY_DATA_TYPE u32
406 
407 /***************************************************************/
409 /***************************************************************/
410 #define BMI160_I2C_ADDR1 (0x68)
411 
412 #define BMI160_I2C_ADDR2 (0x69)
414 #define BMI160_AUX_BMM150_I2C_ADDRESS (0x13)
416 #define BMI160_AUX_YAS532_I2C_ADDRESS (0x2E)
418 #define BMI160_AUX_AKM09911_I2C_ADDR_1 (0x0C)
420 #define BMI160_AUX_AKM09911_I2C_ADDR_2 (0x0D)
422 #define BMI160_AUX_AKM09912_I2C_ADDR_1 (0x0C)
424 #define BMI160_AUX_AKM09912_I2C_ADDR_2 (0x0D)
426 #define BMI160_AUX_AKM09912_I2C_ADDR_3 (0x0E)
428 #define BMI160_AUX_AKM09912_I2C_ADDR_4 (0x0F)
430 /*******************************************/
432 /******************************************/
433 #define BMI160_INIT_VALUE (0)
434 #define BMI160_ASSIGN_DATA (1)
435 #define BMI160_GEN_READ_WRITE_DATA_LENGTH (1)
436 #define BMI160_MAXIMUM_TIMEOUT (10)
438 /* output data rate condition check*/
439 #define BMI160_OUTPUT_DATA_RATE0 (0)
440 #define BMI160_OUTPUT_DATA_RATE1 (1)
441 #define BMI160_OUTPUT_DATA_RATE2 (2)
442 #define BMI160_OUTPUT_DATA_RATE3 (3)
443 #define BMI160_OUTPUT_DATA_RATE4 (4)
444 #define BMI160_OUTPUT_DATA_RATE5 (5)
445 #define BMI160_OUTPUT_DATA_RATE6 (14)
446 #define BMI160_OUTPUT_DATA_RATE7 (15)
448 /*unmap significant motion*/
449 #define V_ANY_MOTION_INTR_STAT (4)
450 #define V_ANY_MOTION_AXIS_STAT (7)
451 
452 /* accel range check*/
453 #define BMI160_ACCEL_RANGE0 (3)
454 #define BMI160_ACCEL_RANGE1 (5)
455 #define BMI160_ACCEL_RANGE3 (8)
456 #define BMI160_ACCEL_RANGE4 (12)
458 /* check the status of registers*/
459 #define BMI160_FOC_STAT_HIGH (1)
460 #define BMI160_SIG_MOTION_STAT_HIGH (1)
461 #define BMI160_STEP_DET_STAT_HIGH (1)
463 /*condition check for reading and writing data*/
464 #define BMI160_MAX_VALUE_SIGNIFICANT_MOTION (1)
465 #define BMI160_MAX_VALUE_FIFO_FILTER (1)
466 #define BMI160_MAX_VALUE_FIFO_TIME (1)
467 #define BMI160_MAX_VALUE_FIFO_INTR (1)
468 #define BMI160_MAX_VALUE_FIFO_HEADER (1)
469 #define BMI160_MAX_VALUE_FIFO_MAG (1)
470 #define BMI160_MAX_VALUE_FIFO_ACCEL (1)
471 #define BMI160_MAX_VALUE_FIFO_GYRO (1)
472 #define BMI160_MAX_VALUE_SOURCE_INTR (1)
473 #define BMI160_MAX_VALUE_LOW_G_MODE (1)
474 #define BMI160_MAX_VALUE_NO_MOTION (1)
475 #define BMI160_MAX_VALUE_TAP_SHOCK (1)
476 #define BMI160_MAX_VALUE_TAP_QUIET (1)
477 #define BMI160_MAX_VALUE_ORIENT_UD (1)
478 #define BMI160_MAX_VALUE_ORIENT_AXES (1)
479 #define BMI160_MAX_VALUE_NVM_PROG (1)
480 #define BMI160_MAX_VALUE_SPI3 (1)
481 #define BMI160_MAX_VALUE_PAGE (1)
482 #define BMI160_MAX_VALUE_I2C_WDT (1)
483 #define BMI160_MAX_VALUE_SLEEP_STATE (1)
484 #define BMI160_MAX_VALUE_WAKEUP_INTR (1)
485 #define BMI160_MAX_VALUE_SELFTEST_SIGN (1)
486 #define BMI160_MAX_VALUE_SELFTEST_AMP (1)
487 #define BMI160_MAX_VALUE_SELFTEST_START (1)
489 #define BMI160_MAX_GYRO_WAKEUP_TRIGGER (3)
490 #define BMI160_MAX_ACCEL_SELFTEST_AXIS (3)
491 #define BMI160_MAX_GYRO_STEP_COUNTER (1)
492 #define BMI160_MAX_GYRO_BW (3)
493 #define BMI160_MAX_ACCEL_BW (7)
494 #define BMI160_MAX_ORIENT_MODE (3)
495 #define BMI160_MAX_ORIENT_BLOCKING (3)
496 #define BMI160_MAX_FLAT_HOLD (3)
497 #define BMI160_MAX_ACCEL_FOC (3)
498 #define BMI160_MAX_IF_MODE (3)
499 #define BMI160_MAX_TARGET_PAGE (3)
500 #define BMI160_MAX_GYRO_RANGE (4)
501 #define BMI160_MAX_GYRO_SLEEP_TIGGER (7)
502 #define BMI160_MAX_TAP_TURN (7)
503 #define BMI160_MAX_UNDER_SAMPLING (1)
504 #define BMI160_MAX_UNDER_SIG_MOTION (3)
505 #define BMI160_MAX_ACCEL_OUTPUT_DATA_RATE (12)
506 #define BMI160_MAX_LATCH_INTR (15)
507 #define BMI160_MAX_FLAT_HYST (15)
508 #define BMI160_MAX_ORIENT_THETA (63)
509 #define BMI160_MAX_FLAT_THETA (63)
511 #ifdef FIFO_ENABLE
512 /* FIFO index definitions*/
513 #define BMI160_FIFO_X_LSB_DATA (0)
514 #define BMI160_FIFO_X_MSB_DATA (1)
515 #define BMI160_FIFO_Y_LSB_DATA (2)
516 #define BMI160_FIFO_Y_MSB_DATA (3)
517 #define BMI160_FIFO_Z_LSB_DATA (4)
518 #define BMI160_FIFO_Z_MSB_DATA (5)
519 #define BMI160_FIFO_R_LSB_DATA (6)
520 #define BMI160_FIFO_R_MSB_DATA (7)
521 /* FIFO gyro definition*/
522 #define BMI160_GA_FIFO_G_X_LSB (0)
523 #define BMI160_GA_FIFO_G_X_MSB (1)
524 #define BMI160_GA_FIFO_G_Y_LSB (2)
525 #define BMI160_GA_FIFO_G_Y_MSB (3)
526 #define BMI160_GA_FIFO_G_Z_LSB (4)
527 #define BMI160_GA_FIFO_G_Z_MSB (5)
528 #define BMI160_GA_FIFO_A_X_LSB (6)
529 #define BMI160_GA_FIFO_A_X_MSB (7)
530 #define BMI160_GA_FIFO_A_Y_LSB (8)
531 #define BMI160_GA_FIFO_A_Y_MSB (9)
532 #define BMI160_GA_FIFO_A_Z_LSB (10)
533 #define BMI160_GA_FIFO_A_Z_MSB (11)
534 /* FIFO mag/gyro/accel definition*/
535 #define BMI160_MGA_FIFO_M_X_LSB (0)
536 #define BMI160_MGA_FIFO_M_X_MSB (1)
537 #define BMI160_MGA_FIFO_M_Y_LSB (2)
538 #define BMI160_MGA_FIFO_M_Y_MSB (3)
539 #define BMI160_MGA_FIFO_M_Z_LSB (4)
540 #define BMI160_MGA_FIFO_M_Z_MSB (5)
541 #define BMI160_MGA_FIFO_M_R_LSB (6)
542 #define BMI160_MGA_FIFO_M_R_MSB (7)
543 #define BMI160_MGA_FIFO_G_X_LSB (8)
544 #define BMI160_MGA_FIFO_G_X_MSB (9)
545 #define BMI160_MGA_FIFO_G_Y_LSB (10)
546 #define BMI160_MGA_FIFO_G_Y_MSB (11)
547 #define BMI160_MGA_FIFO_G_Z_LSB (12)
548 #define BMI160_MGA_FIFO_G_Z_MSB (13)
549 #define BMI160_MGA_FIFO_A_X_LSB (14)
550 #define BMI160_MGA_FIFO_A_X_MSB (15)
551 #define BMI160_MGA_FIFO_A_Y_LSB (16)
552 #define BMI160_MGA_FIFO_A_Y_MSB (17)
553 #define BMI160_MGA_FIFO_A_Z_LSB (18)
554 #define BMI160_MGA_FIFO_A_Z_MSB (19)
555 /* FIFO mag definition*/
556 #define BMI160_MA_FIFO_M_X_LSB (0)
557 #define BMI160_MA_FIFO_M_X_MSB (1)
558 #define BMI160_MA_FIFO_M_Y_LSB (2)
559 #define BMI160_MA_FIFO_M_Y_MSB (3)
560 #define BMI160_MA_FIFO_M_Z_LSB (4)
561 #define BMI160_MA_FIFO_M_Z_MSB (5)
562 #define BMI160_MA_FIFO_M_R_LSB (6)
563 #define BMI160_MA_FIFO_M_R_MSB (7)
564 #define BMI160_MA_FIFO_A_X_LSB (8)
565 #define BMI160_MA_FIFO_A_X_MSB (9)
566 #define BMI160_MA_FIFO_A_Y_LSB (10)
567 #define BMI160_MA_FIFO_A_Y_MSB (11)
568 #define BMI160_MA_FIFO_A_Z_LSB (12)
569 #define BMI160_MA_FIFO_A_Z_MSB (13)
570 /* FIFO mag/gyro definition*/
571 #define BMI160_MG_FIFO_M_X_LSB (0)
572 #define BMI160_MG_FIFO_M_X_MSB (1)
573 #define BMI160_MG_FIFO_M_Y_LSB (2)
574 #define BMI160_MG_FIFO_M_Y_MSB (3)
575 #define BMI160_MG_FIFO_M_Z_LSB (4)
576 #define BMI160_MG_FIFO_M_Z_MSB (5)
577 #define BMI160_MG_FIFO_M_R_LSB (6)
578 #define BMI160_MG_FIFO_M_R_MSB (7)
579 #define BMI160_MG_FIFO_G_X_LSB (8)
580 #define BMI160_MG_FIFO_G_X_MSB (9)
581 #define BMI160_MG_FIFO_G_Y_LSB (10)
582 #define BMI160_MG_FIFO_G_Y_MSB (11)
583 #define BMI160_MG_FIFO_G_Z_LSB (12)
584 #define BMI160_MG_FIFO_G_Z_MSB (13)
585 /* FIFO length definitions*/
586 #define BMI160_FIFO_SENSOR_TIME_LSB (0)
587 #define BMI160_FIFO_SENSOR_TIME_XLSB (1)
588 #define BMI160_FIFO_SENSOR_TIME_MSB (2)
589 #define BMI160_FIFO_SENSOR_TIME_LENGTH (3)
590 #define BMI160_FIFO_A_LENGTH (6)
591 #define BMI160_FIFO_G_LENGTH (6)
592 #define BMI160_FIFO_M_LENGTH (8)
593 #define BMI160_FIFO_AG_LENGTH (12)
594 #define BMI160_FIFO_AMG_LENGTH (20)
595 #define BMI160_FIFO_MA_OR_MG_LENGTH (14)
596 #define BMI160_FIFO_LENGTH_LSB_BYTE (0)
597 #define BMI160_FIFO_LENGTH_MSB_BYTE (1)
599 #endif
601 /* bus read and write length for mag, accel and gyro*/
602 #define BMI160_MAG_X_DATA_LENGTH (2)
603 #define BMI160_MAG_Y_DATA_LENGTH (2)
604 #define BMI160_MAG_Z_DATA_LENGTH (2)
605 #define BMI160_MAG_R_DATA_LENGTH (2)
606 #define BMI160_MAG_XYZ_DATA_LENGTH (6)
607 #define BMI160_MAG_XYZR_DATA_LENGTH (8)
608 #define BMI160_MAG_YAS_DATA_LENGTH (8)
609 #define BMI160_GYRO_DATA_LENGTH (2)
610 #define BMI160_GYRO_XYZ_DATA_LENGTH (6)
611 #define BMI160_ACCEL_DATA_LENGTH (2)
612 #define BMI160_ACCEL_XYZ_DATA_LENGTH (6)
613 #define BMI160_TEMP_DATA_LENGTH (2)
614 #define BMI160_FIFO_DATA_LENGTH (2)
615 #define BMI160_STEP_COUNTER_LENGTH (2)
616 #define BMI160_SENSOR_TIME_LENGTH (3)
618 /* Delay definitions*/
619 #define BMI160_SEC_INTERFACE_GEN_READ_WRITE_DELAY (5)
620 #define BMI160_BMM150_WAKEUP_DELAY1 (2)
621 #define BMI160_BMM150_WAKEUP_DELAY2 (3)
622 #define BMI160_BMM150_WAKEUP_DELAY3 (1)
623 #define BMI160_YAS532_OFFSET_DELAY (2)
624 #define BMI160_GEN_READ_WRITE_DELAY (1)
625 #define BMI160_YAS532_MEASUREMENT_DELAY (25)
626 #define BMI160_YAS_ACQ_COMMAND_DELAY (50)
627 #define BMI160_YAS532_SET_INITIAL_VALUE_DELAY (200)
628 #define BMI160_AKM_INIT_DELAY (60)
629 /****************************************************/
631 /***************************************************/
632 #define BMI160_ACCEL_X_DATA_SIZE (2)
633 #define BMI160_ACCEL_Y_DATA_SIZE (2)
634 #define BMI160_ACCEL_Z_DATA_SIZE (2)
635 #define BMI160_ACCEL_XYZ_DATA_SIZE (6)
637 #define BMI160_GYRO_X_DATA_SIZE (2)
638 #define BMI160_GYRO_Y_DATA_SIZE (2)
639 #define BMI160_GYRO_Z_DATA_SIZE (2)
640 #define BMI160_GYRO_XYZ_DATA_SIZE (6)
642 #define BMI160_MAG_X_DATA_SIZE (2)
643 #define BMI160_MAG_Y_DATA_SIZE (2)
644 #define BMI160_MAG_Z_DATA_SIZE (2)
645 #define BMI160_MAG_R_DATA_SIZE (2)
646 #define BMI160_MAG_XYZ_DATA_SIZE (6)
647 #define BMI160_MAG_XYZR_DATA_SIZE (8)
648 #define BMI160_MAG_TRIM_DATA_SIZE (16)
651 #define BMI160_TEMP_DATA_SIZE (2)
652 #define BMI160_FIFO_DATA_SIZE (2)
653 #define BMI160_STEP_COUNT_DATA_SIZE (2)
655 #define BMI160_SENSOR_TIME_DATA_SIZE (3)
656 #define BMI160_AKM_SENSITIVITY_DATA_SIZE (3)
657 #define BMI160_HARD_OFFSET_DATA_SIZE (3)
658 #define BMI160_YAS_XY1Y2_DATA_SIZE (3)
659 #define BMI160_YAS_FLAG_DATA_SIZE (3)
660 #define BMI160_YAS_TEMP_DATA_SIZE (3)
661 #define BMI160_YAS_H_DATA_SIZE (3)
662 #define BMI160_YAS_S_DATA_SIZE (3)
663 #define BMI160_YAS_CORRECT_DATA_SIZE (5)
664 #define BMI160_YAS_XY1Y2T_DATA_SIZE (8)
665 #define BMI160_YAS537_CALIB_DATA_SIZE (17)
666 #define BMI160_YAS532_CALIB_DATA_SIZE (14)
667 #define BMI160_GYRO_ACCEL_SENSORTIME_DATA_SIZE (15)
668 #define BMI160_ACCEL_SENSORTIME_DATA_SIZE (9)
671 #define BMI160_GYRO_ACCEL_SENSORTIME_DATA (1)
672 #define BMI160_ACCEL_SENSORTIME_DATA (0)
673 
676 /****************************************************/
678 /***************************************************/
679 #define BMI160_SENSOR_TIME_MSB_BYTE (2)
680 #define BMI160_SENSOR_TIME_XLSB_BYTE (1)
681 #define BMI160_SENSOR_TIME_LSB_BYTE (0)
683 #define BMI160_MAG_X_LSB_BYTE (0)
684 #define BMI160_MAG_X_MSB_BYTE (1)
685 #define BMI160_MAG_Y_LSB_BYTE (0)
686 #define BMI160_MAG_Y_MSB_BYTE (1)
687 #define BMI160_MAG_Z_LSB_BYTE (0)
688 #define BMI160_MAG_Z_MSB_BYTE (1)
689 #define BMI160_MAG_R_LSB_BYTE (0)
690 #define BMI160_MAG_R_MSB_BYTE (1)
691 #define BMI160_DATA_FRAME_MAG_X_LSB_BYTE (0)
692 #define BMI160_DATA_FRAME_MAG_X_MSB_BYTE (1)
693 #define BMI160_DATA_FRAME_MAG_Y_LSB_BYTE (2)
694 #define BMI160_DATA_FRAME_MAG_Y_MSB_BYTE (3)
695 #define BMI160_DATA_FRAME_MAG_Z_LSB_BYTE (4)
696 #define BMI160_DATA_FRAME_MAG_Z_MSB_BYTE (5)
697 #define BMI160_DATA_FRAME_MAG_R_LSB_BYTE (6)
698 #define BMI160_DATA_FRAME_MAG_R_MSB_BYTE (7)
700 #define BMI160_GYRO_X_LSB_BYTE (0)
701 #define BMI160_GYRO_X_MSB_BYTE (1)
702 #define BMI160_GYRO_Y_LSB_BYTE (0)
703 #define BMI160_GYRO_Y_MSB_BYTE (1)
704 #define BMI160_GYRO_Z_LSB_BYTE (0)
705 #define BMI160_GYRO_Z_MSB_BYTE (1)
706 #define BMI160_DATA_FRAME_GYRO_X_LSB_BYTE (0)
707 #define BMI160_DATA_FRAME_GYRO_X_MSB_BYTE (1)
708 #define BMI160_DATA_FRAME_GYRO_Y_LSB_BYTE (2)
709 #define BMI160_DATA_FRAME_GYRO_Y_MSB_BYTE (3)
710 #define BMI160_DATA_FRAME_GYRO_Z_LSB_BYTE (4)
711 #define BMI160_DATA_FRAME_GYRO_Z_MSB_BYTE (5)
713 #define BMI160_ACCEL_X_LSB_BYTE (0)
714 #define BMI160_ACCEL_X_MSB_BYTE (1)
715 #define BMI160_ACCEL_Y_LSB_BYTE (0)
716 #define BMI160_ACCEL_Y_MSB_BYTE (1)
717 #define BMI160_ACCEL_Z_LSB_BYTE (0)
718 #define BMI160_ACCEL_Z_MSB_BYTE (1)
719 #define BMI160_DATA_FRAME_ACCEL_X_LSB_BYTE (0)
720 #define BMI160_DATA_FRAME_ACCEL_X_MSB_BYTE (1)
721 #define BMI160_DATA_FRAME_ACCEL_Y_LSB_BYTE (2)
722 #define BMI160_DATA_FRAME_ACCEL_Y_MSB_BYTE (3)
723 #define BMI160_DATA_FRAME_ACCEL_Z_LSB_BYTE (4)
724 #define BMI160_DATA_FRAME_ACCEL_Z_MSB_BYTE (5)
726 #define BMI160_TEMP_LSB_BYTE (0)
727 #define BMI160_TEMP_MSB_BYTE (1)
728 #define BMI160_STEP_COUNT_LSB_BYTE (0)
729 #define BMI160_STEP_COUNT_MSB_BYTE (1)
730 /****************************************************/
732 /***************************************************/
733 
734 #define E_BMI160_NULL_PTR ((s8)-127)
735 #define E_BMI160_COMM_RES ((s8)-1)
736 #define E_BMI160_OUT_OF_RANGE ((s8)-2)
737 #define E_BMI160_BUSY ((s8)-3)
738 #define SUCCESS ((u8)0)
739 #define ERROR ((s8)-1)
741 /* Constants */
742 #define BMI160_NULL (0)
743 #define BMI160_DELAY_SETTLING_TIME (5)
744 /*This refers BMI160 return type as s8 */
745 #define BMI160_RETURN_FUNCTION_TYPE s8
746 /****************************************************/
748 /***************************************************/
749 /*******************/
751 /*******************/
752 #define BMI160_USER_CHIP_ID_ADDR (0x00)
753 /*******************/
755 /*******************/
756 #define BMI160_USER_ERROR_ADDR (0X02)
757 /*******************/
759 /*******************/
760 #define BMI160_USER_PMU_STAT_ADDR (0X03)
761 /*******************/
763 /*******************/
764 #define BMI160_USER_DATA_0_ADDR (0X04)
765 #define BMI160_USER_DATA_1_ADDR (0X05)
766 #define BMI160_USER_DATA_2_ADDR (0X06)
767 #define BMI160_USER_DATA_3_ADDR (0X07)
768 #define BMI160_USER_DATA_4_ADDR (0X08)
769 #define BMI160_USER_DATA_5_ADDR (0X09)
770 #define BMI160_USER_DATA_6_ADDR (0X0A)
771 #define BMI160_USER_DATA_7_ADDR (0X0B)
772 /*******************/
774 /*******************/
775 #define BMI160_USER_DATA_8_ADDR (0X0C)
776 #define BMI160_USER_DATA_9_ADDR (0X0D)
777 #define BMI160_USER_DATA_10_ADDR (0X0E)
778 #define BMI160_USER_DATA_11_ADDR (0X0F)
779 #define BMI160_USER_DATA_12_ADDR (0X10)
780 #define BMI160_USER_DATA_13_ADDR (0X11)
781 /*******************/
783 /*******************/
784 #define BMI160_USER_DATA_14_ADDR (0X12)
785 #define BMI160_USER_DATA_15_ADDR (0X13)
786 #define BMI160_USER_DATA_16_ADDR (0X14)
787 #define BMI160_USER_DATA_17_ADDR (0X15)
788 #define BMI160_USER_DATA_18_ADDR (0X16)
789 #define BMI160_USER_DATA_19_ADDR (0X17)
790 /*******************/
792 /*******************/
793 #define BMI160_USER_SENSORTIME_0_ADDR (0X18)
794 #define BMI160_USER_SENSORTIME_1_ADDR (0X19)
795 #define BMI160_USER_SENSORTIME_2_ADDR (0X1A)
796 /*******************/
798 /*******************/
799 #define BMI160_USER_STAT_ADDR (0X1B)
800 /*******************/
802 /*******************/
803 #define BMI160_USER_INTR_STAT_0_ADDR (0X1C)
804 #define BMI160_USER_INTR_STAT_1_ADDR (0X1D)
805 #define BMI160_USER_INTR_STAT_2_ADDR (0X1E)
806 #define BMI160_USER_INTR_STAT_3_ADDR (0X1F)
807 /*******************/
809 /*******************/
810 #define BMI160_USER_TEMPERATURE_0_ADDR (0X20)
811 #define BMI160_USER_TEMPERATURE_1_ADDR (0X21)
812 /*******************/
814 /*******************/
815 #define BMI160_USER_FIFO_LENGTH_0_ADDR (0X22)
816 #define BMI160_USER_FIFO_LENGTH_1_ADDR (0X23)
817 #define BMI160_USER_FIFO_DATA_ADDR (0X24)
818 /***************************************************/
820 /******************************************************/
821 #define BMI160_USER_ACCEL_CONFIG_ADDR (0X40)
822 /*******************/
824 /*******************/
825 #define BMI160_USER_ACCEL_RANGE_ADDR (0X41)
826 /***************************************************/
828 /******************************************************/
829 #define BMI160_USER_GYRO_CONFIG_ADDR (0X42)
830 /*******************/
832 /*******************/
833 #define BMI160_USER_GYRO_RANGE_ADDR (0X43)
834 /***************************************************/
836 /******************************************************/
837 #define BMI160_USER_MAG_CONFIG_ADDR (0X44)
838 #ifdef FIFO_ENABLE
839 /***************************************************/
841 /******************************************************/
842 #define BMI160_USER_FIFO_DOWN_ADDR (0X45)
843 /***************************************************/
845 /******************************************************/
846 #define BMI160_USER_FIFO_CONFIG_0_ADDR (0X46)
847 #define BMI160_USER_FIFO_CONFIG_1_ADDR (0X47)
848 #endif
850 /***************************************************/
852 /******************************************************/
853 #define BMI160_USER_MAG_IF_0_ADDR (0X4B)
854 #define BMI160_USER_MAG_IF_1_ADDR (0X4C)
855 #define BMI160_USER_MAG_IF_2_ADDR (0X4D)
856 #define BMI160_USER_MAG_IF_3_ADDR (0X4E)
857 #define BMI160_USER_MAG_IF_4_ADDR (0X4F)
858 /***************************************************/
860 /******************************************************/
861 #define BMI160_USER_INTR_ENABLE_0_ADDR (0X50)
862 #define BMI160_USER_INTR_ENABLE_1_ADDR (0X51)
863 #define BMI160_USER_INTR_ENABLE_2_ADDR (0X52)
864 #define BMI160_USER_INTR_OUT_CTRL_ADDR (0X53)
865 /***************************************************/
867 /******************************************************/
868 #define BMI160_USER_INTR_LATCH_ADDR (0X54)
869 /***************************************************/
871 /******************************************************/
872 #define BMI160_USER_INTR_MAP_0_ADDR (0X55)
873 #define BMI160_USER_INTR_MAP_1_ADDR (0X56)
874 #define BMI160_USER_INTR_MAP_2_ADDR (0X57)
875 /***************************************************/
877 /******************************************************/
878 #define BMI160_USER_INTR_DATA_0_ADDR (0X58)
879 #define BMI160_USER_INTR_DATA_1_ADDR (0X59)
880 /***************************************************/
883 /******************************************************/
884 #define BMI160_USER_INTR_LOWHIGH_0_ADDR (0X5A)
885 #define BMI160_USER_INTR_LOWHIGH_1_ADDR (0X5B)
886 #define BMI160_USER_INTR_LOWHIGH_2_ADDR (0X5C)
887 #define BMI160_USER_INTR_LOWHIGH_3_ADDR (0X5D)
888 #define BMI160_USER_INTR_LOWHIGH_4_ADDR (0X5E)
889 #define BMI160_USER_INTR_MOTION_0_ADDR (0X5F)
890 #define BMI160_USER_INTR_MOTION_1_ADDR (0X60)
891 #define BMI160_USER_INTR_MOTION_2_ADDR (0X61)
892 #define BMI160_USER_INTR_MOTION_3_ADDR (0X62)
893 #define BMI160_USER_INTR_TAP_0_ADDR (0X63)
894 #define BMI160_USER_INTR_TAP_1_ADDR (0X64)
895 #define BMI160_USER_INTR_ORIENT_0_ADDR (0X65)
896 #define BMI160_USER_INTR_ORIENT_1_ADDR (0X66)
897 #define BMI160_USER_INTR_FLAT_0_ADDR (0X67)
898 #define BMI160_USER_INTR_FLAT_1_ADDR (0X68)
899 /***************************************************/
901 /******************************************************/
902 #define BMI160_USER_FOC_CONFIG_ADDR (0X69)
903 /***************************************************/
905 /******************************************************/
906 #define BMI160_USER_CONFIG_ADDR (0X6A)
907 /***************************************************/
909 /******************************************************/
910 #define BMI160_USER_IF_CONFIG_ADDR (0X6B)
911 /***************************************************/
913 /******************************************************/
914 #define BMI160_USER_PMU_TRIGGER_ADDR (0X6C)
915 /***************************************************/
917 /******************************************************/
918 #define BMI160_USER_SELF_TEST_ADDR (0X6D)
919 /***************************************************/
921 /******************************************************/
922 #define BMI160_USER_NV_CONFIG_ADDR (0x70)
923 /***************************************************/
925 /******************************************************/
926 #define BMI160_USER_OFFSET_0_ADDR (0X71)
927 #define BMI160_USER_OFFSET_1_ADDR (0X72)
928 #define BMI160_USER_OFFSET_2_ADDR (0X73)
929 #define BMI160_USER_OFFSET_3_ADDR (0X74)
930 #define BMI160_USER_OFFSET_4_ADDR (0X75)
931 #define BMI160_USER_OFFSET_5_ADDR (0X76)
932 #define BMI160_USER_OFFSET_6_ADDR (0X77)
933 /***************************************************/
935 /******************************************************/
936 #define BMI160_USER_STEP_COUNT_0_ADDR (0X78)
937 #define BMI160_USER_STEP_COUNT_1_ADDR (0X79)
938 /***************************************************/
940 /******************************************************/
941 #define BMI160_USER_STEP_CONFIG_0_ADDR (0X7A)
942 #define BMI160_USER_STEP_CONFIG_1_ADDR (0X7B)
943 /***************************************************/
945 /******************************************************/
946 #define BMI160_CMD_COMMANDS_ADDR (0X7E)
947 /***************************************************/
949 /******************************************************/
950 #define BMI160_CMD_EXT_MODE_ADDR (0X7F)
951 #define BMI160_COM_C_TRIM_FIVE_ADDR (0X05)
952 
953 /****************************************************/
955 /***************************************************/
956 #define BMI160_SHIFT_BIT_POSITION_BY_01_BIT (1)
957 #define BMI160_SHIFT_BIT_POSITION_BY_02_BITS (2)
958 #define BMI160_SHIFT_BIT_POSITION_BY_03_BITS (3)
959 #define BMI160_SHIFT_BIT_POSITION_BY_04_BITS (4)
960 #define BMI160_SHIFT_BIT_POSITION_BY_05_BITS (5)
961 #define BMI160_SHIFT_BIT_POSITION_BY_06_BITS (6)
962 #define BMI160_SHIFT_BIT_POSITION_BY_07_BITS (7)
963 #define BMI160_SHIFT_BIT_POSITION_BY_08_BITS (8)
964 #define BMI160_SHIFT_BIT_POSITION_BY_09_BITS (9)
965 #define BMI160_SHIFT_BIT_POSITION_BY_12_BITS (12)
966 #define BMI160_SHIFT_BIT_POSITION_BY_13_BITS (13)
967 #define BMI160_SHIFT_BIT_POSITION_BY_14_BITS (14)
968 #define BMI160_SHIFT_BIT_POSITION_BY_15_BITS (15)
969 #define BMI160_SHIFT_BIT_POSITION_BY_16_BITS (16)
971 /****************************************************/
973 /***************************************************/
974 #define YAS532_MAG_STATE_NORMAL (0)
975 #define YAS532_MAG_STATE_INIT_COIL (1)
976 #define YAS532_MAG_STATE_MEASURE_OFFSET (2)
977 #define YAS532_MAG_INITCOIL_TIMEOUT (1000)
978 #define YAS532_MAG_NOTRANS_POSITION (3)
979 #define YAS532_DEFAULT_SENSOR_DELAY (50)
980 #define YAS532_DATA_OVERFLOW (8190)
981 #define YAS532_DATA_UNDERFLOW (0)
982 #define YAS532_MAG_TEMPERATURE_LOG (10)
983 #define YAS532_TEMP20DEGREE_TYPICAL (390)
984 #define YAS532_VERSION_AC_COEF_X (850)
985 #define YAS532_VERSION_AC_COEF_Y1 (750)
986 #define YAS532_VERSION_AC_COEF_Y2 (750)
987 #define YAS532_DATA_CENTER (4096)
988 /****************************************************/
990 /***************************************************/
991 static const s8 INVALID_OFFSET[] = {0x7f, 0x7f, 0x7f};
992 #define set_vector(to, from) \
993  {int _l; for (_l = 0; _l < 3; _l++) (to)[_l] = (from)[_l]; }
994 #define is_valid_offset(a) \
995  (((a)[0] <= 31) && ((a)[1] <= 31) && ((a)[2] <= 31) \
996  && (-31 <= (a)[0]) && (-31 <= (a)[1]) && (-31 <= (a)[2]))
998 /**************************************************/
1000 /*************************************************/
1001 
1002 
1003 /* register address of YAS532*/
1004 #define BMI160_YAS532_TESTR1 (0x88)
1005 #define BMI160_YAS532_TESTR2 (0x89)
1006 #define BMI160_YAS532_RCOIL (0x81)
1007 #define BMI160_YAS532_COMMAND_REGISTER (0x82)
1008 #define BMI160_YAS532_DATA_REGISTER (0xB0)
1009 /* calib data register definition*/
1010 #define BMI160_YAS532_CALIB_CX (0x90)
1011 #define BMI160_YAS532_CALIB_CY1 (0x91)
1012 #define BMI160_YAS532_CALIB_CY2 (0x92)
1013 #define BMI160_YAS532_CALIB1 (0x93)
1014 #define BMI160_YAS532_CALIB2 (0x94)
1015 #define BMI160_YAS532_CALIB3 (0x95)
1016 #define BMI160_YAS532_CALIB4 (0x96)
1017 #define BMI160_YAS532_CALIB5 (0x97)
1018 #define BMI160_YAS532_CLAIB6 (0x98)
1019 #define BMI160_YAS532_CALIB7 (0x99)
1020 #define BMI160_YAS532_CALIB8 (0x9A)
1021 #define BMI160_YAS532_CALIIB9 (0x9B)
1022 #define BMI160_YAS532_CALIB10 (0x9C)
1023 #define BMI160_YAS532_CALIB11 (0x9D)
1024 /* offset definition */
1025 #define BMI160_YAS532_OFFSET_X (0x85)
1026 #define BMI160_YAS532_OFFSET_Y (0x86)
1027 #define BMI160_YAS532_OFFSET_Z (0x87)
1028 /* data to write register for yas532*/
1029 #define BMI160_YAS532_WRITE_TESTR1 (0x00)
1030 #define BMI160_YAS532_WRITE_TESTR2 (0x00)
1031 #define BMI160_YAS532_WRITE_RCOIL (0x00)
1032 /**************************************************/
1034 /*************************************************/
1035 
1036 #define YAS537_SRSTR_DATA (0x02)
1037 #define YAS537_WRITE_A_D_CONVERTER (0x03)
1038 #define YAS537_WRITE_A_D_CONVERTER2 (0xF8)
1039 #define YAS537_WRITE_FILTER (0x08)
1040 #define YAS537_WRITE_CONFR (0x08)
1041 #define YAS537_WRITE_TEMP_CALIB (0xFF)
1042 #define YAS537_SET_COMMAND_REGISTER (0x01)
1044 /**************************************************/
1046 /*************************************************/
1047 #define YAS537_REG_SRSTR (0x90)
1048 #define YAS537_REG_CALR_C0 (0xC0)
1049 #define YAS537_REG_CALR_C1 (0xC1)
1050 #define YAS537_REG_CALR_C2 (0xC2)
1051 #define YAS537_REG_CALR_C3 (0xC3)
1052 #define YAS537_REG_CALR_C4 (0xC4)
1053 #define YAS537_REG_CALR_C5 (0xC5)
1054 #define YAS537_REG_CALR_C6 (0xC6)
1055 #define YAS537_REG_CALR_C7 (0xC7)
1056 #define YAS537_REG_CALR_C8 (0xC8)
1057 #define YAS537_REG_CALR_C9 (0xC9)
1058 #define YAS537_REG_CALR_CA (0xCA)
1059 #define YAS537_REG_CALR_CB (0xCB)
1060 #define YAS537_REG_CALR_CC (0xCC)
1061 #define YAS537_REG_CALR_CD (0xCD)
1062 #define YAS537_REG_CALR_CE (0xCE)
1063 #define YAS537_REG_CALR_CF (0xCF)
1064 #define YAS537_REG_CALR_DO (0xD0)
1065 #define YAS537_REG_MTCR (0x93)
1066 #define YAS537_REG_CONFR (0x82)
1067 #define BMI160_REG_YAS537_CMDR (0x81)
1068 #define YAS537_REG_OXR (0x84)
1069 #define YAS537_REG_AVRR (0x87)
1070 #define YAS537_REG_HCKR (0x88)
1071 #define YAS537_REG_LCKR (0x89)
1072 #define YAS537_REG_ADCCALR (0x91)
1073 #define YAS537_REG_ADCCALR_ONE (0x92)
1074 #define YAS537_REG_OCR (0x9E)
1075 #define YAS537_REG_TRMR (0x9F)
1076 #define YAS537_REG_TEMPERATURE_0 (0xB0)
1077 #define YAS537_REG_TEMPERATURE_1 (0xB1)
1078 #define YAS537_REG_DATA_X_0 (0xB2)
1079 #define YAS537_REG_DATA_X_1 (0xB3)
1080 #define YAS537_REG_DATA_Y1_0 (0xB4)
1081 #define YAS537_REG_DATA_Y1_1 (0xB5)
1082 #define YAS537_REG_DATA_Y2_0 (0xB6)
1083 #define YAS537_REG_DATA_Y2_1 (0xB7)
1084 #define YAS537_MAG_STATE_NORMAL (0)
1085 #define YAS537_MAG_STATE_INIT_COIL (1)
1086 #define YAS537_MAG_STATE_RECORD_DATA (2)
1087 #define YAS537_DATA_UNDERFLOW (0)
1088 #define YAS537_DATA_OVERFLOW (16383)
1089 /****************************************************/
1091 /***************************************************/
1092 #define yas537_set_vector(to, from) \
1093  {int _l; for (_l = 0; _l < 3; _l++) (to)[_l] = (from)[_l]; }
1094 
1095 #ifndef ABS
1096 #define ABS(a) ((a) > 0 ? (a) : -(a))
1097 #endif
1098 /****************************************************/
1100 /***************************************************/
1101 #define AKM09912_SENSITIVITY_DIV (256)
1102 #define AKM09912_SENSITIVITY (128)
1103 #define AKM09911_SENSITIVITY_DIV (128)
1104 #define AKM_ASAX (0)
1105 #define AKM_ASAY (1)
1106 #define AKM_ASAZ (2)
1107 #define AKM_POWER_DOWN_MODE_DATA (0x00)
1108 #define AKM_FUSE_ROM_MODE (0x1F)
1109 #define AKM_POWER_MODE_REG (0x31)
1110 #define AKM_SINGLE_MEASUREMENT_MODE (0x01)
1111 #define AKM_DATA_REGISTER (0x11)
1113 #define AKM_CHIP_ID_REG (0x01)
1114 /****************************************************/
1116 /***************************************************/
1117 #define BMI160_BMM150_SET_POWER_CONTROL (0x01)
1118 #define BMI160_BMM150_MAX_RETRY_WAKEUP (5)
1119 #define BMI160_BMM150_POWER_ON (0x01)
1120 #define BMI160_BMM150_POWER_OFF (0x00)
1121 #define BMI160_BMM150_FORCE_MODE (0x02)
1122 #define BMI160_BMM150_POWER_ON_SUCCESS (0)
1123 #define BMI160_BMM150_POWER_ON_FAIL ((s8)-1)
1125 #define BMI160_BMM150_DIG_X1 (0)
1126 #define BMI160_BMM150_DIG_Y1 (1)
1127 #define BMI160_BMM150_DIG_X2 (2)
1128 #define BMI160_BMM150_DIG_Y3 (3)
1129 #define BMI160_BMM150_DIG_XY1 (4)
1130 #define BMI160_BMM150_DIG_XY2 (5)
1131 #define BMI160_BMM150_DIG_Z1_LSB (6)
1132 #define BMI160_BMM150_DIG_Z1_MSB (7)
1133 #define BMI160_BMM150_DIG_Z2_LSB (8)
1134 #define BMI160_BMM150_DIG_Z2_MSB (9)
1135 #define BMI160_BMM150_DIG_DIG_Z3_LSB (10)
1136 #define BMI160_BMM150_DIG_DIG_Z3_MSB (11)
1137 #define BMI160_BMM150_DIG_DIG_Z4_LSB (12)
1138 #define BMI160_BMM150_DIG_DIG_Z4_MSB (13)
1139 #define BMI160_BMM150_DIG_DIG_XYZ1_LSB (14)
1140 #define BMI160_BMM150_DIG_DIG_XYZ1_MSB (15)
1141 #define BMI160_FIFO_FRAME_CNT (146)
1142 #define BMI160_FRAME_COUNT (1)
1144 /**************************************************************/
1146 /**************************************************************/
1151 struct bmi160_t {
1152 u8 chip_id;
1153 u8 dev_addr;
1159 };
1165 struct bmi160_mag_t {
1166 s32 x;
1167 s32 y;
1169 };
1173 struct bmi160_mag_xyzr_t {
1174 s16 x;
1175 s16 y;
1178 };
1182 struct bmi160_gyro_t {
1183 s16 x;
1184 s16 y;
1186 };
1190 struct bmi160_accel_t {
1191 s16 x;
1192 s16 y;
1194 };
1199 struct bmi160_gyro_t gyro;
1200 struct bmi160_accel_t accel;
1201 u32 v_sensor_time_u32;
1202 };
1206 struct bmi160_mag_xyz_s32_t {
1207 s32 x;
1208 s32 y;
1210 };
1214 struct trim_data_t {
1215 s8 dig_x1;
1216 s8 dig_y1;
1218 s8 dig_x2;
1219 s8 dig_y2;
1221 u16 dig_z1;
1222 s16 dig_z2;
1223 s16 dig_z3;
1224 s16 dig_z4;
1226 u8 dig_xy1;
1227 s8 dig_xy2;
1229 u16 dig_xyz1;
1230 };
1231 #ifdef FIFO_ENABLE
1236 
1237 struct bmi160_accel_t accel_fifo[BMI160_FIFO_FRAME_CNT];
1239 struct bmi160_mag_t mag_fifo[BMI160_FIFO_FRAME_CNT];
1241 struct bmi160_gyro_t gyro_fifo[BMI160_FIFO_FRAME_CNT];
1243 u8 accel_frame_count;
1245 u8 gyro_frame_count;
1247 u8 mag_frame_count;
1249 };
1254 struct bmi160_accel_t accel_fifo[BMI160_FIFO_FRAME_CNT];
1256 struct bmi160_mag_t mag_fifo[BMI160_FIFO_FRAME_CNT];
1258 struct bmi160_gyro_t gyro_fifo[BMI160_FIFO_FRAME_CNT];
1260 u32 fifo_time;
1261 u8 skip_frame;
1262 u8 fifo_input_config_info;
1263 u8 accel_frame_count;
1265 u8 gyro_frame_count;
1267 u8 mag_frame_count;
1269 u8 fifo_header[BMI160_FIFO_FRAME_CNT];
1270 };
1274 struct bmi160_mag_fifo_data_t {
1275 u8 mag_x_lsb;
1276 u8 mag_x_msb;
1277 u8 mag_y_lsb;
1278 u8 mag_y_msb;
1279 u8 mag_z_lsb;
1280 u8 mag_z_msb;
1281 u8 mag_r_y2_lsb;
1283 u8 mag_r_y2_msb;
1285 };
1286 #endif
1287 /**************************************************************/
1289 /**************************************************************/
1290 
1291 /**************************************************************/
1293 /**************************************************************/
1294 /* Chip ID Description - Reg Addr --> (0x00), Bit --> 0...7 */
1295 #define BMI160_USER_CHIP_ID__POS (0)
1296 #define BMI160_USER_CHIP_ID__MSK (0xFF)
1297 #define BMI160_USER_CHIP_ID__LEN (8)
1298 #define BMI160_USER_CHIP_ID__REG (BMI160_USER_CHIP_ID_ADDR)
1299 /**************************************************************/
1301 /**************************************************************/
1302 /* Error Description - Reg Addr --> (0x02), Bit --> 0 */
1303 #define BMI160_USER_ERR_STAT__POS (0)
1304 #define BMI160_USER_ERR_STAT__LEN (8)
1305 #define BMI160_USER_ERR_STAT__MSK (0xFF)
1306 #define BMI160_USER_ERR_STAT__REG (BMI160_USER_ERROR_ADDR)
1308 #define BMI160_USER_FATAL_ERR__POS (0)
1309 #define BMI160_USER_FATAL_ERR__LEN (1)
1310 #define BMI160_USER_FATAL_ERR__MSK (0x01)
1311 #define BMI160_USER_FATAL_ERR__REG (BMI160_USER_ERROR_ADDR)
1313 /* Error Description - Reg Addr --> (0x02), Bit --> 1...4 */
1314 #define BMI160_USER_ERR_CODE__POS (1)
1315 #define BMI160_USER_ERR_CODE__LEN (4)
1316 #define BMI160_USER_ERR_CODE__MSK (0x1E)
1317 #define BMI160_USER_ERR_CODE__REG (BMI160_USER_ERROR_ADDR)
1319 /* Error Description - Reg Addr --> (0x02), Bit --> 5 */
1320 #define BMI160_USER_I2C_FAIL_ERR__POS (5)
1321 #define BMI160_USER_I2C_FAIL_ERR__LEN (1)
1322 #define BMI160_USER_I2C_FAIL_ERR__MSK (0x20)
1323 #define BMI160_USER_I2C_FAIL_ERR__REG (BMI160_USER_ERROR_ADDR)
1325 /* Error Description - Reg Addr --> (0x02), Bit --> 6 */
1326 #define BMI160_USER_DROP_CMD_ERR__POS (6)
1327 #define BMI160_USER_DROP_CMD_ERR__LEN (1)
1328 #define BMI160_USER_DROP_CMD_ERR__MSK (0x40)
1329 #define BMI160_USER_DROP_CMD_ERR__REG (BMI160_USER_ERROR_ADDR)
1330 /**************************************************************/
1332 /**************************************************************/
1333 /* Error Description - Reg Addr --> (0x02), Bit --> 7 */
1334 #define BMI160_USER_MAG_DATA_RDY_ERR__POS (7)
1335 #define BMI160_USER_MAG_DATA_RDY_ERR__LEN (1)
1336 #define BMI160_USER_MAG_DATA_RDY_ERR__MSK (0x80)
1337 #define BMI160_USER_MAG_DATA_RDY_ERR__REG (BMI160_USER_ERROR_ADDR)
1338 /**************************************************************/
1340 /**************************************************************/
1341 /* PMU_Status Description of MAG - Reg Addr --> (0x03), Bit --> 1..0 */
1342 #define BMI160_USER_MAG_POWER_MODE_STAT__POS (0)
1343 #define BMI160_USER_MAG_POWER_MODE_STAT__LEN (2)
1344 #define BMI160_USER_MAG_POWER_MODE_STAT__MSK (0x03)
1345 #define BMI160_USER_MAG_POWER_MODE_STAT__REG \
1346 (BMI160_USER_PMU_STAT_ADDR)
1347 /**************************************************************/
1349 /**************************************************************/
1350 /* PMU_Status Description of GYRO - Reg Addr --> (0x03), Bit --> 3...2 */
1351 #define BMI160_USER_GYRO_POWER_MODE_STAT__POS (2)
1352 #define BMI160_USER_GYRO_POWER_MODE_STAT__LEN (2)
1353 #define BMI160_USER_GYRO_POWER_MODE_STAT__MSK (0x0C)
1354 #define BMI160_USER_GYRO_POWER_MODE_STAT__REG \
1355 (BMI160_USER_PMU_STAT_ADDR)
1356 /**************************************************************/
1358 /**************************************************************/
1359 /* PMU_Status Description of ACCEL - Reg Addr --> (0x03), Bit --> 5...4 */
1360 #define BMI160_USER_ACCEL_POWER_MODE_STAT__POS (4)
1361 #define BMI160_USER_ACCEL_POWER_MODE_STAT__LEN (2)
1362 #define BMI160_USER_ACCEL_POWER_MODE_STAT__MSK (0x30)
1363 #define BMI160_USER_ACCEL_POWER_MODE_STAT__REG \
1364 (BMI160_USER_PMU_STAT_ADDR)
1365 /**************************************************************/
1367 /**************************************************************/
1368 /* Mag_X(LSB) Description - Reg Addr --> (0x04), Bit --> 0...7 */
1369 #define BMI160_USER_DATA_0_MAG_X_LSB__POS (0)
1370 #define BMI160_USER_DATA_0_MAG_X_LSB__LEN (8)
1371 #define BMI160_USER_DATA_0_MAG_X_LSB__MSK (0xFF)
1372 #define BMI160_USER_DATA_0_MAG_X_LSB__REG (BMI160_USER_DATA_0_ADDR)
1374 /* Mag_X(LSB) Description - Reg Addr --> (0x04), Bit --> 3...7 */
1375 #define BMI160_USER_DATA_MAG_X_LSB__POS (3)
1376 #define BMI160_USER_DATA_MAG_X_LSB__LEN (5)
1377 #define BMI160_USER_DATA_MAG_X_LSB__MSK (0xF8)
1378 #define BMI160_USER_DATA_MAG_X_LSB__REG (BMI160_USER_DATA_0_ADDR)
1380 /* Mag_X(MSB) Description - Reg Addr --> (0x05), Bit --> 0...7 */
1381 #define BMI160_USER_DATA_1_MAG_X_MSB__POS (0)
1382 #define BMI160_USER_DATA_1_MAG_X_MSB__LEN (8)
1383 #define BMI160_USER_DATA_1_MAG_X_MSB__MSK (0xFF)
1384 #define BMI160_USER_DATA_1_MAG_X_MSB__REG (BMI160_USER_DATA_1_ADDR)
1386 /* Mag_Y(LSB) Description - Reg Addr --> (0x06), Bit --> 0...7 */
1387 #define BMI160_USER_DATA_2_MAG_Y_LSB__POS (0)
1388 #define BMI160_USER_DATA_2_MAG_Y_LSB__LEN (8)
1389 #define BMI160_USER_DATA_2_MAG_Y_LSB__MSK (0xFF)
1390 #define BMI160_USER_DATA_2_MAG_Y_LSB__REG (BMI160_USER_DATA_2_ADDR)
1392 /* Mag_Y(LSB) Description - Reg Addr --> (0x06), Bit --> 3...7 */
1393 #define BMI160_USER_DATA_MAG_Y_LSB__POS (3)
1394 #define BMI160_USER_DATA_MAG_Y_LSB__LEN (5)
1395 #define BMI160_USER_DATA_MAG_Y_LSB__MSK (0xF8)
1396 #define BMI160_USER_DATA_MAG_Y_LSB__REG (BMI160_USER_DATA_2_ADDR)
1398 /* Mag_Y(MSB) Description - Reg Addr --> (0x07), Bit --> 0...7 */
1399 #define BMI160_USER_DATA_3_MAG_Y_MSB__POS (0)
1400 #define BMI160_USER_DATA_3_MAG_Y_MSB__LEN (8)
1401 #define BMI160_USER_DATA_3_MAG_Y_MSB__MSK (0xFF)
1402 #define BMI160_USER_DATA_3_MAG_Y_MSB__REG (BMI160_USER_DATA_3_ADDR)
1404 /* Mag_Z(LSB) Description - Reg Addr --> (0x08), Bit --> 0...7 */
1405 #define BMI160_USER_DATA_4_MAG_Z_LSB__POS (0)
1406 #define BMI160_USER_DATA_4_MAG_Z_LSB__LEN (8)
1407 #define BMI160_USER_DATA_4_MAG_Z_LSB__MSK (0xFF)
1408 #define BMI160_USER_DATA_4_MAG_Z_LSB__REG (BMI160_USER_DATA_4_ADDR)
1410 /* Mag_X(LSB) Description - Reg Addr --> (0x08), Bit --> 3...7 */
1411 #define BMI160_USER_DATA_MAG_Z_LSB__POS (1)
1412 #define BMI160_USER_DATA_MAG_Z_LSB__LEN (7)
1413 #define BMI160_USER_DATA_MAG_Z_LSB__MSK (0xFE)
1414 #define BMI160_USER_DATA_MAG_Z_LSB__REG (BMI160_USER_DATA_4_ADDR)
1416 /* Mag_Z(MSB) Description - Reg Addr --> (0x09), Bit --> 0...7 */
1417 #define BMI160_USER_DATA_5_MAG_Z_MSB__POS (0)
1418 #define BMI160_USER_DATA_5_MAG_Z_MSB__LEN (8)
1419 #define BMI160_USER_DATA_5_MAG_Z_MSB__MSK (0xFF)
1420 #define BMI160_USER_DATA_5_MAG_Z_MSB__REG (BMI160_USER_DATA_5_ADDR)
1422 /* RHALL(LSB) Description - Reg Addr --> (0x0A), Bit --> 0...7 */
1423 #define BMI160_USER_DATA_6_RHALL_LSB__POS (0)
1424 #define BMI160_USER_DATA_6_RHALL_LSB__LEN (8)
1425 #define BMI160_USER_DATA_6_RHALL_LSB__MSK (0xFF)
1426 #define BMI160_USER_DATA_6_RHALL_LSB__REG (BMI160_USER_DATA_6_ADDR)
1428 /* Mag_R(LSB) Description - Reg Addr --> (0x0A), Bit --> 3...7 */
1429 #define BMI160_USER_DATA_MAG_R_LSB__POS (2)
1430 #define BMI160_USER_DATA_MAG_R_LSB__LEN (6)
1431 #define BMI160_USER_DATA_MAG_R_LSB__MSK (0xFC)
1432 #define BMI160_USER_DATA_MAG_R_LSB__REG (BMI160_USER_DATA_6_ADDR)
1434 /* RHALL(MSB) Description - Reg Addr --> (0x0B), Bit --> 0...7 */
1435 #define BMI160_USER_DATA_7_RHALL_MSB__POS (0)
1436 #define BMI160_USER_DATA_7_RHALL_MSB__LEN (8)
1437 #define BMI160_USER_DATA_7_RHALL_MSB__MSK (0xFF)
1438 #define BMI160_USER_DATA_7_RHALL_MSB__REG (BMI160_USER_DATA_7_ADDR)
1439 /**************************************************************/
1441 /**************************************************************/
1442 /* GYR_X (LSB) Description - Reg Addr --> (0x0C), Bit --> 0...7 */
1443 #define BMI160_USER_DATA_8_GYRO_X_LSB__POS (0)
1444 #define BMI160_USER_DATA_8_GYRO_X_LSB__LEN (8)
1445 #define BMI160_USER_DATA_8_GYRO_X_LSB__MSK (0xFF)
1446 #define BMI160_USER_DATA_8_GYRO_X_LSB__REG (BMI160_USER_DATA_8_ADDR)
1448 /* GYR_X (MSB) Description - Reg Addr --> (0x0D), Bit --> 0...7 */
1449 #define BMI160_USER_DATA_9_GYRO_X_MSB__POS (0)
1450 #define BMI160_USER_DATA_9_GYRO_X_MSB__LEN (8)
1451 #define BMI160_USER_DATA_9_GYRO_X_MSB__MSK (0xFF)
1452 #define BMI160_USER_DATA_9_GYRO_X_MSB__REG (BMI160_USER_DATA_9_ADDR)
1454 /* GYR_Y (LSB) Description - Reg Addr --> 0x0E, Bit --> 0...7 */
1455 #define BMI160_USER_DATA_10_GYRO_Y_LSB__POS (0)
1456 #define BMI160_USER_DATA_10_GYRO_Y_LSB__LEN (8)
1457 #define BMI160_USER_DATA_10_GYRO_Y_LSB__MSK (0xFF)
1458 #define BMI160_USER_DATA_10_GYRO_Y_LSB__REG (BMI160_USER_DATA_10_ADDR)
1460 /* GYR_Y (MSB) Description - Reg Addr --> (0x0F), Bit --> 0...7 */
1461 #define BMI160_USER_DATA_11_GYRO_Y_MSB__POS (0)
1462 #define BMI160_USER_DATA_11_GYRO_Y_MSB__LEN (8)
1463 #define BMI160_USER_DATA_11_GYRO_Y_MSB__MSK (0xFF)
1464 #define BMI160_USER_DATA_11_GYRO_Y_MSB__REG (BMI160_USER_DATA_11_ADDR)
1466 /* GYR_Z (LSB) Description - Reg Addr --> (0x10), Bit --> 0...7 */
1467 #define BMI160_USER_DATA_12_GYRO_Z_LSB__POS (0)
1468 #define BMI160_USER_DATA_12_GYRO_Z_LSB__LEN (8)
1469 #define BMI160_USER_DATA_12_GYRO_Z_LSB__MSK (0xFF)
1470 #define BMI160_USER_DATA_12_GYRO_Z_LSB__REG (BMI160_USER_DATA_12_ADDR)
1472 /* GYR_Z (MSB) Description - Reg Addr --> (0x11), Bit --> 0...7 */
1473 #define BMI160_USER_DATA_13_GYRO_Z_MSB__POS (0)
1474 #define BMI160_USER_DATA_13_GYRO_Z_MSB__LEN (8)
1475 #define BMI160_USER_DATA_13_GYRO_Z_MSB__MSK (0xFF)
1476 #define BMI160_USER_DATA_13_GYRO_Z_MSB__REG (BMI160_USER_DATA_13_ADDR)
1477 /**************************************************************/
1479 /**************************************************************/
1480 /* ACC_X (LSB) Description - Reg Addr --> (0x12), Bit --> 0...7 */
1481 #define BMI160_USER_DATA_14_ACCEL_X_LSB__POS (0)
1482 #define BMI160_USER_DATA_14_ACCEL_X_LSB__LEN (8)
1483 #define BMI160_USER_DATA_14_ACCEL_X_LSB__MSK (0xFF)
1484 #define BMI160_USER_DATA_14_ACCEL_X_LSB__REG (BMI160_USER_DATA_14_ADDR)
1486 /* ACC_X (MSB) Description - Reg Addr --> 0x13, Bit --> 0...7 */
1487 #define BMI160_USER_DATA_15_ACCEL_X_MSB__POS (0)
1488 #define BMI160_USER_DATA_15_ACCEL_X_MSB__LEN (8)
1489 #define BMI160_USER_DATA_15_ACCEL_X_MSB__MSK (0xFF)
1490 #define BMI160_USER_DATA_15_ACCEL_X_MSB__REG (BMI160_USER_DATA_15_ADDR)
1492 /* ACC_Y (LSB) Description - Reg Addr --> (0x14), Bit --> 0...7 */
1493 #define BMI160_USER_DATA_16_ACCEL_Y_LSB__POS (0)
1494 #define BMI160_USER_DATA_16_ACCEL_Y_LSB__LEN (8)
1495 #define BMI160_USER_DATA_16_ACCEL_Y_LSB__MSK (0xFF)
1496 #define BMI160_USER_DATA_16_ACCEL_Y_LSB__REG (BMI160_USER_DATA_16_ADDR)
1498 /* ACC_Y (MSB) Description - Reg Addr --> (0x15), Bit --> 0...7 */
1499 #define BMI160_USER_DATA_17_ACCEL_Y_MSB__POS (0)
1500 #define BMI160_USER_DATA_17_ACCEL_Y_MSB__LEN (8)
1501 #define BMI160_USER_DATA_17_ACCEL_Y_MSB__MSK (0xFF)
1502 #define BMI160_USER_DATA_17_ACCEL_Y_MSB__REG (BMI160_USER_DATA_17_ADDR)
1504 /* ACC_Z (LSB) Description - Reg Addr --> 0x16, Bit --> 0...7 */
1505 #define BMI160_USER_DATA_18_ACCEL_Z_LSB__POS (0)
1506 #define BMI160_USER_DATA_18_ACCEL_Z_LSB__LEN (8)
1507 #define BMI160_USER_DATA_18_ACCEL_Z_LSB__MSK (0xFF)
1508 #define BMI160_USER_DATA_18_ACCEL_Z_LSB__REG (BMI160_USER_DATA_18_ADDR)
1510 /* ACC_Z (MSB) Description - Reg Addr --> (0x17), Bit --> 0...7 */
1511 #define BMI160_USER_DATA_19_ACCEL_Z_MSB__POS (0)
1512 #define BMI160_USER_DATA_19_ACCEL_Z_MSB__LEN (8)
1513 #define BMI160_USER_DATA_19_ACCEL_Z_MSB__MSK (0xFF)
1514 #define BMI160_USER_DATA_19_ACCEL_Z_MSB__REG (BMI160_USER_DATA_19_ADDR)
1515 /**************************************************************/
1517 /**************************************************************/
1518 /* SENSORTIME_0 (LSB) Description - Reg Addr --> (0x18), Bit --> 0...7 */
1519 #define BMI160_USER_SENSORTIME_0_SENSOR_TIME_LSB__POS (0)
1520 #define BMI160_USER_SENSORTIME_0_SENSOR_TIME_LSB__LEN (8)
1521 #define BMI160_USER_SENSORTIME_0_SENSOR_TIME_LSB__MSK (0xFF)
1522 #define BMI160_USER_SENSORTIME_0_SENSOR_TIME_LSB__REG \
1523  (BMI160_USER_SENSORTIME_0_ADDR)
1525 /* SENSORTIME_1 (MSB) Description - Reg Addr --> (0x19), Bit --> 0...7 */
1526 #define BMI160_USER_SENSORTIME_1_SENSOR_TIME_MSB__POS (0)
1527 #define BMI160_USER_SENSORTIME_1_SENSOR_TIME_MSB__LEN (8)
1528 #define BMI160_USER_SENSORTIME_1_SENSOR_TIME_MSB__MSK (0xFF)
1529 #define BMI160_USER_SENSORTIME_1_SENSOR_TIME_MSB__REG \
1530  (BMI160_USER_SENSORTIME_1_ADDR)
1532 /* SENSORTIME_2 (MSB) Description - Reg Addr --> (0x1A), Bit --> 0...7 */
1533 #define BMI160_USER_SENSORTIME_2_SENSOR_TIME_MSB__POS (0)
1534 #define BMI160_USER_SENSORTIME_2_SENSOR_TIME_MSB__LEN (8)
1535 #define BMI160_USER_SENSORTIME_2_SENSOR_TIME_MSB__MSK (0xFF)
1536 #define BMI160_USER_SENSORTIME_2_SENSOR_TIME_MSB__REG \
1537  (BMI160_USER_SENSORTIME_2_ADDR)
1538 /**************************************************************/
1540 /**************************************************************/
1541 /* Status Description - Reg Addr --> 0x1B, Bit --> 1 */
1542 #define BMI160_USER_STAT_GYRO_SELFTEST_OK__POS (1)
1543 #define BMI160_USER_STAT_GYRO_SELFTEST_OK__LEN (1)
1544 #define BMI160_USER_STAT_GYRO_SELFTEST_OK__MSK (0x02)
1545 #define BMI160_USER_STAT_GYRO_SELFTEST_OK__REG \
1546  (BMI160_USER_STAT_ADDR)
1547 /**************************************************************/
1549 /**************************************************************/
1550 /* Status Description - Reg Addr --> 0x1B, Bit --> 2 */
1551 #define BMI160_USER_STAT_MAG_MANUAL_OPERATION__POS (2)
1552 #define BMI160_USER_STAT_MAG_MANUAL_OPERATION__LEN (1)
1553 #define BMI160_USER_STAT_MAG_MANUAL_OPERATION__MSK (0x04)
1554 #define BMI160_USER_STAT_MAG_MANUAL_OPERATION__REG \
1555  (BMI160_USER_STAT_ADDR)
1556 /**************************************************************/
1558 /**************************************************************/
1559 /* Status Description - Reg Addr --> 0x1B, Bit --> 3 */
1560 #define BMI160_USER_STAT_FOC_RDY__POS (3)
1561 #define BMI160_USER_STAT_FOC_RDY__LEN (1)
1562 #define BMI160_USER_STAT_FOC_RDY__MSK (0x08)
1563 #define BMI160_USER_STAT_FOC_RDY__REG (BMI160_USER_STAT_ADDR)
1564 /**************************************************************/
1566 /**************************************************************/
1567 /* Status Description - Reg Addr --> 0x1B, Bit --> 4 */
1568 #define BMI160_USER_STAT_NVM_RDY__POS (4)
1569 #define BMI160_USER_STAT_NVM_RDY__LEN (1)
1570 #define BMI160_USER_STAT_NVM_RDY__MSK (0x10)
1571 #define BMI160_USER_STAT_NVM_RDY__REG (BMI160_USER_STAT_ADDR)
1572 /**************************************************************/
1574 /**************************************************************/
1575 /* Status Description - Reg Addr --> 0x1B, Bit --> 5 */
1576 #define BMI160_USER_STAT_DATA_RDY_MAG__POS (5)
1577 #define BMI160_USER_STAT_DATA_RDY_MAG__LEN (1)
1578 #define BMI160_USER_STAT_DATA_RDY_MAG__MSK (0x20)
1579 #define BMI160_USER_STAT_DATA_RDY_MAG__REG (BMI160_USER_STAT_ADDR)
1581 /* Status Description - Reg Addr --> 0x1B, Bit --> 6 */
1582 #define BMI160_USER_STAT_DATA_RDY_GYRO__POS (6)
1583 #define BMI160_USER_STAT_DATA_RDY_GYRO__LEN (1)
1584 #define BMI160_USER_STAT_DATA_RDY_GYRO__MSK (0x40)
1585 #define BMI160_USER_STAT_DATA_RDY_GYRO__REG (BMI160_USER_STAT_ADDR)
1587 /* Status Description - Reg Addr --> 0x1B, Bit --> 7 */
1588 #define BMI160_USER_STAT_DATA_RDY_ACCEL__POS (7)
1589 #define BMI160_USER_STAT_DATA_RDY_ACCEL__LEN (1)
1590 #define BMI160_USER_STAT_DATA_RDY_ACCEL__MSK (0x80)
1591 #define BMI160_USER_STAT_DATA_RDY_ACCEL__REG (BMI160_USER_STAT_ADDR)
1592 /**************************************************************/
1594 /**************************************************************/
1595 /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 0 */
1596 #define BMI160_USER_INTR_STAT_0_STEP_INTR__POS (0)
1597 #define BMI160_USER_INTR_STAT_0_STEP_INTR__LEN (1)
1598 #define BMI160_USER_INTR_STAT_0_STEP_INTR__MSK (0x01)
1599 #define BMI160_USER_INTR_STAT_0_STEP_INTR__REG \
1600  (BMI160_USER_INTR_STAT_0_ADDR)
1601 /**************************************************************/
1603 /**************************************************************/
1604 /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 1 */
1605 #define BMI160_USER_INTR_STAT_0_SIGNIFICANT_INTR__POS (1)
1606 #define BMI160_USER_INTR_STAT_0_SIGNIFICANT_INTR__LEN (1)
1607 #define BMI160_USER_INTR_STAT_0_SIGNIFICANT_INTR__MSK (0x02)
1608 #define BMI160_USER_INTR_STAT_0_SIGNIFICANT_INTR__REG \
1609  (BMI160_USER_INTR_STAT_0_ADDR)
1610 /**************************************************************/
1612 /**************************************************************/
1613 /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 2 */
1614 #define BMI160_USER_INTR_STAT_0_ANY_MOTION__POS (2)
1615 #define BMI160_USER_INTR_STAT_0_ANY_MOTION__LEN (1)
1616 #define BMI160_USER_INTR_STAT_0_ANY_MOTION__MSK (0x04)
1617 #define BMI160_USER_INTR_STAT_0_ANY_MOTION__REG \
1618  (BMI160_USER_INTR_STAT_0_ADDR)
1619 /**************************************************************/
1621 /**************************************************************/
1622 /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 3 */
1623 #define BMI160_USER_INTR_STAT_0_PMU_TRIGGER__POS 3
1624 #define BMI160_USER_INTR_STAT_0_PMU_TRIGGER__LEN (1)
1625 #define BMI160_USER_INTR_STAT_0_PMU_TRIGGER__MSK (0x08)
1626 #define BMI160_USER_INTR_STAT_0_PMU_TRIGGER__REG \
1627  (BMI160_USER_INTR_STAT_0_ADDR)
1628 /**************************************************************/
1630 /**************************************************************/
1631 /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 4 */
1632 #define BMI160_USER_INTR_STAT_0_DOUBLE_TAP_INTR__POS 4
1633 #define BMI160_USER_INTR_STAT_0_DOUBLE_TAP_INTR__LEN (1)
1634 #define BMI160_USER_INTR_STAT_0_DOUBLE_TAP_INTR__MSK (0x10)
1635 #define BMI160_USER_INTR_STAT_0_DOUBLE_TAP_INTR__REG \
1636  (BMI160_USER_INTR_STAT_0_ADDR)
1637 /**************************************************************/
1639 /**************************************************************/
1640 /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 5 */
1641 #define BMI160_USER_INTR_STAT_0_SINGLE_TAP_INTR__POS 5
1642 #define BMI160_USER_INTR_STAT_0_SINGLE_TAP_INTR__LEN (1)
1643 #define BMI160_USER_INTR_STAT_0_SINGLE_TAP_INTR__MSK (0x20)
1644 #define BMI160_USER_INTR_STAT_0_SINGLE_TAP_INTR__REG \
1645  (BMI160_USER_INTR_STAT_0_ADDR)
1646 /**************************************************************/
1648 /**************************************************************/
1649 /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 6 */
1650 #define BMI160_USER_INTR_STAT_0_ORIENT__POS (6)
1651 #define BMI160_USER_INTR_STAT_0_ORIENT__LEN (1)
1652 #define BMI160_USER_INTR_STAT_0_ORIENT__MSK (0x40)
1653 #define BMI160_USER_INTR_STAT_0_ORIENT__REG \
1654  (BMI160_USER_INTR_STAT_0_ADDR)
1655 /**************************************************************/
1657 /**************************************************************/
1658 /* Int_Status_0 Description - Reg Addr --> 0x1C, Bit --> 7 */
1659 #define BMI160_USER_INTR_STAT_0_FLAT__POS (7)
1660 #define BMI160_USER_INTR_STAT_0_FLAT__LEN (1)
1661 #define BMI160_USER_INTR_STAT_0_FLAT__MSK (0x80)
1662 #define BMI160_USER_INTR_STAT_0_FLAT__REG \
1663  (BMI160_USER_INTR_STAT_0_ADDR)
1664 /**************************************************************/
1666 /**************************************************************/
1667 /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 2 */
1668 #define BMI160_USER_INTR_STAT_1_HIGH_G_INTR__POS (2)
1669 #define BMI160_USER_INTR_STAT_1_HIGH_G_INTR__LEN (1)
1670 #define BMI160_USER_INTR_STAT_1_HIGH_G_INTR__MSK (0x04)
1671 #define BMI160_USER_INTR_STAT_1_HIGH_G_INTR__REG \
1672  (BMI160_USER_INTR_STAT_1_ADDR)
1673 /**************************************************************/
1675 /**************************************************************/
1676 /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 3 */
1677 #define BMI160_USER_INTR_STAT_1_LOW_G_INTR__POS (3)
1678 #define BMI160_USER_INTR_STAT_1_LOW_G_INTR__LEN (1)
1679 #define BMI160_USER_INTR_STAT_1_LOW_G_INTR__MSK (0x08)
1680 #define BMI160_USER_INTR_STAT_1_LOW_G_INTR__REG \
1681  (BMI160_USER_INTR_STAT_1_ADDR)
1682 /**************************************************************/
1684 /**************************************************************/
1685 /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 4 */
1686 #define BMI160_USER_INTR_STAT_1_DATA_RDY_INTR__POS (4)
1687 #define BMI160_USER_INTR_STAT_1_DATA_RDY_INTR__LEN (1)
1688 #define BMI160_USER_INTR_STAT_1_DATA_RDY_INTR__MSK (0x10)
1689 #define BMI160_USER_INTR_STAT_1_DATA_RDY_INTR__REG \
1690  (BMI160_USER_INTR_STAT_1_ADDR)
1691 /**************************************************************/
1693 /**************************************************************/
1694 /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 5 */
1695 #define BMI160_USER_INTR_STAT_1_FIFO_FULL_INTR__POS (5)
1696 #define BMI160_USER_INTR_STAT_1_FIFO_FULL_INTR__LEN (1)
1697 #define BMI160_USER_INTR_STAT_1_FIFO_FULL_INTR__MSK (0x20)
1698 #define BMI160_USER_INTR_STAT_1_FIFO_FULL_INTR__REG \
1699  (BMI160_USER_INTR_STAT_1_ADDR)
1700 /**************************************************************/
1702 /**************************************************************/
1703 /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 6 */
1704 #define BMI160_USER_INTR_STAT_1_FIFO_WM_INTR__POS (6)
1705 #define BMI160_USER_INTR_STAT_1_FIFO_WM_INTR__LEN (1)
1706 #define BMI160_USER_INTR_STAT_1_FIFO_WM_INTR__MSK (0x40)
1707 #define BMI160_USER_INTR_STAT_1_FIFO_WM_INTR__REG \
1708  (BMI160_USER_INTR_STAT_1_ADDR)
1709 /**************************************************************/
1711 /**************************************************************/
1712 /* Int_Status_1 Description - Reg Addr --> 0x1D, Bit --> 7 */
1713 #define BMI160_USER_INTR_STAT_1_NOMOTION_INTR__POS (7)
1714 #define BMI160_USER_INTR_STAT_1_NOMOTION_INTR__LEN (1)
1715 #define BMI160_USER_INTR_STAT_1_NOMOTION_INTR__MSK (0x80)
1716 #define BMI160_USER_INTR_STAT_1_NOMOTION_INTR__REG \
1717  (BMI160_USER_INTR_STAT_1_ADDR)
1718 /**************************************************************/
1720 /**************************************************************/
1721 /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 0 */
1722 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_X__POS (0)
1723 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_X__LEN (1)
1724 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_X__MSK (0x01)
1725 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_X__REG \
1726  (BMI160_USER_INTR_STAT_2_ADDR)
1728 /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 1 */
1729 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Y__POS (1)
1730 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Y__LEN (1)
1731 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Y__MSK (0x02)
1732 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Y__REG \
1733  (BMI160_USER_INTR_STAT_2_ADDR)
1735 /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 2 */
1736 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Z__POS (2)
1737 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Z__LEN (1)
1738 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Z__MSK (0x04)
1739 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_FIRST_Z__REG \
1740  (BMI160_USER_INTR_STAT_2_ADDR)
1741 /**************************************************************/
1743 /**************************************************************/
1744 /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 3 */
1745 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_SIGN__POS (3)
1746 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_SIGN__LEN (1)
1747 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_SIGN__MSK (0x08)
1748 #define BMI160_USER_INTR_STAT_2_ANY_MOTION_SIGN__REG \
1749  (BMI160_USER_INTR_STAT_2_ADDR)
1750 /**************************************************************/
1752 /**************************************************************/
1753 /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 4 */
1754 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_X__POS (4)
1755 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_X__LEN (1)
1756 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_X__MSK (0x10)
1757 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_X__REG \
1758  (BMI160_USER_INTR_STAT_2_ADDR)
1760 /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 5 */
1761 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Y__POS (5)
1762 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Y__LEN (1)
1763 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Y__MSK (0x20)
1764 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Y__REG \
1765  (BMI160_USER_INTR_STAT_2_ADDR)
1767 /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 6 */
1768 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Z__POS (6)
1769 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Z__LEN (1)
1770 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Z__MSK (0x40)
1771 #define BMI160_USER_INTR_STAT_2_TAP_FIRST_Z__REG \
1772  (BMI160_USER_INTR_STAT_2_ADDR)
1774 /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 7 */
1775 #define BMI160_USER_INTR_STAT_2_TAP_SIGN__POS (7)
1776 #define BMI160_USER_INTR_STAT_2_TAP_SIGN__LEN (1)
1777 #define BMI160_USER_INTR_STAT_2_TAP_SIGN__MSK (0x80)
1778 #define BMI160_USER_INTR_STAT_2_TAP_SIGN__REG \
1779  (BMI160_USER_INTR_STAT_2_ADDR)
1780 /**************************************************************/
1782 /**************************************************************/
1783 /* Int_Status_2 Description - Reg Addr --> 0x1E, Bit --> 0...7 */
1784 #define BMI160_USER_INTR_STAT_2__POS (0)
1785 #define BMI160_USER_INTR_STAT_2__LEN (8)
1786 #define BMI160_USER_INTR_STAT_2__MSK (0xFF)
1787 #define BMI160_USER_INTR_STAT_2__REG \
1788  (BMI160_USER_INTR_STAT_2_ADDR)
1789 /**************************************************************/
1791 /**************************************************************/
1792 /* Int_Status_3 Description - Reg Addr --> (0x1F), Bit --> 0 */
1793 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_X__POS (0)
1794 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_X__LEN (1)
1795 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_X__MSK (0x01)
1796 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_X__REG \
1797  (BMI160_USER_INTR_STAT_3_ADDR)
1799 /* Int_Status_3 Description - Reg Addr --> 0x1E, Bit --> 1 */
1800 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Y__POS (1)
1801 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Y__LEN (1)
1802 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Y__MSK (0x02)
1803 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Y__REG \
1804  (BMI160_USER_INTR_STAT_3_ADDR)
1806 /* Int_Status_3 Description - Reg Addr --> (0x1F), Bit --> 2 */
1807 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Z__POS (2)
1808 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Z__LEN (1)
1809 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Z__MSK (0x04)
1810 #define BMI160_USER_INTR_STAT_3_HIGH_G_FIRST_Z__REG \
1811  (BMI160_USER_INTR_STAT_3_ADDR)
1813 /* Int_Status_3 Description - Reg Addr --> (0x1F), Bit --> 3 */
1814 #define BMI160_USER_INTR_STAT_3_HIGH_G_SIGN__POS (3)
1815 #define BMI160_USER_INTR_STAT_3_HIGH_G_SIGN__LEN (1)
1816 #define BMI160_USER_INTR_STAT_3_HIGH_G_SIGN__MSK (0x08)
1817 #define BMI160_USER_INTR_STAT_3_HIGH_G_SIGN__REG \
1818  (BMI160_USER_INTR_STAT_3_ADDR)
1819 /**************************************************************/
1821 /**************************************************************/
1822 /* Int_Status_3 Description - Reg Addr --> (0x1F), Bit --> 4...5 */
1823 #define BMI160_USER_INTR_STAT_3_ORIENT_XY__POS (4)
1824 #define BMI160_USER_INTR_STAT_3_ORIENT_XY__LEN (2)
1825 #define BMI160_USER_INTR_STAT_3_ORIENT_XY__MSK (0x30)
1826 #define BMI160_USER_INTR_STAT_3_ORIENT_XY__REG \
1827  (BMI160_USER_INTR_STAT_3_ADDR)
1829 /* Int_Status_3 Description - Reg Addr --> (0x1F), Bit --> 6 */
1830 #define BMI160_USER_INTR_STAT_3_ORIENT_Z__POS (6)
1831 #define BMI160_USER_INTR_STAT_3_ORIENT_Z__LEN (1)
1832 #define BMI160_USER_INTR_STAT_3_ORIENT_Z__MSK (0x40)
1833 #define BMI160_USER_INTR_STAT_3_ORIENT_Z__REG \
1834  (BMI160_USER_INTR_STAT_3_ADDR)
1835 /**************************************************************/
1837 /**************************************************************/
1838 /* Int_Status_3 Description - Reg Addr --> (0x1F), Bit --> 7 */
1839 #define BMI160_USER_INTR_STAT_3_FLAT__POS (7)
1840 #define BMI160_USER_INTR_STAT_3_FLAT__LEN (1)
1841 #define BMI160_USER_INTR_STAT_3_FLAT__MSK (0x80)
1842 #define BMI160_USER_INTR_STAT_3_FLAT__REG \
1843  (BMI160_USER_INTR_STAT_3_ADDR)
1844 /**************************************************************/
1846 /**************************************************************/
1847 /* Int_Status_3 Description - Reg Addr --> (0x1F), Bit --> 0...7 */
1848 #define BMI160_USER_INTR_STAT_3__POS (0)
1849 #define BMI160_USER_INTR_STAT_3__LEN (8)
1850 #define BMI160_USER_INTR_STAT_3__MSK (0xFF)
1851 #define BMI160_USER_INTR_STAT_3__REG \
1852  (BMI160_USER_INTR_STAT_3_ADDR)
1853 /**************************************************************/
1855 /**************************************************************/
1856 /* Temperature Description - LSB Reg Addr --> (0x20), Bit --> 0...7 */
1857 #define BMI160_USER_TEMP_LSB_VALUE__POS (0)
1858 #define BMI160_USER_TEMP_LSB_VALUE__LEN (8)
1859 #define BMI160_USER_TEMP_LSB_VALUE__MSK (0xFF)
1860 #define BMI160_USER_TEMP_LSB_VALUE__REG \
1861  (BMI160_USER_TEMPERATURE_0_ADDR)
1863 /* Temperature Description - LSB Reg Addr --> 0x21, Bit --> 0...7 */
1864 #define BMI160_USER_TEMP_MSB_VALUE__POS (0)
1865 #define BMI160_USER_TEMP_MSB_VALUE__LEN (8)
1866 #define BMI160_USER_TEMP_MSB_VALUE__MSK (0xFF)
1867 #define BMI160_USER_TEMP_MSB_VALUE__REG \
1868  (BMI160_USER_TEMPERATURE_1_ADDR)
1870 #ifdef FIFO_ENABLE
1871 /**************************************************************/
1873 /**************************************************************/
1874 /* Fifo_Length0 Description - Reg Addr --> 0x22, Bit --> 0...7 */
1875 #define BMI160_USER_FIFO_BYTE_COUNTER_LSB__POS (0)
1876 #define BMI160_USER_FIFO_BYTE_COUNTER_LSB__LEN (8)
1877 #define BMI160_USER_FIFO_BYTE_COUNTER_LSB__MSK (0xFF)
1878 #define BMI160_USER_FIFO_BYTE_COUNTER_LSB__REG \
1879  (BMI160_USER_FIFO_LENGTH_0_ADDR)
1881 /*Fifo_Length1 Description - Reg Addr --> 0x23, Bit --> 0...2 */
1882 #define BMI160_USER_FIFO_BYTE_COUNTER_MSB__POS (0)
1883 #define BMI160_USER_FIFO_BYTE_COUNTER_MSB__LEN 3
1884 #define BMI160_USER_FIFO_BYTE_COUNTER_MSB__MSK (0x07)
1885 #define BMI160_USER_FIFO_BYTE_COUNTER_MSB__REG \
1886  (BMI160_USER_FIFO_LENGTH_1_ADDR)
1888 /**************************************************************/
1890 /**************************************************************/
1891 /* Fifo_Data Description - Reg Addr --> 0x24, Bit --> 0...7 */
1892 #define BMI160_USER_FIFO_DATA__POS (0)
1893 #define BMI160_USER_FIFO_DATA__LEN (8)
1894 #define BMI160_USER_FIFO_DATA__MSK (0xFF)
1895 #define BMI160_USER_FIFO_DATA__REG (BMI160_USER_FIFO_DATA_ADDR)
1896 #endif
1897 /**************************************************************/
1899 /**************************************************************/
1900 /* Acc_Conf Description - Reg Addr --> (0x40), Bit --> 0...3 */
1901 #define BMI160_USER_ACCEL_CONFIG_OUTPUT_DATA_RATE__POS (0)
1902 #define BMI160_USER_ACCEL_CONFIG_OUTPUT_DATA_RATE__LEN (4)
1903 #define BMI160_USER_ACCEL_CONFIG_OUTPUT_DATA_RATE__MSK (0x0F)
1904 #define BMI160_USER_ACCEL_CONFIG_OUTPUT_DATA_RATE__REG \
1905 (BMI160_USER_ACCEL_CONFIG_ADDR)
1907 /* Acc_Conf Description - Reg Addr --> (0x40), Bit --> 4...6 */
1908 #define BMI160_USER_ACCEL_CONFIG_ACCEL_BW__POS (4)
1909 #define BMI160_USER_ACCEL_CONFIG_ACCEL_BW__LEN (3)
1910 #define BMI160_USER_ACCEL_CONFIG_ACCEL_BW__MSK (0x70)
1911 #define BMI160_USER_ACCEL_CONFIG_ACCEL_BW__REG (BMI160_USER_ACCEL_CONFIG_ADDR)
1913 /* Acc_Conf Description - Reg Addr --> (0x40), Bit --> 7 */
1914 #define BMI160_USER_ACCEL_CONFIG_ACCEL_UNDER_SAMPLING__POS (7)
1915 #define BMI160_USER_ACCEL_CONFIG_ACCEL_UNDER_SAMPLING__LEN (1)
1916 #define BMI160_USER_ACCEL_CONFIG_ACCEL_UNDER_SAMPLING__MSK (0x80)
1917 #define BMI160_USER_ACCEL_CONFIG_ACCEL_UNDER_SAMPLING__REG \
1918 (BMI160_USER_ACCEL_CONFIG_ADDR)
1920 /* Acc_Range Description - Reg Addr --> 0x41, Bit --> 0...3 */
1921 #define BMI160_USER_ACCEL_RANGE__POS (0)
1922 #define BMI160_USER_ACCEL_RANGE__LEN (4)
1923 #define BMI160_USER_ACCEL_RANGE__MSK (0x0F)
1924 #define BMI160_USER_ACCEL_RANGE__REG \
1925 (BMI160_USER_ACCEL_RANGE_ADDR)
1926 /**************************************************************/
1928 /**************************************************************/
1929 /* Gyro_Conf Description - Reg Addr --> (0x42), Bit --> 0...3 */
1930 #define BMI160_USER_GYRO_CONFIG_OUTPUT_DATA_RATE__POS (0)
1931 #define BMI160_USER_GYRO_CONFIG_OUTPUT_DATA_RATE__LEN (4)
1932 #define BMI160_USER_GYRO_CONFIG_OUTPUT_DATA_RATE__MSK (0x0F)
1933 #define BMI160_USER_GYRO_CONFIG_OUTPUT_DATA_RATE__REG \
1934 (BMI160_USER_GYRO_CONFIG_ADDR)
1936 /* Gyro_Conf Description - Reg Addr --> (0x42), Bit --> 4...5 */
1937 #define BMI160_USER_GYRO_CONFIG_BW__POS (4)
1938 #define BMI160_USER_GYRO_CONFIG_BW__LEN (2)
1939 #define BMI160_USER_GYRO_CONFIG_BW__MSK (0x30)
1940 #define BMI160_USER_GYRO_CONFIG_BW__REG \
1941 (BMI160_USER_GYRO_CONFIG_ADDR)
1943 /* Gyr_Range Description - Reg Addr --> 0x43, Bit --> 0...2 */
1944 #define BMI160_USER_GYRO_RANGE__POS (0)
1945 #define BMI160_USER_GYRO_RANGE__LEN (3)
1946 #define BMI160_USER_GYRO_RANGE__MSK (0x07)
1947 #define BMI160_USER_GYRO_RANGE__REG (BMI160_USER_GYRO_RANGE_ADDR)
1948 /**************************************************************/
1950 /**************************************************************/
1951 /* Mag_Conf Description - Reg Addr --> (0x44), Bit --> 0...3 */
1952 #define BMI160_USER_MAG_CONFIG_OUTPUT_DATA_RATE__POS (0)
1953 #define BMI160_USER_MAG_CONFIG_OUTPUT_DATA_RATE__LEN (4)
1954 #define BMI160_USER_MAG_CONFIG_OUTPUT_DATA_RATE__MSK (0x0F)
1955 #define BMI160_USER_MAG_CONFIG_OUTPUT_DATA_RATE__REG \
1956 (BMI160_USER_MAG_CONFIG_ADDR)
1958 #ifdef FIFO_ENABLE
1959 /**************************************************************/
1961 /**************************************************************/
1962 /* Fifo_Downs Description - Reg Addr --> 0x45, Bit --> 0...2 */
1963 #define BMI160_USER_FIFO_DOWN_GYRO__POS (0)
1964 #define BMI160_USER_FIFO_DOWN_GYRO__LEN (3)
1965 #define BMI160_USER_FIFO_DOWN_GYRO__MSK (0x07)
1966 #define BMI160_USER_FIFO_DOWN_GYRO__REG (BMI160_USER_FIFO_DOWN_ADDR)
1967 /**************************************************************/
1969 /**************************************************************/
1970 /* Fifo_filt Description - Reg Addr --> 0x45, Bit --> 3 */
1971 #define BMI160_USER_FIFO_FILTER_GYRO__POS (3)
1972 #define BMI160_USER_FIFO_FILTER_GYRO__LEN (1)
1973 #define BMI160_USER_FIFO_FILTER_GYRO__MSK (0x08)
1974 #define BMI160_USER_FIFO_FILTER_GYRO__REG (BMI160_USER_FIFO_DOWN_ADDR)
1976 /* Fifo_Downs Description - Reg Addr --> 0x45, Bit --> 4...6 */
1977 #define BMI160_USER_FIFO_DOWN_ACCEL__POS (4)
1978 #define BMI160_USER_FIFO_DOWN_ACCEL__LEN (3)
1979 #define BMI160_USER_FIFO_DOWN_ACCEL__MSK (0x70)
1980 #define BMI160_USER_FIFO_DOWN_ACCEL__REG (BMI160_USER_FIFO_DOWN_ADDR)
1982 /* Fifo_FILT Description - Reg Addr --> 0x45, Bit --> 7 */
1983 #define BMI160_USER_FIFO_FILTER_ACCEL__POS (7)
1984 #define BMI160_USER_FIFO_FILTER_ACCEL__LEN (1)
1985 #define BMI160_USER_FIFO_FILTER_ACCEL__MSK (0x80)
1986 #define BMI160_USER_FIFO_FILTER_ACCEL__REG (BMI160_USER_FIFO_DOWN_ADDR)
1987 /**************************************************************/
1989 /**************************************************************/
1990 /* Fifo_Config_0 Description - Reg Addr --> 0x46, Bit --> 0...7 */
1991 #define BMI160_USER_FIFO_WM__POS (0)
1992 #define BMI160_USER_FIFO_WM__LEN (8)
1993 #define BMI160_USER_FIFO_WM__MSK (0xFF)
1994 #define BMI160_USER_FIFO_WM__REG (BMI160_USER_FIFO_CONFIG_0_ADDR)
1995 /**************************************************************/
1997 /**************************************************************/
1998 /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 1 */
1999 #define BMI160_USER_FIFO_TIME_ENABLE__POS (1)
2000 #define BMI160_USER_FIFO_TIME_ENABLE__LEN (1)
2001 #define BMI160_USER_FIFO_TIME_ENABLE__MSK (0x02)
2002 #define BMI160_USER_FIFO_TIME_ENABLE__REG (BMI160_USER_FIFO_CONFIG_1_ADDR)
2003 /**************************************************************/
2005 /**************************************************************/
2006 /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 2 */
2007 #define BMI160_USER_FIFO_TAG_INTR2_ENABLE__POS (2)
2008 #define BMI160_USER_FIFO_TAG_INTR2_ENABLE__LEN (1)
2009 #define BMI160_USER_FIFO_TAG_INTR2_ENABLE__MSK (0x04)
2010 #define BMI160_USER_FIFO_TAG_INTR2_ENABLE__REG (BMI160_USER_FIFO_CONFIG_1_ADDR)
2012 /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 3 */
2013 #define BMI160_USER_FIFO_TAG_INTR1_ENABLE__POS (3)
2014 #define BMI160_USER_FIFO_TAG_INTR1_ENABLE__LEN (1)
2015 #define BMI160_USER_FIFO_TAG_INTR1_ENABLE__MSK (0x08)
2016 #define BMI160_USER_FIFO_TAG_INTR1_ENABLE__REG (BMI160_USER_FIFO_CONFIG_1_ADDR)
2017 /**************************************************************/
2019 /**************************************************************/
2020 /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 4 */
2021 #define BMI160_USER_FIFO_HEADER_ENABLE__POS (4)
2022 #define BMI160_USER_FIFO_HEADER_ENABLE__LEN (1)
2023 #define BMI160_USER_FIFO_HEADER_ENABLE__MSK (0x10)
2024 #define BMI160_USER_FIFO_HEADER_ENABLE__REG \
2025 (BMI160_USER_FIFO_CONFIG_1_ADDR)
2026 /**************************************************************/
2028 /**************************************************************/
2029 /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 5 */
2030 #define BMI160_USER_FIFO_MAG_ENABLE__POS (5)
2031 #define BMI160_USER_FIFO_MAG_ENABLE__LEN (1)
2032 #define BMI160_USER_FIFO_MAG_ENABLE__MSK (0x20)
2033 #define BMI160_USER_FIFO_MAG_ENABLE__REG \
2034 (BMI160_USER_FIFO_CONFIG_1_ADDR)
2035 /**************************************************************/
2037 /**************************************************************/
2038 /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 6 */
2039 #define BMI160_USER_FIFO_ACCEL_ENABLE__POS (6)
2040 #define BMI160_USER_FIFO_ACCEL_ENABLE__LEN (1)
2041 #define BMI160_USER_FIFO_ACCEL_ENABLE__MSK (0x40)
2042 #define BMI160_USER_FIFO_ACCEL_ENABLE__REG \
2043 (BMI160_USER_FIFO_CONFIG_1_ADDR)
2044 /**************************************************************/
2046 /**************************************************************/
2047 /* Fifo_Config_1 Description - Reg Addr --> 0x47, Bit --> 7 */
2048 #define BMI160_USER_FIFO_GYRO_ENABLE__POS (7)
2049 #define BMI160_USER_FIFO_GYRO_ENABLE__LEN (1)
2050 #define BMI160_USER_FIFO_GYRO_ENABLE__MSK (0x80)
2051 #define BMI160_USER_FIFO_GYRO_ENABLE__REG \
2052 (BMI160_USER_FIFO_CONFIG_1_ADDR)
2053 #endif
2054 /**************************************************************/
2056 /**************************************************************/
2057 
2058 /* Mag_IF_0 Description - Reg Addr --> 0x4b, Bit --> 1...7 */
2059 #define BMI160_USER_I2C_DEVICE_ADDR__POS (1)
2060 #define BMI160_USER_I2C_DEVICE_ADDR__LEN (7)
2061 #define BMI160_USER_I2C_DEVICE_ADDR__MSK (0xFE)
2062 #define BMI160_USER_I2C_DEVICE_ADDR__REG (BMI160_USER_MAG_IF_0_ADDR)
2063 /**************************************************************/
2066 /**************************************************************/
2067 /* Mag_IF_1 Description - Reg Addr --> 0x4c, Bit --> 0...1 */
2068 #define BMI160_USER_MAG_BURST__POS (0)
2069 #define BMI160_USER_MAG_BURST__LEN (2)
2070 #define BMI160_USER_MAG_BURST__MSK (0x03)
2071 #define BMI160_USER_MAG_BURST__REG (BMI160_USER_MAG_IF_1_ADDR)
2073 /* Mag_IF_1 Description - Reg Addr --> 0x4c, Bit --> 2...5 */
2074 #define BMI160_USER_MAG_OFFSET__POS (2)
2075 #define BMI160_USER_MAG_OFFSET__LEN (4)
2076 #define BMI160_USER_MAG_OFFSET__MSK (0x3C)
2077 #define BMI160_USER_MAG_OFFSET__REG (BMI160_USER_MAG_IF_1_ADDR)
2079 /* Mag_IF_1 Description - Reg Addr --> 0x4c, Bit --> 7 */
2080 #define BMI160_USER_MAG_MANUAL_ENABLE__POS (7)
2081 #define BMI160_USER_MAG_MANUAL_ENABLE__LEN (1)
2082 #define BMI160_USER_MAG_MANUAL_ENABLE__MSK (0x80)
2083 #define BMI160_USER_MAG_MANUAL_ENABLE__REG \
2084 (BMI160_USER_MAG_IF_1_ADDR)
2086 /* Mag_IF_2 Description - Reg Addr --> 0x4d, Bit -->0... 7 */
2087 #define BMI160_USER_READ_ADDR__POS (0)
2088 #define BMI160_USER_READ_ADDR__LEN (8)
2089 #define BMI160_USER_READ_ADDR__MSK (0xFF)
2090 #define BMI160_USER_READ_ADDR__REG (BMI160_USER_MAG_IF_2_ADDR)
2092 /* Mag_IF_3 Description - Reg Addr --> 0x4e, Bit -->0... 7 */
2093 #define BMI160_USER_WRITE_ADDR__POS (0)
2094 #define BMI160_USER_WRITE_ADDR__LEN (8)
2095 #define BMI160_USER_WRITE_ADDR__MSK (0xFF)
2096 #define BMI160_USER_WRITE_ADDR__REG (BMI160_USER_MAG_IF_3_ADDR)
2098 /* Mag_IF_4 Description - Reg Addr --> 0x4f, Bit -->0... 7 */
2099 #define BMI160_USER_WRITE_DATA__POS (0)
2100 #define BMI160_USER_WRITE_DATA__LEN (8)
2101 #define BMI160_USER_WRITE_DATA__MSK (0xFF)
2102 #define BMI160_USER_WRITE_DATA__REG (BMI160_USER_MAG_IF_4_ADDR)
2103 /**************************************************************/
2105 /**************************************************************/
2106 /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->0 */
2107 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_X_ENABLE__POS (0)
2108 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_X_ENABLE__LEN (1)
2109 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_X_ENABLE__MSK (0x01)
2110 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_X_ENABLE__REG \
2111 (BMI160_USER_INTR_ENABLE_0_ADDR)
2113 /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->1 */
2114 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Y_ENABLE__POS (1)
2115 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Y_ENABLE__LEN (1)
2116 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Y_ENABLE__MSK (0x02)
2117 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Y_ENABLE__REG \
2118 (BMI160_USER_INTR_ENABLE_0_ADDR)
2120 /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->2 */
2121 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Z_ENABLE__POS (2)
2122 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Z_ENABLE__LEN (1)
2123 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Z_ENABLE__MSK (0x04)
2124 #define BMI160_USER_INTR_ENABLE_0_ANY_MOTION_Z_ENABLE__REG \
2125 (BMI160_USER_INTR_ENABLE_0_ADDR)
2126 /**************************************************************/
2128 /**************************************************************/
2129 /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->4 */
2130 #define BMI160_USER_INTR_ENABLE_0_DOUBLE_TAP_ENABLE__POS (4)
2131 #define BMI160_USER_INTR_ENABLE_0_DOUBLE_TAP_ENABLE__LEN (1)
2132 #define BMI160_USER_INTR_ENABLE_0_DOUBLE_TAP_ENABLE__MSK (0x10)
2133 #define BMI160_USER_INTR_ENABLE_0_DOUBLE_TAP_ENABLE__REG \
2134 (BMI160_USER_INTR_ENABLE_0_ADDR)
2135 /**************************************************************/
2137 /**************************************************************/
2138 /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->5 */
2139 #define BMI160_USER_INTR_ENABLE_0_SINGLE_TAP_ENABLE__POS (5)
2140 #define BMI160_USER_INTR_ENABLE_0_SINGLE_TAP_ENABLE__LEN (1)
2141 #define BMI160_USER_INTR_ENABLE_0_SINGLE_TAP_ENABLE__MSK (0x20)
2142 #define BMI160_USER_INTR_ENABLE_0_SINGLE_TAP_ENABLE__REG \
2143 (BMI160_USER_INTR_ENABLE_0_ADDR)
2144 /**************************************************************/
2146 /**************************************************************/
2147 /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->6 */
2148 #define BMI160_USER_INTR_ENABLE_0_ORIENT_ENABLE__POS (6)
2149 #define BMI160_USER_INTR_ENABLE_0_ORIENT_ENABLE__LEN (1)
2150 #define BMI160_USER_INTR_ENABLE_0_ORIENT_ENABLE__MSK (0x40)
2151 #define BMI160_USER_INTR_ENABLE_0_ORIENT_ENABLE__REG \
2152 (BMI160_USER_INTR_ENABLE_0_ADDR)
2153 /**************************************************************/
2155 /**************************************************************/
2156 /* Int_En_0 Description - Reg Addr --> 0x50, Bit -->7 */
2157 #define BMI160_USER_INTR_ENABLE_0_FLAT_ENABLE__POS (7)
2158 #define BMI160_USER_INTR_ENABLE_0_FLAT_ENABLE__LEN (1)
2159 #define BMI160_USER_INTR_ENABLE_0_FLAT_ENABLE__MSK (0x80)
2160 #define BMI160_USER_INTR_ENABLE_0_FLAT_ENABLE__REG \
2161 (BMI160_USER_INTR_ENABLE_0_ADDR)
2162 /**************************************************************/
2164 /**************************************************************/
2165 /* Int_En_1 Description - Reg Addr --> (0x51), Bit -->0 */
2166 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_X_ENABLE__POS (0)
2167 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_X_ENABLE__LEN (1)
2168 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_X_ENABLE__MSK (0x01)
2169 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_X_ENABLE__REG \
2170 (BMI160_USER_INTR_ENABLE_1_ADDR)
2172 /* Int_En_1 Description - Reg Addr --> (0x51), Bit -->1 */
2173 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Y_ENABLE__POS (1)
2174 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Y_ENABLE__LEN (1)
2175 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Y_ENABLE__MSK (0x02)
2176 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Y_ENABLE__REG \
2177 (BMI160_USER_INTR_ENABLE_1_ADDR)
2179 /* Int_En_1 Description - Reg Addr --> (0x51), Bit -->2 */
2180 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Z_ENABLE__POS (2)
2181 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Z_ENABLE__LEN (1)
2182 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Z_ENABLE__MSK (0x04)
2183 #define BMI160_USER_INTR_ENABLE_1_HIGH_G_Z_ENABLE__REG \
2184 (BMI160_USER_INTR_ENABLE_1_ADDR)
2185 /**************************************************************/
2187 /**************************************************************/
2188 /* Int_En_1 Description - Reg Addr --> (0x51), Bit -->3 */
2189 #define BMI160_USER_INTR_ENABLE_1_LOW_G_ENABLE__POS (3)
2190 #define BMI160_USER_INTR_ENABLE_1_LOW_G_ENABLE__LEN (1)
2191 #define BMI160_USER_INTR_ENABLE_1_LOW_G_ENABLE__MSK (0x08)
2192 #define BMI160_USER_INTR_ENABLE_1_LOW_G_ENABLE__REG \
2193 (BMI160_USER_INTR_ENABLE_1_ADDR)
2194 /**************************************************************/
2196 /**************************************************************/
2197 /* Int_En_1 Description - Reg Addr --> (0x51), Bit -->4 */
2198 #define BMI160_USER_INTR_ENABLE_1_DATA_RDY_ENABLE__POS (4)
2199 #define BMI160_USER_INTR_ENABLE_1_DATA_RDY_ENABLE__LEN (1)
2200 #define BMI160_USER_INTR_ENABLE_1_DATA_RDY_ENABLE__MSK (0x10)
2201 #define BMI160_USER_INTR_ENABLE_1_DATA_RDY_ENABLE__REG \
2202 (BMI160_USER_INTR_ENABLE_1_ADDR)
2204 #ifdef FIFO_ENABLE
2205 /**************************************************************/
2207 /**************************************************************/
2208 /* Int_En_1 Description - Reg Addr --> (0x51), Bit -->5 */
2209 #define BMI160_USER_INTR_ENABLE_1_FIFO_FULL_ENABLE__POS (5)
2210 #define BMI160_USER_INTR_ENABLE_1_FIFO_FULL_ENABLE__LEN (1)
2211 #define BMI160_USER_INTR_ENABLE_1_FIFO_FULL_ENABLE__MSK (0x20)
2212 #define BMI160_USER_INTR_ENABLE_1_FIFO_FULL_ENABLE__REG \
2213 (BMI160_USER_INTR_ENABLE_1_ADDR)
2215 /* Int_En_1 Description - Reg Addr --> (0x51), Bit -->6 */
2216 #define BMI160_USER_INTR_ENABLE_1_FIFO_WM_ENABLE__POS (6)
2217 #define BMI160_USER_INTR_ENABLE_1_FIFO_WM_ENABLE__LEN (1)
2218 #define BMI160_USER_INTR_ENABLE_1_FIFO_WM_ENABLE__MSK (0x40)
2219 #define BMI160_USER_INTR_ENABLE_1_FIFO_WM_ENABLE__REG \
2220 (BMI160_USER_INTR_ENABLE_1_ADDR)
2221 #endif
2222 /**************************************************************/
2224 /**************************************************************/
2225 /* Int_En_2 Description - Reg Addr --> (0x52), Bit -->0 */
2226 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_X_ENABLE__POS (0)
2227 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_X_ENABLE__LEN (1)
2228 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_X_ENABLE__MSK (0x01)
2229 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_X_ENABLE__REG \
2230 (BMI160_USER_INTR_ENABLE_2_ADDR)
2232 /* Int_En_2 Description - Reg Addr --> (0x52), Bit -->1 */
2233 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Y_ENABLE__POS (1)
2234 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Y_ENABLE__LEN (1)
2235 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Y_ENABLE__MSK (0x02)
2236 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Y_ENABLE__REG \
2237 (BMI160_USER_INTR_ENABLE_2_ADDR)
2239 /* Int_En_2 Description - Reg Addr --> (0x52), Bit -->2 */
2240 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Z_ENABLE__POS (2)
2241 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Z_ENABLE__LEN (1)
2242 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Z_ENABLE__MSK (0x04)
2243 #define BMI160_USER_INTR_ENABLE_2_NOMOTION_Z_ENABLE__REG \
2244 (BMI160_USER_INTR_ENABLE_2_ADDR)
2245 /**************************************************************/
2247 /**************************************************************/
2248 /* Int_En_2 Description - Reg Addr --> (0x52), Bit -->3 */
2249 #define BMI160_USER_INTR_ENABLE_2_STEP_DETECTOR_ENABLE__POS (3)
2250 #define BMI160_USER_INTR_ENABLE_2_STEP_DETECTOR_ENABLE__LEN (1)
2251 #define BMI160_USER_INTR_ENABLE_2_STEP_DETECTOR_ENABLE__MSK (0x08)
2252 #define BMI160_USER_INTR_ENABLE_2_STEP_DETECTOR_ENABLE__REG \
2253 (BMI160_USER_INTR_ENABLE_2_ADDR)
2254 /**************************************************************/
2256 /**************************************************************/
2257 /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->0 */
2258 #define BMI160_USER_INTR1_EDGE_CTRL__POS (0)
2259 #define BMI160_USER_INTR1_EDGE_CTRL__LEN (1)
2260 #define BMI160_USER_INTR1_EDGE_CTRL__MSK (0x01)
2261 #define BMI160_USER_INTR1_EDGE_CTRL__REG \
2262 (BMI160_USER_INTR_OUT_CTRL_ADDR)
2263 /**************************************************************/
2265 /**************************************************************/
2266 /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->1 */
2267 #define BMI160_USER_INTR1_LEVEL__POS (1)
2268 #define BMI160_USER_INTR1_LEVEL__LEN (1)
2269 #define BMI160_USER_INTR1_LEVEL__MSK (0x02)
2270 #define BMI160_USER_INTR1_LEVEL__REG \
2271 (BMI160_USER_INTR_OUT_CTRL_ADDR)
2272 /**************************************************************/
2274 /**************************************************************/
2275 /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->2 */
2276 #define BMI160_USER_INTR1_OUTPUT_TYPE__POS (2)
2277 #define BMI160_USER_INTR1_OUTPUT_TYPE__LEN (1)
2278 #define BMI160_USER_INTR1_OUTPUT_TYPE__MSK (0x04)
2279 #define BMI160_USER_INTR1_OUTPUT_TYPE__REG \
2280 (BMI160_USER_INTR_OUT_CTRL_ADDR)
2281 /**************************************************************/
2283 /**************************************************************/
2284 /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->3 */
2285 #define BMI160_USER_INTR1_OUTPUT_ENABLE__POS (3)
2286 #define BMI160_USER_INTR1_OUTPUT_ENABLE__LEN (1)
2287 #define BMI160_USER_INTR1_OUTPUT_ENABLE__MSK (0x08)
2288 #define BMI160_USER_INTR1_OUTPUT_ENABLE__REG \
2289 (BMI160_USER_INTR_OUT_CTRL_ADDR)
2290 /**************************************************************/
2292 /**************************************************************/
2293 /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->4 */
2294 #define BMI160_USER_INTR2_EDGE_CTRL__POS (4)
2295 #define BMI160_USER_INTR2_EDGE_CTRL__LEN (1)
2296 #define BMI160_USER_INTR2_EDGE_CTRL__MSK (0x10)
2297 #define BMI160_USER_INTR2_EDGE_CTRL__REG \
2298 (BMI160_USER_INTR_OUT_CTRL_ADDR)
2299 /**************************************************************/
2301 /**************************************************************/
2302 /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->5 */
2303 #define BMI160_USER_INTR2_LEVEL__POS (5)
2304 #define BMI160_USER_INTR2_LEVEL__LEN (1)
2305 #define BMI160_USER_INTR2_LEVEL__MSK (0x20)
2306 #define BMI160_USER_INTR2_LEVEL__REG \
2307 (BMI160_USER_INTR_OUT_CTRL_ADDR)
2308 /**************************************************************/
2310 /**************************************************************/
2311 /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->6 */
2312 #define BMI160_USER_INTR2_OUTPUT_TYPE__POS (6)
2313 #define BMI160_USER_INTR2_OUTPUT_TYPE__LEN (1)
2314 #define BMI160_USER_INTR2_OUTPUT_TYPE__MSK (0x40)
2315 #define BMI160_USER_INTR2_OUTPUT_TYPE__REG \
2316 (BMI160_USER_INTR_OUT_CTRL_ADDR)
2318 /* Int_Out_Ctrl Description - Reg Addr --> 0x53, Bit -->7 */
2319 #define BMI160_USER_INTR2_OUTPUT_EN__POS (7)
2320 #define BMI160_USER_INTR2_OUTPUT_EN__LEN (1)
2321 #define BMI160_USER_INTR2_OUTPUT_EN__MSK (0x80)
2322 #define BMI160_USER_INTR2_OUTPUT_EN__REG \
2323 (BMI160_USER_INTR_OUT_CTRL_ADDR)
2324 /**************************************************************/
2326 /**************************************************************/
2327 /* Int_Latch Description - Reg Addr --> 0x54, Bit -->0...3 */
2328 #define BMI160_USER_INTR_LATCH__POS (0)
2329 #define BMI160_USER_INTR_LATCH__LEN (4)
2330 #define BMI160_USER_INTR_LATCH__MSK (0x0F)
2331 #define BMI160_USER_INTR_LATCH__REG (BMI160_USER_INTR_LATCH_ADDR)
2332 /**************************************************************/
2334 /**************************************************************/
2335 /* Int_Latch Description - Reg Addr --> 0x54, Bit -->4 */
2336 #define BMI160_USER_INTR1_INPUT_ENABLE__POS (4)
2337 #define BMI160_USER_INTR1_INPUT_ENABLE__LEN (1)
2338 #define BMI160_USER_INTR1_INPUT_ENABLE__MSK (0x10)
2339 #define BMI160_USER_INTR1_INPUT_ENABLE__REG \
2340 (BMI160_USER_INTR_LATCH_ADDR)
2342 /* Int_Latch Description - Reg Addr --> 0x54, Bit -->5*/
2343 #define BMI160_USER_INTR2_INPUT_ENABLE__POS (5)
2344 #define BMI160_USER_INTR2_INPUT_ENABLE__LEN (1)
2345 #define BMI160_USER_INTR2_INPUT_ENABLE__MSK (0x20)
2346 #define BMI160_USER_INTR2_INPUT_ENABLE__REG \
2347 (BMI160_USER_INTR_LATCH_ADDR)
2348 /**************************************************************/
2350 /**************************************************************/
2351 /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->0 */
2352 #define BMI160_USER_INTR_MAP_0_INTR1_LOW_G__POS (0)
2353 #define BMI160_USER_INTR_MAP_0_INTR1_LOW_G__LEN (1)
2354 #define BMI160_USER_INTR_MAP_0_INTR1_LOW_G__MSK (0x01)
2355 #define BMI160_USER_INTR_MAP_0_INTR1_LOW_G__REG (BMI160_USER_INTR_MAP_0_ADDR)
2356 /**************************************************************/
2358 /**************************************************************/
2359 /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->1 */
2360 #define BMI160_USER_INTR_MAP_0_INTR1_HIGH_G__POS (1)
2361 #define BMI160_USER_INTR_MAP_0_INTR1_HIGH_G__LEN (1)
2362 #define BMI160_USER_INTR_MAP_0_INTR1_HIGH_G__MSK (0x02)
2363 #define BMI160_USER_INTR_MAP_0_INTR1_HIGH_G__REG \
2364 (BMI160_USER_INTR_MAP_0_ADDR)
2365 /**************************************************************/
2367 /**************************************************************/
2368 /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->2 */
2369 #define BMI160_USER_INTR_MAP_0_INTR1_ANY_MOTION__POS (2)
2370 #define BMI160_USER_INTR_MAP_0_INTR1_ANY_MOTION__LEN (1)
2371 #define BMI160_USER_INTR_MAP_0_INTR1_ANY_MOTION__MSK (0x04)
2372 #define BMI160_USER_INTR_MAP_0_INTR1_ANY_MOTION__REG \
2373 (BMI160_USER_INTR_MAP_0_ADDR)
2374 /**************************************************************/
2376 /**************************************************************/
2377 /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->3 */
2378 #define BMI160_USER_INTR_MAP_0_INTR1_NOMOTION__POS (3)
2379 #define BMI160_USER_INTR_MAP_0_INTR1_NOMOTION__LEN (1)
2380 #define BMI160_USER_INTR_MAP_0_INTR1_NOMOTION__MSK (0x08)
2381 #define BMI160_USER_INTR_MAP_0_INTR1_NOMOTION__REG (BMI160_USER_INTR_MAP_0_ADDR)
2382 /**************************************************************/
2384 /**************************************************************/
2385 /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->4 */
2386 #define BMI160_USER_INTR_MAP_0_INTR1_DOUBLE_TAP__POS (4)
2387 #define BMI160_USER_INTR_MAP_0_INTR1_DOUBLE_TAP__LEN (1)
2388 #define BMI160_USER_INTR_MAP_0_INTR1_DOUBLE_TAP__MSK (0x10)
2389 #define BMI160_USER_INTR_MAP_0_INTR1_DOUBLE_TAP__REG \
2390 (BMI160_USER_INTR_MAP_0_ADDR)
2391 /**************************************************************/
2393 /**************************************************************/
2394 /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->5 */
2395 #define BMI160_USER_INTR_MAP_0_INTR1_SINGLE_TAP__POS (5)
2396 #define BMI160_USER_INTR_MAP_0_INTR1_SINGLE_TAP__LEN (1)
2397 #define BMI160_USER_INTR_MAP_0_INTR1_SINGLE_TAP__MSK (0x20)
2398 #define BMI160_USER_INTR_MAP_0_INTR1_SINGLE_TAP__REG \
2399 (BMI160_USER_INTR_MAP_0_ADDR)
2400 /**************************************************************/
2402 /**************************************************************/
2403 /* Int_Map_0 Description - Reg Addr --> 0x55, Bit -->6 */
2404 #define BMI160_USER_INTR_MAP_0_INTR1_ORIENT__POS (6)
2405 #define BMI160_USER_INTR_MAP_0_INTR1_ORIENT__LEN (1)
2406 #define BMI160_USER_INTR_MAP_0_INTR1_ORIENT__MSK (0x40)
2407 #define BMI160_USER_INTR_MAP_0_INTR1_ORIENT__REG \
2408 (BMI160_USER_INTR_MAP_0_ADDR)
2409 /**************************************************************/
2411 /**************************************************************/
2412 /* Int_Map_0 Description - Reg Addr --> 0x56, Bit -->7 */
2413 #define BMI160_USER_INTR_MAP_0_INTR1_FLAT__POS (7)
2414 #define BMI160_USER_INTR_MAP_0_INTR1_FLAT__LEN (1)
2415 #define BMI160_USER_INTR_MAP_0_INTR1_FLAT__MSK (0x80)
2416 #define BMI160_USER_INTR_MAP_0_INTR1_FLAT__REG (BMI160_USER_INTR_MAP_0_ADDR)
2417 /**************************************************************/
2419 /**************************************************************/
2420 /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->0 */
2421 #define BMI160_USER_INTR_MAP_1_INTR2_PMU_TRIG__POS (0)
2422 #define BMI160_USER_INTR_MAP_1_INTR2_PMU_TRIG__LEN (1)
2423 #define BMI160_USER_INTR_MAP_1_INTR2_PMU_TRIG__MSK (0x01)
2424 #define BMI160_USER_INTR_MAP_1_INTR2_PMU_TRIG__REG (BMI160_USER_INTR_MAP_1_ADDR)
2426 #ifdef FIFO_ENABLE
2427 /**************************************************************/
2430 /**************************************************************/
2431 
2432 /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->1 */
2433 #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_FULL__POS (1)
2434 #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_FULL__LEN (1)
2435 #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_FULL__MSK (0x02)
2436 #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_FULL__REG \
2437 (BMI160_USER_INTR_MAP_1_ADDR)
2439 /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->2 */
2440 #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_WM__POS (2)
2441 #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_WM__LEN (1)
2442 #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_WM__MSK (0x04)
2443 #define BMI160_USER_INTR_MAP_1_INTR2_FIFO_WM__REG \
2444 (BMI160_USER_INTR_MAP_1_ADDR)
2445 #endif
2446 /**************************************************************/
2448 /**************************************************************/
2449 /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->3 */
2450 #define BMI160_USER_INTR_MAP_1_INTR2_DATA_RDY__POS (3)
2451 #define BMI160_USER_INTR_MAP_1_INTR2_DATA_RDY__LEN (1)
2452 #define BMI160_USER_INTR_MAP_1_INTR2_DATA_RDY__MSK (0x08)
2453 #define BMI160_USER_INTR_MAP_1_INTR2_DATA_RDY__REG \
2454 (BMI160_USER_INTR_MAP_1_ADDR)
2455 /**************************************************************/
2457 /**************************************************************/
2458 /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->4 */
2459 #define BMI160_USER_INTR_MAP_1_INTR1_PMU_TRIG__POS (4)
2460 #define BMI160_USER_INTR_MAP_1_INTR1_PMU_TRIG__LEN (1)
2461 #define BMI160_USER_INTR_MAP_1_INTR1_PMU_TRIG__MSK (0x10)
2462 #define BMI160_USER_INTR_MAP_1_INTR1_PMU_TRIG__REG (BMI160_USER_INTR_MAP_1_ADDR)
2463 /**************************************************************/
2466 /**************************************************************/
2467 /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->5 */
2468 #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_FULL__POS (5)
2469 #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_FULL__LEN (1)
2470 #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_FULL__MSK (0x20)
2471 #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_FULL__REG \
2472 (BMI160_USER_INTR_MAP_1_ADDR)
2474 /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->6 */
2475 #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_WM__POS (6)
2476 #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_WM__LEN (1)
2477 #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_WM__MSK (0x40)
2478 #define BMI160_USER_INTR_MAP_1_INTR1_FIFO_WM__REG \
2479 (BMI160_USER_INTR_MAP_1_ADDR)
2480 /**************************************************************/
2482 /**************************************************************/
2483 /* Int_Map_1 Description - Reg Addr --> 0x56, Bit -->7 */
2484 #define BMI160_USER_INTR_MAP_1_INTR1_DATA_RDY__POS (7)
2485 #define BMI160_USER_INTR_MAP_1_INTR1_DATA_RDY__LEN (1)
2486 #define BMI160_USER_INTR_MAP_1_INTR1_DATA_RDY__MSK (0x80)
2487 #define BMI160_USER_INTR_MAP_1_INTR1_DATA_RDY__REG \
2488 (BMI160_USER_INTR_MAP_1_ADDR)
2489 /**************************************************************/
2491 /**************************************************************/
2492 /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->0 */
2493 #define BMI160_USER_INTR_MAP_2_INTR2_LOW_G__POS (0)
2494 #define BMI160_USER_INTR_MAP_2_INTR2_LOW_G__LEN (1)
2495 #define BMI160_USER_INTR_MAP_2_INTR2_LOW_G__MSK (0x01)
2496 #define BMI160_USER_INTR_MAP_2_INTR2_LOW_G__REG (BMI160_USER_INTR_MAP_2_ADDR)
2497 /**************************************************************/
2499 /**************************************************************/
2500 /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->1 */
2501 #define BMI160_USER_INTR_MAP_2_INTR2_HIGH_G__POS (1)
2502 #define BMI160_USER_INTR_MAP_2_INTR2_HIGH_G__LEN (1)
2503 #define BMI160_USER_INTR_MAP_2_INTR2_HIGH_G__MSK (0x02)
2504 #define BMI160_USER_INTR_MAP_2_INTR2_HIGH_G__REG \
2505 (BMI160_USER_INTR_MAP_2_ADDR)
2506 /**************************************************************/
2508 /**************************************************************/
2509 /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->2 */
2510 #define BMI160_USER_INTR_MAP_2_INTR2_ANY_MOTION__POS (2)
2511 #define BMI160_USER_INTR_MAP_2_INTR2_ANY_MOTION__LEN (1)
2512 #define BMI160_USER_INTR_MAP_2_INTR2_ANY_MOTION__MSK (0x04)
2513 #define BMI160_USER_INTR_MAP_2_INTR2_ANY_MOTION__REG \
2514 (BMI160_USER_INTR_MAP_2_ADDR)
2515 /**************************************************************/
2517 /**************************************************************/
2518 /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->3 */
2519 #define BMI160_USER_INTR_MAP_2_INTR2_NOMOTION__POS (3)
2520 #define BMI160_USER_INTR_MAP_2_INTR2_NOMOTION__LEN (1)
2521 #define BMI160_USER_INTR_MAP_2_INTR2_NOMOTION__MSK (0x08)
2522 #define BMI160_USER_INTR_MAP_2_INTR2_NOMOTION__REG (BMI160_USER_INTR_MAP_2_ADDR)
2523 /**************************************************************/
2525 /**************************************************************/
2526 /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->4 */
2527 #define BMI160_USER_INTR_MAP_2_INTR2_DOUBLE_TAP__POS (4)
2528 #define BMI160_USER_INTR_MAP_2_INTR2_DOUBLE_TAP__LEN (1)
2529 #define BMI160_USER_INTR_MAP_2_INTR2_DOUBLE_TAP__MSK (0x10)
2530 #define BMI160_USER_INTR_MAP_2_INTR2_DOUBLE_TAP__REG \
2531 (BMI160_USER_INTR_MAP_2_ADDR)
2532 /**************************************************************/
2534 /**************************************************************/
2535 /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->5 */
2536 #define BMI160_USER_INTR_MAP_2_INTR2_SINGLE_TAP__POS (5)
2537 #define BMI160_USER_INTR_MAP_2_INTR2_SINGLE_TAP__LEN (1)
2538 #define BMI160_USER_INTR_MAP_2_INTR2_SINGLE_TAP__MSK (0x20)
2539 #define BMI160_USER_INTR_MAP_2_INTR2_SINGLE_TAP__REG \
2540 (BMI160_USER_INTR_MAP_2_ADDR)
2541 /**************************************************************/
2543 /**************************************************************/
2544 /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->6 */
2545 #define BMI160_USER_INTR_MAP_2_INTR2_ORIENT__POS (6)
2546 #define BMI160_USER_INTR_MAP_2_INTR2_ORIENT__LEN (1)
2547 #define BMI160_USER_INTR_MAP_2_INTR2_ORIENT__MSK (0x40)
2548 #define BMI160_USER_INTR_MAP_2_INTR2_ORIENT__REG \
2549 (BMI160_USER_INTR_MAP_2_ADDR)
2550 /**************************************************************/
2552 /**************************************************************/
2553 /* Int_Map_2 Description - Reg Addr --> 0x57, Bit -->7 */
2554 #define BMI160_USER_INTR_MAP_2_INTR2_FLAT__POS (7)
2555 #define BMI160_USER_INTR_MAP_2_INTR2_FLAT__LEN (1)
2556 #define BMI160_USER_INTR_MAP_2_INTR2_FLAT__MSK (0x80)
2557 #define BMI160_USER_INTR_MAP_2_INTR2_FLAT__REG (BMI160_USER_INTR_MAP_2_ADDR)
2559 /**************************************************************/
2561 /**************************************************************/
2562 /* Int_Data_0 Description - Reg Addr --> 0x58, Bit --> 3 */
2563 #define BMI160_USER_INTR_DATA_0_INTR_TAP_SOURCE__POS (3)
2564 #define BMI160_USER_INTR_DATA_0_INTR_TAP_SOURCE__LEN (1)
2565 #define BMI160_USER_INTR_DATA_0_INTR_TAP_SOURCE__MSK (0x08)
2566 #define BMI160_USER_INTR_DATA_0_INTR_TAP_SOURCE__REG \
2567 (BMI160_USER_INTR_DATA_0_ADDR)
2569 /**************************************************************/
2571 /**************************************************************/
2572 /* Int_Data_0 Description - Reg Addr --> 0x58, Bit --> 7 */
2573 #define BMI160_USER_INTR_DATA_0_INTR_LOW_HIGH_SOURCE__POS (7)
2574 #define BMI160_USER_INTR_DATA_0_INTR_LOW_HIGH_SOURCE__LEN (1)
2575 #define BMI160_USER_INTR_DATA_0_INTR_LOW_HIGH_SOURCE__MSK (0x80)
2576 #define BMI160_USER_INTR_DATA_0_INTR_LOW_HIGH_SOURCE__REG \
2577 (BMI160_USER_INTR_DATA_0_ADDR)
2579 /**************************************************************/
2581 /**************************************************************/
2582 /* Int_Data_1 Description - Reg Addr --> 0x59, Bit --> 7 */
2583 #define BMI160_USER_INTR_DATA_1_INTR_MOTION_SOURCE__POS (7)
2584 #define BMI160_USER_INTR_DATA_1_INTR_MOTION_SOURCE__LEN (1)
2585 #define BMI160_USER_INTR_DATA_1_INTR_MOTION_SOURCE__MSK (0x80)
2586 #define BMI160_USER_INTR_DATA_1_INTR_MOTION_SOURCE__REG \
2587  (BMI160_USER_INTR_DATA_1_ADDR)
2588 /**************************************************************/
2590 /**************************************************************/
2591 /* Int_LowHigh_0 Description - Reg Addr --> 0x5a, Bit --> 0...7 */
2592 #define BMI160_USER_INTR_LOWHIGH_0_INTR_LOW_DURN__POS (0)
2593 #define BMI160_USER_INTR_LOWHIGH_0_INTR_LOW_DURN__LEN (8)
2594 #define BMI160_USER_INTR_LOWHIGH_0_INTR_LOW_DURN__MSK (0xFF)
2595 #define BMI160_USER_INTR_LOWHIGH_0_INTR_LOW_DURN__REG \
2596  (BMI160_USER_INTR_LOWHIGH_0_ADDR)
2597 /**************************************************************/
2599 /**************************************************************/
2600 /* Int_LowHigh_1 Description - Reg Addr --> 0x5b, Bit --> 0...7 */
2601 #define BMI160_USER_INTR_LOWHIGH_1_INTR_LOW_THRES__POS (0)
2602 #define BMI160_USER_INTR_LOWHIGH_1_INTR_LOW_THRES__LEN (8)
2603 #define BMI160_USER_INTR_LOWHIGH_1_INTR_LOW_THRES__MSK (0xFF)
2604 #define BMI160_USER_INTR_LOWHIGH_1_INTR_LOW_THRES__REG \
2605  (BMI160_USER_INTR_LOWHIGH_1_ADDR)
2606 /**************************************************************/
2608 /**************************************************************/
2609 /* Int_LowHigh_2 Description - Reg Addr --> 0x5c, Bit --> 0...1 */
2610 #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_HYST__POS (0)
2611 #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_HYST__LEN (2)
2612 #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_HYST__MSK (0x03)
2613 #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_HYST__REG \
2614  (BMI160_USER_INTR_LOWHIGH_2_ADDR)
2615 /**************************************************************/
2617 /**************************************************************/
2618 /* Int_LowHigh_2 Description - Reg Addr --> 0x5c, Bit --> 2 */
2619 #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_MODE__POS (2)
2620 #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_MODE__LEN (1)
2621 #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_MODE__MSK (0x04)
2622 #define BMI160_USER_INTR_LOWHIGH_2_INTR_LOW_G_MODE__REG \
2623  (BMI160_USER_INTR_LOWHIGH_2_ADDR)
2624 /**************************************************************/
2626 /**************************************************************/
2627 /* Int_LowHigh_2 Description - Reg Addr --> 0x5c, Bit --> 6...7 */
2628 #define BMI160_USER_INTR_LOWHIGH_2_INTR_HIGH_G_HYST__POS (6)
2629 #define BMI160_USER_INTR_LOWHIGH_2_INTR_HIGH_G_HYST__LEN (2)
2630 #define BMI160_USER_INTR_LOWHIGH_2_INTR_HIGH_G_HYST__MSK (0xC0)
2631 #define BMI160_USER_INTR_LOWHIGH_2_INTR_HIGH_G_HYST__REG \
2632  (BMI160_USER_INTR_LOWHIGH_2_ADDR)
2633 /**************************************************************/
2635 /**************************************************************/
2636 /* Int_LowHigh_3 Description - Reg Addr --> 0x5d, Bit --> 0...7 */
2637 #define BMI160_USER_INTR_LOWHIGH_3_INTR_HIGH_G_DURN__POS (0)
2638 #define BMI160_USER_INTR_LOWHIGH_3_INTR_HIGH_G_DURN__LEN (8)
2639 #define BMI160_USER_INTR_LOWHIGH_3_INTR_HIGH_G_DURN__MSK (0xFF)
2640 #define BMI160_USER_INTR_LOWHIGH_3_INTR_HIGH_G_DURN__REG \
2641  (BMI160_USER_INTR_LOWHIGH_3_ADDR)
2642 /**************************************************************/
2644 /**************************************************************/
2645 /* Int_LowHigh_4 Description - Reg Addr --> 0x5e, Bit --> 0...7 */
2646 #define BMI160_USER_INTR_LOWHIGH_4_INTR_HIGH_THRES__POS (0)
2647 #define BMI160_USER_INTR_LOWHIGH_4_INTR_HIGH_THRES__LEN (8)
2648 #define BMI160_USER_INTR_LOWHIGH_4_INTR_HIGH_THRES__MSK (0xFF)
2649 #define BMI160_USER_INTR_LOWHIGH_4_INTR_HIGH_THRES__REG \
2650  (BMI160_USER_INTR_LOWHIGH_4_ADDR)
2651 /**************************************************************/
2653 /**************************************************************/
2654 /* Int_Motion_0 Description - Reg Addr --> 0x5f, Bit --> 0...1 */
2655 #define BMI160_USER_INTR_MOTION_0_INTR_ANY_MOTION_DURN__POS (0)
2656 #define BMI160_USER_INTR_MOTION_0_INTR_ANY_MOTION_DURN__LEN (2)
2657 #define BMI160_USER_INTR_MOTION_0_INTR_ANY_MOTION_DURN__MSK (0x03)
2658 #define BMI160_USER_INTR_MOTION_0_INTR_ANY_MOTION_DURN__REG \
2659  (BMI160_USER_INTR_MOTION_0_ADDR)
2660 /**************************************************************/
2662 /**************************************************************/
2663  /* Int_Motion_0 Description - Reg Addr --> 0x5f, Bit --> 2...7 */
2664 #define BMI160_USER_INTR_MOTION_0_INTR_SLOW_NO_MOTION_DURN__POS (2)
2665 #define BMI160_USER_INTR_MOTION_0_INTR_SLOW_NO_MOTION_DURN__LEN (6)
2666 #define BMI160_USER_INTR_MOTION_0_INTR_SLOW_NO_MOTION_DURN__MSK (0xFC)
2667 #define BMI160_USER_INTR_MOTION_0_INTR_SLOW_NO_MOTION_DURN__REG \
2668  (BMI160_USER_INTR_MOTION_0_ADDR)
2669 /**************************************************************/
2671 /**************************************************************/
2672 /* Int_Motion_1 Description - Reg Addr --> (0x60), Bit --> 0...7 */
2673 #define BMI160_USER_INTR_MOTION_1_INTR_ANY_MOTION_THRES__POS (0)
2674 #define BMI160_USER_INTR_MOTION_1_INTR_ANY_MOTION_THRES__LEN (8)
2675 #define BMI160_USER_INTR_MOTION_1_INTR_ANY_MOTION_THRES__MSK (0xFF)
2676 #define BMI160_USER_INTR_MOTION_1_INTR_ANY_MOTION_THRES__REG \
2677  (BMI160_USER_INTR_MOTION_1_ADDR)
2678 /**************************************************************/
2680 /**************************************************************/
2681 /* Int_Motion_2 Description - Reg Addr --> 0x61, Bit --> 0...7 */
2682 #define BMI160_USER_INTR_MOTION_2_INTR_SLOW_NO_MOTION_THRES__POS (0)
2683 #define BMI160_USER_INTR_MOTION_2_INTR_SLOW_NO_MOTION_THRES__LEN (8)
2684 #define BMI160_USER_INTR_MOTION_2_INTR_SLOW_NO_MOTION_THRES__MSK (0xFF)
2685 #define BMI160_USER_INTR_MOTION_2_INTR_SLOW_NO_MOTION_THRES__REG \
2686  (BMI160_USER_INTR_MOTION_2_ADDR)
2687 /**************************************************************/
2689 /**************************************************************/
2690 /* Int_Motion_3 Description - Reg Addr --> (0x62), Bit --> 0 */
2691 #define BMI160_USER_INTR_MOTION_3_INTR_SLOW_NO_MOTION_SELECT__POS (0)
2692 #define BMI160_USER_INTR_MOTION_3_INTR_SLOW_NO_MOTION_SELECT__LEN (1)
2693 #define BMI160_USER_INTR_MOTION_3_INTR_SLOW_NO_MOTION_SELECT__MSK (0x01)
2694 #define BMI160_USER_INTR_MOTION_3_INTR_SLOW_NO_MOTION_SELECT__REG \
2695 (BMI160_USER_INTR_MOTION_3_ADDR)
2696 /**************************************************************/
2698 /**************************************************************/
2699 /* Int_Motion_3 Description - Reg Addr --> (0x62), Bit --> 1 */
2700 #define BMI160_USER_INTR_SIGNIFICATION_MOTION_SELECT__POS (1)
2701 #define BMI160_USER_INTR_SIGNIFICATION_MOTION_SELECT__LEN (1)
2702 #define BMI160_USER_INTR_SIGNIFICATION_MOTION_SELECT__MSK (0x02)
2703 #define BMI160_USER_INTR_SIGNIFICATION_MOTION_SELECT__REG \
2704  (BMI160_USER_INTR_MOTION_3_ADDR)
2706 /* Int_Motion_3 Description - Reg Addr --> (0x62), Bit --> 3..2 */
2707 #define BMI160_USER_INTR_SIGNIFICANT_MOTION_SKIP__POS (2)
2708 #define BMI160_USER_INTR_SIGNIFICANT_MOTION_SKIP__LEN (2)
2709 #define BMI160_USER_INTR_SIGNIFICANT_MOTION_SKIP__MSK (0x0C)
2710 #define BMI160_USER_INTR_SIGNIFICANT_MOTION_SKIP__REG \
2711  (BMI160_USER_INTR_MOTION_3_ADDR)
2713 /* Int_Motion_3 Description - Reg Addr --> (0x62), Bit --> 5..4 */
2714 #define BMI160_USER_INTR_SIGNIFICANT_MOTION_PROOF__POS (4)
2715 #define BMI160_USER_INTR_SIGNIFICANT_MOTION_PROOF__LEN (2)
2716 #define BMI160_USER_INTR_SIGNIFICANT_MOTION_PROOF__MSK (0x30)
2717 #define BMI160_USER_INTR_SIGNIFICANT_MOTION_PROOF__REG \
2718  (BMI160_USER_INTR_MOTION_3_ADDR)
2719 /**************************************************************/
2721 /**************************************************************/
2722 /* INT_TAP_0 Description - Reg Addr --> (0x63), Bit --> 0..2*/
2723 #define BMI160_USER_INTR_TAP_0_INTR_TAP_DURN__POS (0)
2724 #define BMI160_USER_INTR_TAP_0_INTR_TAP_DURN__LEN (3)
2725 #define BMI160_USER_INTR_TAP_0_INTR_TAP_DURN__MSK (0x07)
2726 #define BMI160_USER_INTR_TAP_0_INTR_TAP_DURN__REG \
2727 (BMI160_USER_INTR_TAP_0_ADDR)
2728 /**************************************************************/
2730 /**************************************************************/
2731 /* Int_Tap_0 Description - Reg Addr --> (0x63), Bit --> 6 */
2732 #define BMI160_USER_INTR_TAP_0_INTR_TAP_SHOCK__POS (6)
2733 #define BMI160_USER_INTR_TAP_0_INTR_TAP_SHOCK__LEN (1)
2734 #define BMI160_USER_INTR_TAP_0_INTR_TAP_SHOCK__MSK (0x40)
2735 #define BMI160_USER_INTR_TAP_0_INTR_TAP_SHOCK__REG (BMI160_USER_INTR_TAP_0_ADDR)
2736 /**************************************************************/
2738 /**************************************************************/
2739 /* Int_Tap_0 Description - Reg Addr --> (0x63), Bit --> 7 */
2740 #define BMI160_USER_INTR_TAP_0_INTR_TAP_QUIET__POS (7)
2741 #define BMI160_USER_INTR_TAP_0_INTR_TAP_QUIET__LEN (1)
2742 #define BMI160_USER_INTR_TAP_0_INTR_TAP_QUIET__MSK (0x80)
2743 #define BMI160_USER_INTR_TAP_0_INTR_TAP_QUIET__REG (BMI160_USER_INTR_TAP_0_ADDR)
2744 /**************************************************************/
2746 /**************************************************************/
2747 /* Int_Tap_1 Description - Reg Addr --> (0x64), Bit --> 0...4 */
2748 #define BMI160_USER_INTR_TAP_1_INTR_TAP_THRES__POS (0)
2749 #define BMI160_USER_INTR_TAP_1_INTR_TAP_THRES__LEN (5)
2750 #define BMI160_USER_INTR_TAP_1_INTR_TAP_THRES__MSK (0x1F)
2751 #define BMI160_USER_INTR_TAP_1_INTR_TAP_THRES__REG (BMI160_USER_INTR_TAP_1_ADDR)
2752 /**************************************************************/
2754 /**************************************************************/
2755 /* Int_Orient_0 Description - Reg Addr --> (0x65), Bit --> 0...1 */
2756 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_MODE__POS (0)
2757 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_MODE__LEN (2)
2758 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_MODE__MSK (0x03)
2759 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_MODE__REG \
2760  (BMI160_USER_INTR_ORIENT_0_ADDR)
2761 /**************************************************************/
2763 /**************************************************************/
2764 /* Int_Orient_0 Description - Reg Addr --> (0x65), Bit --> 2...3 */
2765 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_BLOCKING__POS (2)
2766 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_BLOCKING__LEN (2)
2767 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_BLOCKING__MSK (0x0C)
2768 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_BLOCKING__REG \
2769  (BMI160_USER_INTR_ORIENT_0_ADDR)
2770 /**************************************************************/
2772 /**************************************************************/
2773 /* Int_Orient_0 Description - Reg Addr --> (0x65), Bit --> 4...7 */
2774 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_HYST__POS (4)
2775 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_HYST__LEN (4)
2776 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_HYST__MSK (0xF0)
2777 #define BMI160_USER_INTR_ORIENT_0_INTR_ORIENT_HYST__REG \
2778  (BMI160_USER_INTR_ORIENT_0_ADDR)
2779 /**************************************************************/
2781 /**************************************************************/
2782 /* Int_Orient_1 Description - Reg Addr --> 0x66, Bit --> 0...5 */
2783 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_THETA__POS (0)
2784 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_THETA__LEN (6)
2785 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_THETA__MSK (0x3F)
2786 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_THETA__REG \
2787  (BMI160_USER_INTR_ORIENT_1_ADDR)
2788 /**************************************************************/
2790 /**************************************************************/
2791 /* Int_Orient_1 Description - Reg Addr --> 0x66, Bit --> 6 */
2792 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_UD_ENABLE__POS (6)
2793 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_UD_ENABLE__LEN (1)
2794 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_UD_ENABLE__MSK (0x40)
2795 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_UD_ENABLE__REG \
2796  (BMI160_USER_INTR_ORIENT_1_ADDR)
2797 /**************************************************************/
2799 /**************************************************************/
2800 /* Int_Orient_1 Description - Reg Addr --> 0x66, Bit --> 7 */
2801 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_AXES_EX__POS (7)
2802 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_AXES_EX__LEN (1)
2803 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_AXES_EX__MSK (0x80)
2804 #define BMI160_USER_INTR_ORIENT_1_INTR_ORIENT_AXES_EX__REG \
2805  (BMI160_USER_INTR_ORIENT_1_ADDR)
2806 /**************************************************************/
2808 /**************************************************************/
2809 /* Int_Flat_0 Description - Reg Addr --> 0x67, Bit --> 0...5 */
2810 #define BMI160_USER_INTR_FLAT_0_INTR_FLAT_THETA__POS (0)
2811 #define BMI160_USER_INTR_FLAT_0_INTR_FLAT_THETA__LEN (6)
2812 #define BMI160_USER_INTR_FLAT_0_INTR_FLAT_THETA__MSK (0x3F)
2813 #define BMI160_USER_INTR_FLAT_0_INTR_FLAT_THETA__REG \
2814  (BMI160_USER_INTR_FLAT_0_ADDR)
2815 /**************************************************************/
2817 /**************************************************************/
2818 /* Int_Flat_1 Description - Reg Addr --> (0x68), Bit --> 0...3 */
2819 #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HYST__POS (0)
2820 #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HYST__LEN (4)
2821 #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HYST__MSK (0x0F)
2822 #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HYST__REG \
2823 (BMI160_USER_INTR_FLAT_1_ADDR)
2824 /**************************************************************/
2826 /**************************************************************/
2827 /* Int_Flat_1 Description - Reg Addr --> (0x68), Bit --> 4...5 */
2828 #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HOLD__POS (4)
2829 #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HOLD__LEN (2)
2830 #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HOLD__MSK (0x30)
2831 #define BMI160_USER_INTR_FLAT_1_INTR_FLAT_HOLD__REG \
2832 (BMI160_USER_INTR_FLAT_1_ADDR)
2833 /**************************************************************/
2835 /**************************************************************/
2836 /* Foc_Conf Description - Reg Addr --> (0x69), Bit --> 0...1 */
2837 #define BMI160_USER_FOC_ACCEL_Z__POS (0)
2838 #define BMI160_USER_FOC_ACCEL_Z__LEN (2)
2839 #define BMI160_USER_FOC_ACCEL_Z__MSK (0x03)
2840 #define BMI160_USER_FOC_ACCEL_Z__REG (BMI160_USER_FOC_CONFIG_ADDR)
2842 /* Foc_Conf Description - Reg Addr --> (0x69), Bit --> 2...3 */
2843 #define BMI160_USER_FOC_ACCEL_Y__POS (2)
2844 #define BMI160_USER_FOC_ACCEL_Y__LEN (2)
2845 #define BMI160_USER_FOC_ACCEL_Y__MSK (0x0C)
2846 #define BMI160_USER_FOC_ACCEL_Y__REG (BMI160_USER_FOC_CONFIG_ADDR)
2848 /* Foc_Conf Description - Reg Addr --> (0x69), Bit --> 4...5 */
2849 #define BMI160_USER_FOC_ACCEL_X__POS (4)
2850 #define BMI160_USER_FOC_ACCEL_X__LEN (2)
2851 #define BMI160_USER_FOC_ACCEL_X__MSK (0x30)
2852 #define BMI160_USER_FOC_ACCEL_X__REG (BMI160_USER_FOC_CONFIG_ADDR)
2853 /**************************************************************/
2855 /**************************************************************/
2856 /* Foc_Conf Description - Reg Addr --> (0x69), Bit --> 6 */
2857 #define BMI160_USER_FOC_GYRO_ENABLE__POS (6)
2858 #define BMI160_USER_FOC_GYRO_ENABLE__LEN (1)
2859 #define BMI160_USER_FOC_GYRO_ENABLE__MSK (0x40)
2860 #define BMI160_USER_FOC_GYRO_ENABLE__REG \
2861 (BMI160_USER_FOC_CONFIG_ADDR)
2862 /**************************************************************/
2864 /**************************************************************/
2865 /* CONF Description - Reg Addr --> (0x6A), Bit --> 1 */
2866 #define BMI160_USER_CONFIG_NVM_PROG_ENABLE__POS (1)
2867 #define BMI160_USER_CONFIG_NVM_PROG_ENABLE__LEN (1)
2868 #define BMI160_USER_CONFIG_NVM_PROG_ENABLE__MSK (0x02)
2869 #define BMI160_USER_CONFIG_NVM_PROG_ENABLE__REG \
2870 (BMI160_USER_CONFIG_ADDR)
2872 /*IF_CONF Description - Reg Addr --> (0x6B), Bit --> 0 */
2873 
2874 #define BMI160_USER_IF_CONFIG_SPI3__POS (0)
2875 #define BMI160_USER_IF_CONFIG_SPI3__LEN (1)
2876 #define BMI160_USER_IF_CONFIG_SPI3__MSK (0x01)
2877 #define BMI160_USER_IF_CONFIG_SPI3__REG \
2878 (BMI160_USER_IF_CONFIG_ADDR)
2880 /*IF_CONF Description - Reg Addr --> (0x6B), Bit --> 5..4 */
2881 #define BMI160_USER_IF_CONFIG_IF_MODE__POS (4)
2882 #define BMI160_USER_IF_CONFIG_IF_MODE__LEN (2)
2883 #define BMI160_USER_IF_CONFIG_IF_MODE__MSK (0x30)
2884 #define BMI160_USER_IF_CONFIG_IF_MODE__REG \
2885 (BMI160_USER_IF_CONFIG_ADDR)
2886 /**************************************************************/
2888 /**************************************************************/
2889 /* Pmu_Trigger Description - Reg Addr --> 0x6c, Bit --> 0...2 */
2890 #define BMI160_USER_GYRO_SLEEP_TRIGGER__POS (0)
2891 #define BMI160_USER_GYRO_SLEEP_TRIGGER__LEN (3)
2892 #define BMI160_USER_GYRO_SLEEP_TRIGGER__MSK (0x07)
2893 #define BMI160_USER_GYRO_SLEEP_TRIGGER__REG (BMI160_USER_PMU_TRIGGER_ADDR)
2895 /* Pmu_Trigger Description - Reg Addr --> 0x6c, Bit --> 3...4 */
2896 #define BMI160_USER_GYRO_WAKEUP_TRIGGER__POS (3)
2897 #define BMI160_USER_GYRO_WAKEUP_TRIGGER__LEN (2)
2898 #define BMI160_USER_GYRO_WAKEUP_TRIGGER__MSK (0x18)
2899 #define BMI160_USER_GYRO_WAKEUP_TRIGGER__REG (BMI160_USER_PMU_TRIGGER_ADDR)
2901 /* Pmu_Trigger Description - Reg Addr --> 0x6c, Bit --> 5 */
2902 #define BMI160_USER_GYRO_SLEEP_STATE__POS (5)
2903 #define BMI160_USER_GYRO_SLEEP_STATE__LEN (1)
2904 #define BMI160_USER_GYRO_SLEEP_STATE__MSK (0x20)
2905 #define BMI160_USER_GYRO_SLEEP_STATE__REG (BMI160_USER_PMU_TRIGGER_ADDR)
2907 /* Pmu_Trigger Description - Reg Addr --> 0x6c, Bit --> 6 */
2908 #define BMI160_USER_GYRO_WAKEUP_INTR__POS (6)
2909 #define BMI160_USER_GYRO_WAKEUP_INTR__LEN (1)
2910 #define BMI160_USER_GYRO_WAKEUP_INTR__MSK (0x40)
2911 #define BMI160_USER_GYRO_WAKEUP_INTR__REG (BMI160_USER_PMU_TRIGGER_ADDR)
2912 /**************************************************************/
2914 /**************************************************************/
2915 /* Self_Test Description - Reg Addr --> 0x6d, Bit --> 0...1 */
2916 #define BMI160_USER_ACCEL_SELFTEST_AXIS__POS (0)
2917 #define BMI160_USER_ACCEL_SELFTEST_AXIS__LEN (2)
2918 #define BMI160_USER_ACCEL_SELFTEST_AXIS__MSK (0x03)
2919 #define BMI160_USER_ACCEL_SELFTEST_AXIS__REG (BMI160_USER_SELF_TEST_ADDR)
2921 /* Self_Test Description - Reg Addr --> 0x6d, Bit --> 2 */
2922 #define BMI160_USER_ACCEL_SELFTEST_SIGN__POS (2)
2923 #define BMI160_USER_ACCEL_SELFTEST_SIGN__LEN (1)
2924 #define BMI160_USER_ACCEL_SELFTEST_SIGN__MSK (0x04)
2925 #define BMI160_USER_ACCEL_SELFTEST_SIGN__REG (BMI160_USER_SELF_TEST_ADDR)
2927 /* Self_Test Description - Reg Addr --> 0x6d, Bit --> 3 */
2928 #define BMI160_USER_SELFTEST_AMP__POS (3)
2929 #define BMI160_USER_SELFTEST_AMP__LEN (1)
2930 #define BMI160_USER_SELFTEST_AMP__MSK (0x08)
2931 #define BMI160_USER_SELFTEST_AMP__REG (BMI160_USER_SELF_TEST_ADDR)
2932 /**************************************************************/
2934 /**************************************************************/
2935 /* Self_Test Description - Reg Addr --> 0x6d, Bit --> 4 */
2936 #define BMI160_USER_GYRO_SELFTEST_START__POS (4)
2937 #define BMI160_USER_GYRO_SELFTEST_START__LEN (1)
2938 #define BMI160_USER_GYRO_SELFTEST_START__MSK (0x10)
2939 #define BMI160_USER_GYRO_SELFTEST_START__REG \
2940 (BMI160_USER_SELF_TEST_ADDR)
2941 /**************************************************************/
2943 /**************************************************************/
2944 /* NV_CONF Description - Reg Addr --> (0x70), Bit --> 0 */
2945 #define BMI160_USER_NV_CONFIG_SPI_ENABLE__POS (0)
2946 #define BMI160_USER_NV_CONFIG_SPI_ENABLE__LEN (1)
2947 #define BMI160_USER_NV_CONFIG_SPI_ENABLE__MSK (0x01)
2948 #define BMI160_USER_NV_CONFIG_SPI_ENABLE__REG (BMI160_USER_NV_CONFIG_ADDR)
2950 /*IF_CONF Description - Reg Addr --> (0x70), Bit --> 1 */
2951 #define BMI160_USER_IF_CONFIG_I2C_WDT_SELECT__POS (1)
2952 #define BMI160_USER_IF_CONFIG_I2C_WDT_SELECT__LEN (1)
2953 #define BMI160_USER_IF_CONFIG_I2C_WDT_SELECT__MSK (0x02)
2954 #define BMI160_USER_IF_CONFIG_I2C_WDT_SELECT__REG \
2955 (BMI160_USER_NV_CONFIG_ADDR)
2957 /*IF_CONF Description - Reg Addr --> (0x70), Bit --> 2 */
2958 #define BMI160_USER_IF_CONFIG_I2C_WDT_ENABLE__POS (2)
2959 #define BMI160_USER_IF_CONFIG_I2C_WDT_ENABLE__LEN (1)
2960 #define BMI160_USER_IF_CONFIG_I2C_WDT_ENABLE__MSK (0x04)
2961 #define BMI160_USER_IF_CONFIG_I2C_WDT_ENABLE__REG \
2962 (BMI160_USER_NV_CONFIG_ADDR)
2964 /* NV_CONF Description - Reg Addr --> (0x70), Bit --> 3 */
2965 #define BMI160_USER_NV_CONFIG_SPARE0__POS (3)
2966 #define BMI160_USER_NV_CONFIG_SPARE0__LEN (1)
2967 #define BMI160_USER_NV_CONFIG_SPARE0__MSK (0x08)
2968 #define BMI160_USER_NV_CONFIG_SPARE0__REG (BMI160_USER_NV_CONFIG_ADDR)
2970 /* NV_CONF Description - Reg Addr --> (0x70), Bit --> 4...7 */
2971 #define BMI160_USER_NV_CONFIG_NVM_COUNTER__POS (4)
2972 #define BMI160_USER_NV_CONFIG_NVM_COUNTER__LEN (4)
2973 #define BMI160_USER_NV_CONFIG_NVM_COUNTER__MSK (0xF0)
2974 #define BMI160_USER_NV_CONFIG_NVM_COUNTER__REG (BMI160_USER_NV_CONFIG_ADDR)
2975 /**************************************************************/
2977 /**************************************************************/
2978 /* Offset_0 Description - Reg Addr --> (0x71), Bit --> 0...7 */
2979 #define BMI160_USER_OFFSET_0_ACCEL_OFF_X__POS (0)
2980 #define BMI160_USER_OFFSET_0_ACCEL_OFF_X__LEN (8)
2981 #define BMI160_USER_OFFSET_0_ACCEL_OFF_X__MSK (0xFF)
2982 #define BMI160_USER_OFFSET_0_ACCEL_OFF_X__REG (BMI160_USER_OFFSET_0_ADDR)
2984 /* Offset_1 Description - Reg Addr --> 0x72, Bit --> 0...7 */
2985 #define BMI160_USER_OFFSET_1_ACCEL_OFF_Y__POS (0)
2986 #define BMI160_USER_OFFSET_1_ACCEL_OFF_Y__LEN (8)
2987 #define BMI160_USER_OFFSET_1_ACCEL_OFF_Y__MSK (0xFF)
2988 #define BMI160_USER_OFFSET_1_ACCEL_OFF_Y__REG (BMI160_USER_OFFSET_1_ADDR)
2990 /* Offset_2 Description - Reg Addr --> 0x73, Bit --> 0...7 */
2991 #define BMI160_USER_OFFSET_2_ACCEL_OFF_Z__POS (0)
2992 #define BMI160_USER_OFFSET_2_ACCEL_OFF_Z__LEN (8)
2993 #define BMI160_USER_OFFSET_2_ACCEL_OFF_Z__MSK (0xFF)
2994 #define BMI160_USER_OFFSET_2_ACCEL_OFF_Z__REG (BMI160_USER_OFFSET_2_ADDR)
2995 /**************************************************************/
2997 /**************************************************************/
2998 /* Offset_3 Description - Reg Addr --> 0x74, Bit --> 0...7 */
2999 #define BMI160_USER_OFFSET_3_GYRO_OFF_X__POS (0)
3000 #define BMI160_USER_OFFSET_3_GYRO_OFF_X__LEN (8)
3001 #define BMI160_USER_OFFSET_3_GYRO_OFF_X__MSK (0xFF)
3002 #define BMI160_USER_OFFSET_3_GYRO_OFF_X__REG (BMI160_USER_OFFSET_3_ADDR)
3004 /* Offset_4 Description - Reg Addr --> 0x75, Bit --> 0...7 */
3005 #define BMI160_USER_OFFSET_4_GYRO_OFF_Y__POS (0)
3006 #define BMI160_USER_OFFSET_4_GYRO_OFF_Y__LEN (8)
3007 #define BMI160_USER_OFFSET_4_GYRO_OFF_Y__MSK (0xFF)
3008 #define BMI160_USER_OFFSET_4_GYRO_OFF_Y__REG (BMI160_USER_OFFSET_4_ADDR)
3010 /* Offset_5 Description - Reg Addr --> 0x76, Bit --> 0...7 */
3011 #define BMI160_USER_OFFSET_5_GYRO_OFF_Z__POS (0)
3012 #define BMI160_USER_OFFSET_5_GYRO_OFF_Z__LEN (8)
3013 #define BMI160_USER_OFFSET_5_GYRO_OFF_Z__MSK (0xFF)
3014 #define BMI160_USER_OFFSET_5_GYRO_OFF_Z__REG (BMI160_USER_OFFSET_5_ADDR)
3017 /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 0..1 */
3018 #define BMI160_USER_OFFSET_6_GYRO_OFF_X__POS (0)
3019 #define BMI160_USER_OFFSET_6_GYRO_OFF_X__LEN (2)
3020 #define BMI160_USER_OFFSET_6_GYRO_OFF_X__MSK (0x03)
3021 #define BMI160_USER_OFFSET_6_GYRO_OFF_X__REG (BMI160_USER_OFFSET_6_ADDR)
3023 /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 2...3 */
3024 #define BMI160_USER_OFFSET_6_GYRO_OFF_Y__POS (2)
3025 #define BMI160_USER_OFFSET_6_GYRO_OFF_Y__LEN (2)
3026 #define BMI160_USER_OFFSET_6_GYRO_OFF_Y__MSK (0x0C)
3027 #define BMI160_USER_OFFSET_6_GYRO_OFF_Y__REG (BMI160_USER_OFFSET_6_ADDR)
3029 /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 4...5 */
3030 #define BMI160_USER_OFFSET_6_GYRO_OFF_Z__POS (4)
3031 #define BMI160_USER_OFFSET_6_GYRO_OFF_Z__LEN (2)
3032 #define BMI160_USER_OFFSET_6_GYRO_OFF_Z__MSK (0x30)
3033 #define BMI160_USER_OFFSET_6_GYRO_OFF_Z__REG (BMI160_USER_OFFSET_6_ADDR)
3034 /**************************************************************/
3036 /**************************************************************/
3037 /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 6 */
3038 #define BMI160_USER_OFFSET_6_ACCEL_OFF_ENABLE__POS (6)
3039 #define BMI160_USER_OFFSET_6_ACCEL_OFF_ENABLE__LEN (1)
3040 #define BMI160_USER_OFFSET_6_ACCEL_OFF_ENABLE__MSK (0x40)
3041 #define BMI160_USER_OFFSET_6_ACCEL_OFF_ENABLE__REG \
3042 (BMI160_USER_OFFSET_6_ADDR)
3043 /**************************************************************/
3045 /**************************************************************/
3046 /* Offset_6 Description - Reg Addr --> 0x77, Bit --> 7 */
3047 #define BMI160_USER_OFFSET_6_GYRO_OFF_EN__POS (7)
3048 #define BMI160_USER_OFFSET_6_GYRO_OFF_EN__LEN (1)
3049 #define BMI160_USER_OFFSET_6_GYRO_OFF_EN__MSK (0x80)
3050 #define BMI160_USER_OFFSET_6_GYRO_OFF_EN__REG (BMI160_USER_OFFSET_6_ADDR)
3051 /**************************************************************/
3053 /**************************************************************/
3054 /* STEP_CNT_0 Description - Reg Addr --> 0x78, Bit --> 0 to 7 */
3055 #define BMI160_USER_STEP_COUNT_LSB__POS (0)
3056 #define BMI160_USER_STEP_COUNT_LSB__LEN (7)
3057 #define BMI160_USER_STEP_COUNT_LSB__MSK (0xFF)
3058 #define BMI160_USER_STEP_COUNT_LSB__REG (BMI160_USER_STEP_COUNT_0_ADDR)
3060 /* STEP_CNT_1 Description - Reg Addr --> 0x79, Bit --> 0 to 7 */
3061 #define BMI160_USER_STEP_COUNT_MSB__POS (0)
3062 #define BMI160_USER_STEP_COUNT_MSB__LEN (7)
3063 #define BMI160_USER_STEP_COUNT_MSB__MSK (0xFF)
3064 #define BMI160_USER_STEP_COUNT_MSB__REG (BMI160_USER_STEP_COUNT_1_ADDR)
3065 /**************************************************************/
3067 /**************************************************************/
3068 /* STEP_CONFIG_0 Description - Reg Addr --> 0x7A, Bit --> 0 to 7 */
3069 #define BMI160_USER_STEP_CONFIG_ZERO__POS (0)
3070 #define BMI160_USER_STEP_CONFIG_ZERO__LEN (7)
3071 #define BMI160_USER_STEP_CONFIG_ZERO__MSK (0xFF)
3072 #define BMI160_USER_STEP_CONFIG_ZERO__REG \
3073 (BMI160_USER_STEP_CONFIG_0_ADDR)
3076 /* STEP_CONFIG_1 Description - Reg Addr --> 0x7B, Bit --> 0 to 2 and
3077 4 to 7 */
3078 #define BMI160_USER_STEP_CONFIG_ONE_CNF1__POS (0)
3079 #define BMI160_USER_STEP_CONFIG_ONE_CNF1__LEN (3)
3080 #define BMI160_USER_STEP_CONFIG_ONE_CNF1__MSK (0x07)
3081 #define BMI160_USER_STEP_CONFIG_ONE_CNF1__REG \
3082 (BMI160_USER_STEP_CONFIG_1_ADDR)
3084 #define BMI160_USER_STEP_CONFIG_ONE_CNF2__POS (4)
3085 #define BMI160_USER_STEP_CONFIG_ONE_CNF2__LEN (4)
3086 #define BMI160_USER_STEP_CONFIG_ONE_CNF2__MSK (0xF0)
3087 #define BMI160_USER_STEP_CONFIG_ONE_CNF2__REG \
3088 (BMI160_USER_STEP_CONFIG_1_ADDR)
3089 /**************************************************************/
3091 /**************************************************************/
3092 /* STEP_CONFIG_1 Description - Reg Addr --> 0x7B, Bit --> 0 to 2 */
3093 #define BMI160_USER_STEP_CONFIG_1_STEP_COUNT_ENABLE__POS (3)
3094 #define BMI160_USER_STEP_CONFIG_1_STEP_COUNT_ENABLE__LEN (1)
3095 #define BMI160_USER_STEP_CONFIG_1_STEP_COUNT_ENABLE__MSK (0x08)
3096 #define BMI160_USER_STEP_CONFIG_1_STEP_COUNT_ENABLE__REG \
3097 (BMI160_USER_STEP_CONFIG_1_ADDR)
3099 /* USER REGISTERS DEFINITION END */
3100 /**************************************************************************/
3101 /* CMD REGISTERS DEFINITION START */
3102 /**************************************************************/
3104 /**************************************************************/
3105 /* Command description address - Reg Addr --> 0x7E, Bit --> 0....7 */
3106 #define BMI160_CMD_COMMANDS__POS (0)
3107 #define BMI160_CMD_COMMANDS__LEN (8)
3108 #define BMI160_CMD_COMMANDS__MSK (0xFF)
3109 #define BMI160_CMD_COMMANDS__REG (BMI160_CMD_COMMANDS_ADDR)
3110 /**************************************************************/
3112 /**************************************************************/
3113 /* Target page address - Reg Addr --> 0x7F, Bit --> 4....5 */
3114 #define BMI160_CMD_TARGET_PAGE__POS (4)
3115 #define BMI160_CMD_TARGET_PAGE__LEN (2)
3116 #define BMI160_CMD_TARGET_PAGE__MSK (0x30)
3117 #define BMI160_CMD_TARGET_PAGE__REG (BMI160_CMD_EXT_MODE_ADDR)
3119 /* Target page address - Reg Addr --> 0x7F, Bit --> 4....5 */
3120 #define BMI160_CMD_PAGING_EN__POS (7)
3121 #define BMI160_CMD_PAGING_EN__LEN (1)
3122 #define BMI160_CMD_PAGING_EN__MSK (0x80)
3123 #define BMI160_CMD_PAGING_EN__REG (BMI160_CMD_EXT_MODE_ADDR)
3125 /* Target page address - Reg Addr --> 0x7F, Bit --> 4....5 */
3126 #define BMI160_COM_C_TRIM_FIVE__POS (0)
3127 #define BMI160_COM_C_TRIM_FIVE__LEN (8)
3128 #define BMI160_COM_C_TRIM_FIVE__MSK (0xFF)
3129 #define BMI160_COM_C_TRIM_FIVE__REG (BMI160_COM_C_TRIM_FIVE_ADDR)
3131 /**************************************************************************/
3132 /* CMD REGISTERS DEFINITION END */
3133 #ifdef FIFO_ENABLE
3134 /**************************************************/
3136 /*************************************************/
3137 #define FIFO_FRAME (512)
3138 #define FIFO_CONFIG_CHECK1 (0x00)
3139 #define FIFO_CONFIG_CHECK2 (0x80)
3140 #endif
3141 /**************************************************/
3143 /*************************************************/
3144 #define BST_BMM (0)
3145 #define BST_AKM (1)
3146 #define BMI160_YAS537_I2C_ADDRESS (0x2E)
3147 /**************************************************/
3149 /*************************************************/
3150 #define BMI160_ACCEL_RANGE_2G (0X03)
3151 #define BMI160_ACCEL_RANGE_4G (0X05)
3152 #define BMI160_ACCEL_RANGE_8G (0X08)
3153 #define BMI160_ACCEL_RANGE_16G (0X0C)
3154 /**************************************************/
3156 /*************************************************/
3157 #define BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED (0x00)
3158 #define BMI160_ACCEL_OUTPUT_DATA_RATE_0_78HZ (0x01)
3159 #define BMI160_ACCEL_OUTPUT_DATA_RATE_1_56HZ (0x02)
3160 #define BMI160_ACCEL_OUTPUT_DATA_RATE_3_12HZ (0x03)
3161 #define BMI160_ACCEL_OUTPUT_DATA_RATE_6_25HZ (0x04)
3162 #define BMI160_ACCEL_OUTPUT_DATA_RATE_12_5HZ (0x05)
3163 #define BMI160_ACCEL_OUTPUT_DATA_RATE_25HZ (0x06)
3164 #define BMI160_ACCEL_OUTPUT_DATA_RATE_50HZ (0x07)
3165 #define BMI160_ACCEL_OUTPUT_DATA_RATE_100HZ (0x08)
3166 #define BMI160_ACCEL_OUTPUT_DATA_RATE_200HZ (0x09)
3167 #define BMI160_ACCEL_OUTPUT_DATA_RATE_400HZ (0x0A)
3168 #define BMI160_ACCEL_OUTPUT_DATA_RATE_800HZ (0x0B)
3169 #define BMI160_ACCEL_OUTPUT_DATA_RATE_1600HZ (0x0C)
3170 #define BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED0 (0x0D)
3171 #define BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED1 (0x0E)
3172 #define BMI160_ACCEL_OUTPUT_DATA_RATE_RESERVED2 (0x0F)
3173 /**************************************************/
3175 /*************************************************/
3176 #define BMI160_ACCEL_OSR4_AVG1 (0)
3177 #define BMI160_ACCEL_OSR2_AVG2 (1)
3178 #define BMI160_ACCEL_NORMAL_AVG4 (2)
3179 #define BMI160_ACCEL_CIC_AVG8 (3)
3180 #define BMI160_ACCEL_RES_AVG2 (4)
3181 #define BMI160_ACCEL_RES_AVG4 (5)
3182 #define BMI160_ACCEL_RES_AVG8 (6)
3183 #define BMI160_ACCEL_RES_AVG16 (7)
3184 #define BMI160_ACCEL_RES_AVG32 (8)
3185 #define BMI160_ACCEL_RES_AVG64 (9)
3186 #define BMI160_ACCEL_RES_AVG128 (10)
3188 #define BMI160_US_DISABLE (0)
3189 #define BMI160_US_ENABLE (1)
3190 /**************************************************/
3192 /*************************************************/
3193 #define BMI160_GYRO_OUTPUT_DATA_RATE_RESERVED (0x00)
3194 #define BMI160_GYRO_OUTPUT_DATA_RATE_25HZ (0x06)
3195 #define BMI160_GYRO_OUTPUT_DATA_RATE_50HZ (0x07)
3196 #define BMI160_GYRO_OUTPUT_DATA_RATE_100HZ (0x08)
3197 #define BMI160_GYRO_OUTPUT_DATA_RATE_200HZ (0x09)
3198 #define BMI160_GYRO_OUTPUT_DATA_RATE_400HZ (0x0A)
3199 #define BMI160_GYRO_OUTPUT_DATA_RATE_800HZ (0x0B)
3200 #define BMI160_GYRO_OUTPUT_DATA_RATE_1600HZ (0x0C)
3201 #define BMI160_GYRO_OUTPUT_DATA_RATE_3200HZ (0x0D)
3202 /**************************************************/
3204 /*************************************************/
3205 #define BMI160_GYRO_OSR4_MODE (0x00)
3206 #define BMI160_GYRO_OSR2_MODE (0x01)
3207 #define BMI160_GYRO_NORMAL_MODE (0x02)
3208 #define BMI160_GYRO_CIC_MODE (0x03)
3209 /**************************************************/
3211 /*************************************************/
3212 #define BMI160_GYRO_RANGE_2000_DEG_SEC (0x00)
3213 #define BMI160_GYRO_RANGE_1000_DEG_SEC (0x01)
3214 #define BMI160_GYRO_RANGE_500_DEG_SEC (0x02)
3215 #define BMI160_GYRO_RANGE_250_DEG_SEC (0x03)
3216 #define BMI160_GYRO_RANGE_125_DEG_SEC (0x04)
3217 /**************************************************/
3219 /*************************************************/
3220 #define BMI160_MAG_OUTPUT_DATA_RATE_RESERVED (0x00)
3221 #define BMI160_MAG_OUTPUT_DATA_RATE_0_78HZ (0x01)
3222 #define BMI160_MAG_OUTPUT_DATA_RATE_1_56HZ (0x02)
3223 #define BMI160_MAG_OUTPUT_DATA_RATE_3_12HZ (0x03)
3224 #define BMI160_MAG_OUTPUT_DATA_RATE_6_25HZ (0x04)
3225 #define BMI160_MAG_OUTPUT_DATA_RATE_12_5HZ (0x05)
3226 #define BMI160_MAG_OUTPUT_DATA_RATE_25HZ (0x06)
3227 #define BMI160_MAG_OUTPUT_DATA_RATE_50HZ (0x07)
3228 #define BMI160_MAG_OUTPUT_DATA_RATE_100HZ (0x08)
3229 #define BMI160_MAG_OUTPUT_DATA_RATE_200HZ (0x09)
3230 #define BMI160_MAG_OUTPUT_DATA_RATE_400HZ (0x0A)
3231 #define BMI160_MAG_OUTPUT_DATA_RATE_800HZ (0x0B)
3232 #define BMI160_MAG_OUTPUT_DATA_RATE_1600HZ (0x0C)
3233 #define BMI160_MAG_OUTPUT_DATA_RATE_RESERVED0 (0x0D)
3234 #define BMI160_MAG_OUTPUT_DATA_RATE_RESERVED1 (0x0E)
3235 #define BMI160_MAG_OUTPUT_DATA_RATE_RESERVED2 (0x0F)
3237 /**************************************************/
3239 /*************************************************/
3240 
3241 /* Enable accel and gyro offset */
3242 #define ACCEL_OFFSET_ENABLE (0x01)
3243 #define GYRO_OFFSET_ENABLE (0x01)
3244 
3245 /* command register definition */
3246 #define START_FOC_ACCEL_GYRO (0X03)
3247 
3248  /* INT ENABLE 1 */
3249 #define BMI160_ANY_MOTION_X_ENABLE (0)
3250 #define BMI160_ANY_MOTION_Y_ENABLE (1)
3251 #define BMI160_ANY_MOTION_Z_ENABLE (2)
3252 #define BMI160_DOUBLE_TAP_ENABLE (4)
3253 #define BMI160_SINGLE_TAP_ENABLE (5)
3254 #define BMI160_ORIENT_ENABLE (6)
3255 #define BMI160_FLAT_ENABLE (7)
3257 /* INT ENABLE 1 */
3258 #define BMI160_HIGH_G_X_ENABLE (0)
3259 #define BMI160_HIGH_G_Y_ENABLE (1)
3260 #define BMI160_HIGH_G_Z_ENABLE (2)
3261 #define BMI160_LOW_G_ENABLE (3)
3262 #define BMI160_DATA_RDY_ENABLE (4)
3263 #define BMI160_FIFO_FULL_ENABLE (5)
3264 #define BMI160_FIFO_WM_ENABLE (6)
3266 /* INT ENABLE 2 */
3267 #define BMI160_NOMOTION_X_ENABLE (0)
3268 #define BMI160_NOMOTION_Y_ENABLE (1)
3269 #define BMI160_NOMOTION_Z_ENABLE (2)
3271 /* FOC axis selection for accel*/
3272 #define FOC_X_AXIS (0)
3273 #define FOC_Y_AXIS (1)
3274 #define FOC_Z_AXIS (2)
3276 /* IN OUT CONTROL */
3277 #define BMI160_INTR1_EDGE_CTRL (0)
3278 #define BMI160_INTR2_EDGE_CTRL (1)
3279 #define BMI160_INTR1_LEVEL (0)
3280 #define BMI160_INTR2_LEVEL (1)
3281 #define BMI160_INTR1_OUTPUT_TYPE (0)
3282 #define BMI160_INTR2_OUTPUT_TYPE (1)
3283 #define BMI160_INTR1_OUTPUT_ENABLE (0)
3284 #define BMI160_INTR2_OUTPUT_ENABLE (1)
3286 #define BMI160_INTR1_INPUT_ENABLE (0)
3287 #define BMI160_INTR2_INPUT_ENABLE (1)
3288 
3289 /* INTERRUPT MAPS */
3290 #define BMI160_INTR1_MAP_LOW_G (0)
3291 #define BMI160_INTR2_MAP_LOW_G (1)
3292 #define BMI160_INTR1_MAP_HIGH_G (0)
3293 #define BMI160_INTR2_MAP_HIGH_G (1)
3294 #define BMI160_INTR1_MAP_ANY_MOTION (0)
3295 #define BMI160_INTR2_MAP_ANY_MOTION (1)
3296 #define BMI160_INTR1_MAP_NOMO (0)
3297 #define BMI160_INTR2_MAP_NOMO (1)
3298 #define BMI160_INTR1_MAP_DOUBLE_TAP (0)
3299 #define BMI160_INTR2_MAP_DOUBLE_TAP (1)
3300 #define BMI160_INTR1_MAP_SINGLE_TAP (0)
3301 #define BMI160_INTR2_MAP_SINGLE_TAP (1)
3302 #define BMI160_INTR1_MAP_ORIENT (0)
3303 #define BMI160_INTR2_MAP_ORIENT (1)
3304 #define BMI160_INTR1_MAP_FLAT (0)
3305 #define BMI160_INTR2_MAP_FLAT (1)
3306 #define BMI160_INTR1_MAP_DATA_RDY (0)
3307 #define BMI160_INTR2_MAP_DATA_RDY (1)
3308 #define BMI160_INTR1_MAP_FIFO_WM (0)
3309 #define BMI160_INTR2_MAP_FIFO_WM (1)
3310 #define BMI160_INTR1_MAP_FIFO_FULL (0)
3311 #define BMI160_INTR2_MAP_FIFO_FULL (1)
3312 #define BMI160_INTR1_MAP_PMUTRIG (0)
3313 #define BMI160_INTR2_MAP_PMUTRIG (1)
3315 /* Interrupt mapping*/
3316 #define BMI160_MAP_INTR1 (0)
3317 #define BMI160_MAP_INTR2 (1)
3318 /**************************************************/
3320 /*************************************************/
3321 #define BMI160_TAP_DURN_50MS (0x00)
3322 #define BMI160_TAP_DURN_100MS (0x01)
3323 #define BMI160_TAP_DURN_150MS (0x02)
3324 #define BMI160_TAP_DURN_200MS (0x03)
3325 #define BMI160_TAP_DURN_250MS (0x04)
3326 #define BMI160_TAP_DURN_375MS (0x05)
3327 #define BMI160_TAP_DURN_500MS (0x06)
3328 #define BMI160_TAP_DURN_700MS (0x07)
3329 /**************************************************/
3331 /*************************************************/
3332 #define BMI160_TAP_SHOCK_50MS (0x00)
3333 #define BMI160_TAP_SHOCK_75MS (0x01)
3334 /**************************************************/
3336 /*************************************************/
3337 #define BMI160_TAP_QUIET_30MS (0x00)
3338 #define BMI160_TAP_QUIET_20MS (0x01)
3339 /**************************************************/
3341 /*************************************************/
3342 #define BMI160_STEP_NORMAL_MODE (0)
3343 #define BMI160_STEP_SENSITIVE_MODE (1)
3344 #define BMI160_STEP_ROBUST_MODE (2)
3345 /**************************************************/
3347 /*************************************************/
3348 #define STEP_CONFIG_NORMAL (0X315)
3349 #define STEP_CONFIG_SENSITIVE (0X2D)
3350 #define STEP_CONFIG_ROBUST (0X71D)
3351 /**************************************************/
3353 /*************************************************/
3354 #define BMI160_MAG_DIG_X1 (0x5D)
3355 #define BMI160_MAG_DIG_Y1 (0x5E)
3356 #define BMI160_MAG_DIG_Z4_LSB (0x62)
3357 #define BMI160_MAG_DIG_Z4_MSB (0x63)
3358 #define BMI160_MAG_DIG_X2 (0x64)
3359 #define BMI160_MAG_DIG_Y2 (0x65)
3360 #define BMI160_MAG_DIG_Z2_LSB (0x68)
3361 #define BMI160_MAG_DIG_Z2_MSB (0x69)
3362 #define BMI160_MAG_DIG_Z1_LSB (0x6A)
3363 #define BMI160_MAG_DIG_Z1_MSB (0x6B)
3364 #define BMI160_MAG_DIG_XYZ1_LSB (0x6C)
3365 #define BMI160_MAG_DIG_XYZ1_MSB (0x6D)
3366 #define BMI160_MAG_DIG_Z3_LSB (0x6E)
3367 #define BMI160_MAG_DIG_Z3_MSB (0x6F)
3368 #define BMI160_MAG_DIG_XY2 (0x70)
3369 #define BMI160_MAG_DIG_XY1 (0x71)
3370 /**************************************************/
3372 /*************************************************/
3373 #define BMI160_MAG_PRESETMODE_LOWPOWER (1)
3374 #define BMI160_MAG_PRESETMODE_REGULAR (2)
3375 #define BMI160_MAG_PRESETMODE_HIGHACCURACY (3)
3376 #define BMI160_MAG_PRESETMODE_ENHANCED (4)
3377 /**************************************************/
3379 /*************************************************/
3380 #define BMI160_MAG_LOWPOWER_DR (0x02)
3381 #define BMI160_MAG_REGULAR_DR (0x02)
3382 #define BMI160_MAG_HIGHACCURACY_DR (0x2A)
3383 #define BMI160_MAG_ENHANCED_DR (0x02)
3384 /**************************************************/
3386 /*************************************************/
3387 #define BMI160_MAG_LOWPOWER_REPXY (1)
3388 #define BMI160_MAG_REGULAR_REPXY (4)
3389 #define BMI160_MAG_HIGHACCURACY_REPXY (23)
3390 #define BMI160_MAG_ENHANCED_REPXY (7)
3391 /**************************************************/
3393 /*************************************************/
3394 #define BMI160_MAG_LOWPOWER_REPZ (2)
3395 #define BMI160_MAG_REGULAR_REPZ (14)
3396 #define BMI160_MAG_HIGHACCURACY_REPZ (82)
3397 #define BMI160_MAG_ENHANCED_REPZ (26)
3398 #define BMI160_MAG_NOAMRL_SWITCH_TIMES (5)
3399 #define MAG_INTERFACE_PMU_ENABLE (1)
3400 #define MAG_INTERFACE_PMU_DISABLE (0)
3401 /**************************************************/
3403 /*************************************************/
3404 #define BMI160_MAG_OVERFLOW_OUTPUT ((s16)-32768)
3405 #define BMI160_MAG_OVERFLOW_OUTPUT_S32 ((s32)(-2147483647-1))
3406 #define BMI160_MAG_NEGATIVE_SATURATION_Z ((s16)-32767)
3407 #define BMI160_MAG_POSITIVE_SATURATION_Z ((u16)32767)
3408 #define BMI160_MAG_FLIP_OVERFLOW_ADCVAL ((s16)-4096)
3409 #define BMI160_MAG_HALL_OVERFLOW_ADCVAL ((s16)-16384)
3410 /**************************************************/
3412 /*************************************************/
3413 #define BMI160_BMM150_CHIP_ID (0x40)
3414 #define BMI160_BMM150_POWE_CONTROL_REG (0x4B)
3415 #define BMI160_BMM150_POWE_MODE_REG (0x4C)
3416 #define BMI160_BMM150_DATA_REG (0x42)
3417 #define BMI160_BMM150_XY_REP (0x51)
3418 #define BMI160_BMM150_Z_REP (0x52)
3419 /**************************************************/
3421 /*************************************************/
3422 #define BMI160_BST_AKM_ASAX (0x60)
3423 #define BMI160_BST_AKM_ASAY (0x61)
3424 #define BMI160_BST_AKM_ASAZ (0x62)
3425 /**************************************************/
3427 /*************************************************/
3428 #define AKM_POWER_DOWN_MODE (0)
3429 #define AKM_SINGLE_MEAS_MODE (1)
3430 #define FUSE_ROM_MODE (2)
3431 /**************************************************/
3433 /*************************************************/
3434 #define BMI160_MAG_FORCE_MODE (0)
3435 #define BMI160_MAG_SUSPEND_MODE (1)
3436 /**************************************************/
3438 /*************************************************/
3439 #define FORCE_MODE (0)
3440 #define SUSPEND_MODE (1)
3441 #define NORMAL_MODE (2)
3442 #define MAG_SUSPEND_MODE (1)
3444 #ifdef FIFO_ENABLE
3445 /**************************************************/
3447 /*************************************************/
3448 #define FIFO_HEADER_ENABLE (0x01)
3449 #define FIFO_MAG_ENABLE (0x01)
3450 #define FIFO_ACCEL_ENABLE (0x01)
3451 #define FIFO_GYRO_ENABLE (0x01)
3452 #define FIFO_TIME_ENABLE (0x01)
3453 #define FIFO_STOPONFULL_ENABLE (0x01)
3454 #define FIFO_WM_INTERRUPT_ENABLE (0x01)
3455 #define BMI160_FIFO_INDEX_LENGTH (1)
3456 #define BMI160_FIFO_TAG_INTR_MASK (0xFC)
3458 /* FIFO definitions*/
3459 #define FIFO_HEAD_A (0x84)
3460 #define FIFO_HEAD_G (0x88)
3461 #define FIFO_HEAD_M (0x90)
3463 #define FIFO_HEAD_G_A (0x8C)
3464 #define FIFO_HEAD_M_A (0x94)
3465 #define FIFO_HEAD_M_G (0x98)
3467 #define FIFO_HEAD_M_G_A (0x9C)
3469 #define FIFO_HEAD_SENSOR_TIME (0x44)
3470 #define FIFO_HEAD_INPUT_CONFIG (0x48)
3471 #define FIFO_HEAD_SKIP_FRAME (0x40)
3472 #define FIFO_HEAD_OVER_READ_LSB (0x80)
3473 #define FIFO_HEAD_OVER_READ_MSB (0x00)
3476 /* FIFO 1024 byte, max fifo frame count not over 150 */
3477 
3478 #define FIFO_INPUT_CONFIG_OVER_LEN ((s8)-11)
3479 #define FIFO_OVER_READ_RETURN ((s8)-10)
3480 #define FIFO_SENSORTIME_RETURN ((s8)-9)
3481 #define FIFO_SKIP_OVER_LEN ((s8)-8)
3482 #define FIFO_M_G_A_OVER_LEN ((s8)-7)
3483 #define FIFO_M_G_OVER_LEN ((s8)-6)
3484 #define FIFO_M_A_OVER_LEN ((s8)-5)
3485 #define FIFO_G_A_OVER_LEN ((s8)-4)
3486 #define FIFO_M_OVER_LEN ((s8)-3)
3487 #define FIFO_G_OVER_LEN ((s8)-2)
3488 #define FIFO_A_OVER_LEN ((s8)-1)
3489 #endif
3490 /**************************************************/
3492 /*************************************************/
3493 #define ACCEL_MODE_NORMAL (0x11)
3494 #define ACCEL_LOWPOWER (0X12)
3495 #define ACCEL_SUSPEND (0X10)
3496 /* BMI160 Accel power modes*/
3497 #define BMI160_ACCEL_SUSPEND 0
3498 #define BMI160_ACCEL_NORMAL_MODE 1
3499 #define BMI160_ACCEL_LOW_POWER 2
3500 /**************************************************/
3502 /*************************************************/
3503 #define GYRO_MODE_SUSPEND (0x14)
3504 #define GYRO_MODE_NORMAL (0x15)
3505 #define GYRO_MODE_FASTSTARTUP (0x17)
3506 /**************************************************/
3508 /*************************************************/
3509 #define MAG_MODE_SUSPEND (0x18)
3510 #define MAG_MODE_NORMAL (0x19)
3511 #define MAG_MODE_LOWPOWER (0x1A)
3512 /**************************************************/
3514 /*************************************************/
3515 #define BMI160_ENABLE (0x01)
3516 #define BMI160_DISABLE (0x00)
3517 /**************************************************/
3519 /*************************************************/
3520 #define BMI160_EDGE (0x01)
3521 #define BMI160_LEVEL (0x00)
3522 /**************************************************/
3524 /*************************************************/
3525 #define BMI160_LEVEL_LOW (0x00)
3526 #define BMI160_LEVEL_HIGH (0x01)
3527 /**************************************************/
3529 /*************************************************/
3530 #define BMI160_OPEN_DRAIN (0x01)
3531 #define BMI160_PUSH_PULL (0x00)
3532 
3533 /* interrupt output enable*/
3534 #define BMI160_INPUT (0x01)
3535 #define BMI160_OUTPUT (0x00)
3536 
3537 /**************************************************/
3539 /*************************************************/
3540 #define FILTER_DATA (0x00)
3541 #define UNFILTER_DATA (0x01)
3542 /**************************************************/
3544 /*************************************************/
3545 #define SLOW_MOTION (0x00)
3546 #define NO_MOTION (0x01)
3547 /**************************************************/
3549 /*************************************************/
3550 #define ANY_MOTION (0x00)
3551 #define SIGNIFICANT_MOTION (0x01)
3552 /**************************************************/
3554 /*************************************************/
3555 #define BMI160_LATCH_DUR_NONE (0x00)
3556 #define BMI160_LATCH_DUR_312_5_MICRO_SEC (0x01)
3557 #define BMI160_LATCH_DUR_625_MICRO_SEC (0x02)
3558 #define BMI160_LATCH_DUR_1_25_MILLI_SEC (0x03)
3559 #define BMI160_LATCH_DUR_2_5_MILLI_SEC (0x04)
3560 #define BMI160_LATCH_DUR_5_MILLI_SEC (0x05)
3561 #define BMI160_LATCH_DUR_10_MILLI_SEC (0x06)
3562 #define BMI160_LATCH_DUR_20_MILLI_SEC (0x07)
3563 #define BMI160_LATCH_DUR_40_MILLI_SEC (0x08)
3564 #define BMI160_LATCH_DUR_80_MILLI_SEC (0x09)
3565 #define BMI160_LATCH_DUR_160_MILLI_SEC (0x0A)
3566 #define BMI160_LATCH_DUR_320_MILLI_SEC (0x0B)
3567 #define BMI160_LATCH_DUR_640_MILLI_SEC (0x0C)
3568 #define BMI160_LATCH_DUR_1_28_SEC (0x0D)
3569 #define BMI160_LATCH_DUR_2_56_SEC (0x0E)
3570 #define BMI160_LATCHED (0x0F)
3571 /**************************************************/
3573 /*************************************************/
3574 #define BMI160_GYRO_MANUAL_OFFSET_0_7 (0x00FF)
3575 #define BMI160_GYRO_MANUAL_OFFSET_8_9 (0x0300)
3576 /**************************************************/
3578 /*************************************************/
3579 #define BMI160_STEP_CONFIG_0_7 (0x00FF)
3580 #define BMI160_STEP_CONFIG_8_10 (0x0700)
3581 #define BMI160_STEP_CONFIG_11_14 (0xF000)
3582 /**************************************************/
3584 /*************************************************/
3585 #define BMI160_WRITE_TARGET_PAGE0 (0x00)
3586 #define BMI160_WRITE_TARGET_PAGE1 (0x01)
3587 #define BMI160_WRITE_ENABLE_PAGE1 (0x01)
3588 #define BMI160_MANUAL_DISABLE (0x00)
3589 #define BMI160_MANUAL_ENABLE (0x01)
3590 #define BMI160_YAS_DISABLE_RCOIL (0x00)
3591 #define BMI160_ENABLE_MAG_IF_MODE (0x02)
3592 #define BMI160_ENABLE_ANY_MOTION_INTR1 (0x04)
3593 #define BMI160_ENABLE_ANY_MOTION_INTR2 (0x04)
3594 #define BMI160_MAG_DATA_READ_REG (0x04)
3595 #define BMI160_BMM_POWER_MODE_REG (0x06)
3596 #define BMI160_ENABLE_ANY_MOTION_AXIS (0x07)
3597 #define BMI160_ENABLE_LOW_G (0x08)
3598 #define BMI160_YAS532_ACQ_START (0x11)
3599 #define BMI160_YAS_DEVICE_ID_REG (0x80)
3600 #define BMI160_FIFO_GYRO_ENABLE (0x80)
3601 #define BMI160_SIG_MOTION_INTR_ENABLE (0x01)
3602 #define BMI160_STEP_DETECT_INTR_ENABLE (0x01)
3603 #define BMI160_LOW_G_INTR_STAT (0x01)
3604 #define BMI160_PULL_UP_DATA (0x30)
3605 #define BMI160_FIFO_M_G_A_ENABLE (0xE0)
3606 #define BMI160_FIFO_M_G_ENABLE (0xA0)
3607 #define BMI160_FIFO_M_A_ENABLE (0x60)
3608 #define BMI160_FIFO_G_A_ENABLE (0xC0)
3609 #define BMI160_FIFO_A_ENABLE (0x40)
3610 #define BMI160_FIFO_M_ENABLE (0x20)
3612 #define BMI160_SEC_IF_BMM150 (0)
3613 #define BMI160_SEC_IF_AKM09911 (1)
3614 #define BMI160_SEC_IF_AKM09912 (2)
3615 #define BMI160_SEC_IF_YAS532 (3)
3616 #define BMI160_SEC_IF_YAS537 (4)
3617 /**************************************************/
3619 /*************************************************/
3620 #define BMI160_COMMAND_REG_ONE (0x37)
3621 #define BMI160_COMMAND_REG_TWO (0x9A)
3622 #define BMI160_COMMAND_REG_THREE (0xC0)
3623 #define RESET_STEP_COUNTER (0xB2)
3624 /**************************************************/
3626 /*************************************************/
3627 #define BMI160_GET_BITSLICE(regvar, bitname)\
3628  ((regvar & bitname##__MSK) >> bitname##__POS)
3629 
3631 #define BMI160_SET_BITSLICE(regvar, bitname, val)\
3632  ((regvar & ~bitname##__MSK) | \
3633  ((val<<bitname##__POS)&bitname##__MSK))
3635 /**************************************************/
3637 /*************************************************/
3638 /**************************************************/
3640 /*************************************************/
3665 /**************************************************/
3667 /*************************************************/
3686 u8 *v_data_u8, u8 v_len_u8);
3705 u8 *v_data_u8, u8 v_len_u8);
3706 /**************************************************/
3708 /*************************************************/
3726 *v_fatal_err_u8);
3752 *v_error_code_u8);
3769 *v_i2c_error_code_u8);
3786 *v_drop_cmd_err_u8);
3806 *v_mag_data_rdy_err_u8);
3826 u8 *v_err_code_u8, u8 *v_i2c_fail_err_u8,
3827 u8 *v_drop_cmd_err_u8, u8 *v_mag_data_rdy_err_u8);
3828 /******************************************************************/
3830 /*****************************************************************/
3858 *v_mag_power_mode_stat_u8);
3885 *v_gyro_power_mode_stat_u8);
3913 *v_accel_power_mode_stat_u8);
3924 /**************************************************/
3926 /*************************************************/
3950 u8 v_sensor_select_u8);
3973 u8 v_sensor_select_u8);
3996 u8 v_sensor_select_u8);
4013 s16 *v_mag_r_s16);
4036 struct bmi160_mag_t *mag, u8 v_sensor_select_u8);
4037  /*!*
4038  * @brief This API reads magnetometer data X,Y,Z,r
4039  * values from the register 0x04 to 0x0B
4040  *
4041  * @brief The mag sensor data read form auxiliary mag
4042  *
4043  * @param mag : The value of mag-BMM150 xyzr data
4044  *
4045  * @note For mag data output rate configuration use the following function
4046  * @note bmi160_set_mag_output_data_rate()
4047  *
4048  * @return results of bus communication function
4049  * @retval 0 -> Success
4050  * @retval -1 -> Error
4051  *
4052  *
4053 */
4055 struct bmi160_mag_xyzr_t *mag);
4056 /**************************************************/
4058 /*************************************************/
4079 s16 *v_gyro_x_s16);
4101 s16 *v_gyro_y_s16);
4123 s16 *v_gyro_z_s16);
4145 struct bmi160_gyro_t *gyro);
4146 /**************************************************/
4148 /*************************************************/
4171 s16 *v_accel_x_s16);
4194 s16 *v_accel_y_s16);
4217 s16 *v_accel_z_s16);
4240 struct bmi160_accel_t *accel);
4241 /**************************************************/
4243 /*************************************************/
4260 u32 *v_sensor_time_u32);
4281 (u8 accel_gyro_sensortime_select,
4282 struct bmi160_sensortime_accel_gyro_data *accel_gyro_sensor_time);
4283 /**************************************************/
4285 /*************************************************/
4305 *v_gyro_selftest_u8);
4306 /**************************************************/
4308 /*************************************************/
4330 *v_mag_manual_stat_u8);
4331 /**************************************************/
4333 /*************************************************/
4350 *v_foc_rdy_u8);
4351 /**************************************************/
4353 /*************************************************/
4373 *v_nvm_rdy_u8);
4374 /**************************************************/
4376 /*************************************************/
4393 *v_data_rdy_u8);
4411 *v_data_rdy_u8);
4429 *drdy_acc);
4430 /**************************************************/
4432 /*************************************************/
4458 *v_step_intr_u8);
4459 /**************************************************/
4461 /*************************************************/
4490 *sigmot_intr);
4491 /**************************************************/
4493 /*************************************************/
4518 *v_any_motion_intr_u8);
4519 /**************************************************/
4521 /*************************************************/
4548 *v_pmu_trigger_intr_u8);
4549 /**************************************************/
4551 /*************************************************/
4593 *v_double_tap_intr_u8);
4594 /**************************************************/
4596 /*************************************************/
4638 *v_single_tap_intr_u8);
4639 /**************************************************/
4641 /*************************************************/
4685 *v_orient_intr_u8);
4686 /**************************************************/
4688 /*************************************************/
4725 *v_flat_intr_u8);
4726 /**************************************************/
4728 /*************************************************/
4770 *v_high_g_intr_u8);
4771 /**************************************************/
4773 /*************************************************/
4812 *v_low_g_intr_u8);
4813 /**************************************************/
4815 /*************************************************/
4844 *v_data_rdy_intr_u8);
4845 
4846 #ifdef FIFO_ENABLE
4847 /**************************************************/
4849 /*************************************************/
4876 *v_fifo_full_intr_u8);
4904 *v_fifo_wm_intr_u8);
4905 #endif
4906 /**************************************************/
4908 /*************************************************/
4943 *nomo_intr);
4944 /**************************************************/
4946 /*************************************************/
4965 *v_anymotion_first_x_u8);
4987 *v_any_motion_first_y_u8);
5010 *v_any_motion_first_z_u8);
5032 *v_anymotion_sign_u8);
5033 /**************************************************/
5035 /*************************************************/
5056 *v_tap_first_x_u8);
5079 *v_tap_first_y_u8);
5102 *v_tap_first_z_u8);
5124 *tap_sign);
5125 /**************************************************/
5127 /*************************************************/
5150 *v_high_g_first_x_u8);
5173 *v_high_g_first_y_u8);
5196 *v_high_g_first_z_u8);
5219 *v_high_g_sign_u8);
5220 /**************************************************/
5222 /*************************************************/
5244 *v_orient_xy_u8);
5263 *v_orient_z_u8);
5264 /**************************************************/
5266 /*************************************************/
5286 *flat);
5287 /**************************************************/
5289 /*************************************************/
5307 *v_temp_s16);
5308 #ifdef FIFO_ENABLE
5309 /**************************************************/
5311 /*************************************************/
5329 u32 *v_fifo_length_u32);
5350 u8 *v_fifodata_u8, u16 v_fifo_length_u16);
5351 #endif
5352 /**************************************************/
5354 /*************************************************/
5385 u8 *v_output_data_rate_u8);
5448 u8 v_output_data_rate_u8, u8 v_accel_bw_u8);
5563 u8 *v_accel_under_sampling_u8);
5586 u8 v_accel_under_sampling_u8);
5611 u8 *v_range_u8);
5636 u8 v_range_u8);
5637 /**************************************************/
5639 /*************************************************/
5674 u8 *gyro_output_typer);
5709 u8 gyro_output_typer);
5776 u8 *v_range_u8);
5797 u8 v_range_u8);
5798 /**************************************************/
5800 /*************************************************/
5873 #ifdef FIFO_ENABLE
5874 /**************************************************/
5876 /*************************************************/
5894 u8 *v_fifo_down_gyro_u8);
5912 u8 v_fifo_down_gyro_u8);
5932 u8 *v_gyro_fifo_filter_data_u8);
5952 u8 v_gyro_fifo_filter_data_u8);
5971 u8 *v_fifo_down_u8);
5990 u8 v_fifo_down_u8);
6011 u8 *accel_fifo_filter_u8);
6032 u8 v_accel_fifo_filter_u8);
6033 /**************************************************/
6035 /*************************************************/
6053 u8 *v_fifo_wm_u8);
6071 u8 v_fifo_wm_u8);
6072 /**************************************************/
6074 /*************************************************/
6095 u8 *v_fifo_time_enable_u8);
6116 u8 v_fifo_time_enable_u8);
6137 u8 *v_fifo_tag_intr2_u8);
6158 u8 v_fifo_tag_intr2_u8);
6176 u8 *v_fifo_tag_intr1_u8);
6194 u8 v_fifo_tag_intr1_u8);
6212 u8 *v_fifo_header_u8);
6230 u8 v_fifo_header_u8);
6248 u8 *v_fifo_mag_u8);
6266 u8 v_fifo_mag_u8);
6286 u8 *v_fifo_accel_u8);
6306 u8 v_fifo_accel_u8);
6326 u8 *v_fifo_gyro_u8);
6346 u8 v_fifo_gyro_u8);
6347 #endif
6348 /***************************************************************/
6350 /***************************************************************/
6368 u8 *v_i2c_device_addr_u8);
6386 u8 v_i2c_device_addr_u8);
6405 u8 *v_mag_burst_u8);
6424 u8 v_mag_burst_u8);
6425 /***************************************************************/
6427 /***************************************************************/
6448 u8 *v_mag_offset_u8);
6469 u8 v_mag_offset_u8);
6470 /***************************************************************/
6472 /***************************************************************/
6498 u8 *v_mag_manual_u8);
6524 u8 v_mag_manual_u8);
6525 /***************************************************************/
6527 /***************************************************************/
6547 u8 *v_mag_read_addr_u8);
6566 u8 v_mag_read_addr_u8);
6585 u8 *v_mag_write_addr_u8);
6604 u8 v_mag_write_addr_u8);
6623 u8 *v_mag_write_data_u8);
6642 u8 v_mag_write_data_u8);
6643 /***************************************************************/
6646 /***************************************************************/
6680 u8 enable, u8 *v_intr_enable_zero_u8);
6714 u8 enable, u8 v_intr_enable_zero_u8);
6715 /***************************************************************/
6718 /***************************************************************/
6754 u8 enable, u8 *v_intr_enable_1_u8);
6790 u8 enable, u8 v_intr_enable_1_u8);
6791 /***************************************************************/
6794 /***************************************************************/
6824 u8 enable, u8 *v_intr_enable_2_u8);
6854 u8 enable, u8 v_intr_enable_2_u8);
6855 /***************************************************************/
6858 /***************************************************************/
6878 u8 *v_step_intr_u8);
6898 u8 v_step_intr_u8);
6899 /***************************************************************/
6901 /***************************************************************/
6927 u8 v_channel_u8, u8 *v_intr_edge_ctrl_u8);
6953 u8 v_channel_u8, u8 v_intr_edge_ctrl_u8);
6979 u8 v_channel_u8, u8 *v_intr_level_u8);
7005 u8 v_channel_u8, u8 v_intr_level_u8);
7034 u8 v_channel_u8, u8 *v_intr_output_type_u8);
7063 u8 v_channel_u8, u8 v_intr_output_type_u8);
7092 u8 v_channel_u8, u8 *v_output_enable_u8);
7121 u8 v_channel_u8, u8 v_output_enable_u8);
7122 /***************************************************************/
7124 /***************************************************************/
7162 u8 *v_latch_intr_u8);
7200 u8 v_latch_intr_u8);
7229 u8 v_channel_u8, u8 *v_input_en_u8);
7258 u8 v_channel_u8, u8 v_input_en_u8);
7259 /***************************************************************/
7261 /***************************************************************/
7290 u8 v_channel_u8, u8 *v_intr_low_g_u8);
7319 u8 v_channel_u8, u8 v_intr_low_g_u8);
7349 u8 v_channel_u8, u8 *v_intr_high_g_u8);
7379 u8 v_channel_u8, u8 v_intr_high_g_u8);
7409 u8 v_channel_u8, u8 *v_intr_any_motion_u8);
7439 u8 v_channel_u8, u8 v_intr_any_motion_u8);
7468 u8 v_channel_u8, u8 *v_intr_nomotion_u8);
7497 u8 v_channel_u8, u8 v_intr_nomotion_u8);
7525 u8 v_channel_u8, u8 *v_intr_double_tap_u8);
7553 u8 v_channel_u8, u8 v_intr_double_tap_u8);
7582 u8 v_channel_u8, u8 *v_intr_single_tap_u8);
7611 u8 v_channel_u8, u8 v_intr_single_tap_u8);
7641 u8 v_channel_u8, u8 *v_intr_orient_u8);
7671 u8 v_channel_u8, u8 v_intr_orient_u8);
7700 u8 v_channel_u8, u8 *v_intr_flat_u8);
7729 u8 v_channel_u8, u8 v_intr_flat_u8);
7757 u8 v_channel_u8, u8 *v_intr_pmu_trig_u8);
7785 u8 v_channel_u8, u8 v_intr_pmu_trig_u8);
7786 
7814 #ifdef FIFO_ENABLE
7816 u8 v_channel_u8, u8 *v_intr_fifo_full_u8);
7845 u8 v_channel_u8, u8 v_intr_fifo_full_u8);
7875 u8 v_channel_u8, u8 *v_intr_fifo_wm_u8);
7905 u8 v_channel_u8, u8 v_intr_fifo_wm_u8);
7906 #endif
7907 
7935 u8 v_channel_u8, u8 *v_intr_data_rdy_u8);
7964 u8 v_channel_u8, u8 v_intr_data_rdy_u8);
7965 /***************************************************************/
7967 /***************************************************************/
7988 u8 *v_tap_source_u8);
8009 u8 v_tap_source_u8);
8010 /***************************************************************/
8012 /***************************************************************/
8032 u8 *v_low_high_source_u8);
8052 u8 v_low_high_source_u8);
8053 /***************************************************************/
8055 /***************************************************************/
8075 u8 *v_motion_source_u8);
8095 u8 v_motion_source_u8);
8096 /***************************************************************/
8098 /***************************************************************/
8121 u8 *v_low_durn_u8);
8144 u8 v_low_durn_u8);
8145 /***************************************************************/
8147 /***************************************************************/
8170 u8 *v_low_g_thres_u8);
8193 u8 v_low_g_thres_u8);
8194 /***************************************************************/
8196 /***************************************************************/
8212 u8 *v_low_hyst_u8);
8228 u8 v_low_hyst_u8);
8229 /***************************************************************/
8231 /***************************************************************/
8250 u8 *v_low_g_mode_u8);
8269 u8 v_low_g_mode_u8);
8270 /***************************************************************/
8272 /***************************************************************/
8295 u8 *v_high_g_hyst_u8);
8318 u8 v_high_g_hyst_u8);
8319 /***************************************************************/
8321 /***************************************************************/
8341 u8 *v_high_g_durn_u8);
8361 u8 v_high_g_durn_u8);
8362 /***************************************************************/
8364 /***************************************************************/
8397 u8 *v_high_g_thres_u8);
8430 u8 v_high_g_thres_u8);
8431 /***************************************************************/
8433 /***************************************************************/
8449 u8 *v_any_motion_durn_u8);
8465 u8 nomotion);
8466 /***************************************************************/
8468 /***************************************************************/
8491 u8 *v_slow_no_motion_u8);
8514 u8 v_slow_no_motion_u8);
8515 /***************************************************************/
8517 /***************************************************************/
8550 u8 *v_any_motion_thres_u8);
8583 u8 v_any_motion_thres_u8);
8584 /***************************************************************/
8586 /***************************************************************/
8620 u8 *v_slow_no_motion_thres_u8);
8654 u8 v_slow_no_motion_thres_u8);
8655 /***************************************************************/
8657 /***************************************************************/
8680 u8 *v_intr_slow_no_motion_select_u8);
8703 u8 v_intr_slow_no_motion_select_u8);
8704 /***************************************************************/
8706 /***************************************************************/
8729 u8 *int_sig_mot_sel);
8752 u8 int_sig_mot_sel);
8768 u8 v_significant_u8);
8769 
8793 u8 *v_int_sig_mot_skip_u8);
8817 u8 v_int_sig_mot_skip_u8);
8842 u8 *int_sig_mot_proof);
8867 u8 int_sig_mot_proof);
8868 /***************************************************************/
8870 /***************************************************************/
8897 u8 *v_tap_durn_u8);
8924 u8 v_tap_durn_u8);
8925 /***************************************************************/
8927 /***************************************************************/
8946 u8 *v_tap_shock_u8);
8965 u8 v_tap_shock_u8);
8966 /***************************************************************/
8968 /***************************************************************/
8988 u8 *v_tap_quiet_u8);
9008 u8 v_tap_quiet_u8);
9009 /***************************************************************/
9011 /***************************************************************/
9035 u8 *v_tap_thres_u8);
9059 u8 v_tap_thres_u8);
9060 /***************************************************************/
9062 /***************************************************************/
9084 u8 *v_orient_mode_u8);
9106 u8 v_orient_mode_u8);
9107 /***************************************************************/
9109 /***************************************************************/
9136 u8 *v_orient_blocking_u8);
9163 u8 v_orient_blocking_u8);
9164 /***************************************************************/
9166 /***************************************************************/
9186 u8 *v_orient_hyst_u8);
9206 u8 v_orient_hyst_u8);
9207 /***************************************************************/
9209 /***************************************************************/
9225 u8 *v_orient_theta_u8);
9241 u8 v_orient_theta_u8);
9242 /***************************************************************/
9244 /***************************************************************/
9263 u8 *v_orient_ud_u8);
9282 u8 v_orient_ud_u8);
9283 /***************************************************************/
9285 /***************************************************************/
9304 u8 *v_orient_axes_u8);
9323 u8 v_orient_axes_u8);
9324 /***************************************************************/
9326 /***************************************************************/
9342 u8 *v_flat_theta_u8);
9358 u8 v_flat_theta_u8);
9359 /***************************************************************/
9361 /***************************************************************/
9382 u8 *v_flat_hold_u8);
9403 u8 v_flat_hold_u8);
9404 /***************************************************************/
9406 /***************************************************************/
9422 u8 *v_flat_hyst_u8);
9438 u8 v_flat_hyst_u8);
9439 /***************************************************************/
9441 /***************************************************************/
9461 u8 *v_foc_accel_z_u8);
9481 u8 v_foc_accel_z_u8);
9504 u8 *v_foc_accel_y_u8);
9527 u8 v_foc_accel_y_u8);
9550 u8 *v_foc_accel_x_u8);
9573 u8 v_foc_accel_x_u8);
9574 /***************************************************************/
9576 /***************************************************************/
9598 u8 v_foc_gyro_u8, s16 *v_gyro_off_x_s16,
9599 s16 *v_gyro_off_y_s16, s16 *v_gyro_off_z_s16);
9600 /***************************************************/
9602 /***************************************************/
9620 u8 *v_nvm_prog_u8);
9638 u8 v_nvm_prog_u8);
9639 /***************************************************/
9641 /***************************************************/
9661 u8 *v_spi3_u8);
9681 u8 v_spi3_u8);
9682 /***************************************************/
9684 /***************************************************/
9704 u8 *v_foc_gyro_u8);
9705 /***************************************************/
9707 /***************************************************/
9726 u8 *v_i2c_wdt_u8);
9745 bmi160_set_i2c_wdt_select(u8 v_i2c_wdt_u8);
9763 u8 *v_i2c_wdt_u8);
9781 u8 v_i2c_wdt_u8);
9782 /***************************************************/
9784 /***************************************************/
9805 u8 *v_if_mode_u8);
9826 u8 v_if_mode_u8);
9827 /***************************************************/
9829 /***************************************************/
9855 u8 *v_gyro_sleep_trigger_u8);
9881 u8 v_gyro_sleep_trigger_u8);
9902 u8 *v_gyro_wakeup_trigger_u8);
9923 u8 v_gyro_wakeup_trigger_u8);
9942 u8 *v_gyro_sleep_state_u8);
9961 u8 v_gyro_sleep_state_u8);
9980 u8 *v_gyro_wakeup_intr_u8);
9999 u8 v_gyro_wakeup_intr_u8);
10000 /***************************************************/
10002 /***************************************************/
10023 u8 *acc_selftest_axis);
10044 u8 acc_selftest_axis);
10063 u8 *acc_selftest_sign);
10082 u8 acc_selftest_sign);
10102 u8 *acc_selftest_amp);
10122 u8 acc_selftest_amp);
10123 /***************************************************/
10125 /***************************************************/
10138 u8 *v_gyro_selftest_start_u8);
10151 u8 v_gyro_selftest_start_u8);
10152 /***************************************************/
10154 /***************************************************/
10173 u8 *v_spi_enable_u8);
10192 u8 v_spi_enable_u8);
10209 (u8 *v_spare0_trim_u8);
10226 (u8 v_spare0_trim_u8);
10227 /***************************************************/
10229 /***************************************************/
10246 u8 *v_nvm_counter_u8);
10263 u8 v_nvm_counter_u8);
10264 /***************************************************/
10266 /***************************************************/
10285 s8 *v_accel_off_x_s8);
10304 s8 v_accel_off_x_s8);
10323 s8 *v_accel_off_y_s8);
10342 s8 v_accel_off_y_s8);
10361 s8 *v_accel_off_z_s8);
10380 s8 v_accel_off_z_s8);
10381 /***************************************************/
10383 /***************************************************/
10402 s16 *v_gyro_off_x_s16);
10421 s16 v_gyro_off_x_s16);
10440 s16 *v_gyro_off_y_s16);
10459 s16 v_gyro_off_y_s16);
10478 s16 *v_gyro_off_z_s16);
10497 s16 v_gyro_off_z_s16);
10530 u8 foc_acc, s8 *accel_offset);
10573 u8 v_foc_accel_y_u8, u8 v_foc_accel_z_u8,
10574 s8 *acc_off_x, s8 *acc_off_y, s8 *acc_off_z);
10575 /***************************************************/
10577 /***************************************************/
10598 u8 *acc_off_en);
10619 u8 acc_off_en);
10640 u8 *v_gyro_off_enable_u8);
10661 u8 v_gyro_off_enable_u8);
10662 /***************************************************/
10664 /***************************************************/
10698 u16 *v_step_config_u16);
10716 u16 v_step_config_u16);
10731 u8 *v_step_counter_u8);
10746 u8 v_step_counter_u8);
10783 u8 v_significant_u8);
10802 u8 v_step_detector_u8);
10818 /***************************************************/
10820 /***************************************************/
10860 u8 v_command_reg_u8);
10861 /***************************************************/
10863 /***************************************************/
10880 u8 *v_target_page_u8);
10897 u8 v_target_page_u8);
10918 u8 *v_page_enable_u8);
10939 u8 v_page_enable_u8);
10957 u8 *v_control_pullup_u8);
10975 u8 v_control_pullup_u8);
10976 /***************************************************/
10978 /***************************************************/
11052 struct bmi160_mag_xyz_s32_t *mag_comp_xyz);
11079 s32 bmi160_bmm150_mag_compensate_X(s16 v_mag_data_x_s16, u16 v_data_r_u16);
11105 s32 bmi160_bmm150_mag_compensate_Y(s16 v_mag_data_y_s16, u16 v_data_r_u16);
11131 s32 bmi160_bmm150_mag_compensate_Z(s16 v_mag_data_z_s16, u16 v_data_r_u16);
11225 u8 v_mag_sec_if_pow_mode_u8);
11226 #if defined AKM09911 || defined AKM09912
11227 /***************************************************/
11229 /***************************************************/
11230 
11234  struct bmi160_bst_akm_xyz_t {
11235  s32 x;
11236  s32 y;
11237  s32 z;
11238  };
11242  struct bst_akm_sensitivity_data_t {
11243  u8 asax;
11244  u8 asay;
11245  u8 asaz;
11246  };
11268  BMI160_RETURN_FUNCTION_TYPE bmi160_bst_akm_mag_interface_init(
11269  u8 v_akm_i2c_address_u8);
11293  BMI160_RETURN_FUNCTION_TYPE bmi160_read_bst_akm_sensitivity_data(void);
11324  BMI160_RETURN_FUNCTION_TYPE bmi160_bst_akm_set_powermode(
11325  u8 v_akm_pow_mode_u8);
11350  bmi160_set_bst_akm_and_secondary_if_powermode(
11351  u8 v_mag_sec_if_pow_mode_u8);
11352 
11353  #endif
11354  #ifdef AKM09911
11355  /***************************************************/
11357  /***************************************************/
11380  s32 bmi160_bst_akm09911_compensate_X(s16 v_bst_akm_x_s16);
11403  s32 bmi160_bst_akm09911_compensate_Y(s16 v_bst_akm_y_s16);
11426  s32 bmi160_bst_akm09911_compensate_Z(s16 v_bst_akm_z_s16);
11450  BMI160_RETURN_FUNCTION_TYPE bmi160_bst_akm09911_compensate_xyz(
11451  struct bmi160_bst_akm_xyz_t *bst_akm_xyz);
11452 #endif
11453  #ifdef AKM09912
11454  /***************************************************/
11456 /***************************************************/
11480 s32 bmi160_bst_akm09912_compensate_X(s16 v_bst_akm_x_s16);
11503 s32 bmi160_bst_akm09912_compensate_Y(s16 v_bst_akm_y_s16);
11526 s32 bmi160_bst_akm09912_compensate_Z(s16 v_bst_akm_z_s16);
11550 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_akm09912_compensate_xyz(
11551 struct bmi160_bst_akm_xyz_t *bst_akm_xyz);
11552  #endif
11553 
11554 #ifdef FIFO_ENABLE
11555 /***************************************************/
11557 /***************************************************/
11588 u8 v_mag_if_u8, struct bmi160_fifo_data_header_less_t *headerless_data);
11623 u16 v_fifo_user_length_u16,
11624 struct bmi160_fifo_data_header_less_t *fifo_data, u8 v_mag_if_mag_u8);
11655 u8 v_mag_if_u8, struct bmi160_fifo_data_header_t *header_data);
11686 u16 v_fifo_user_length_u16, u8 v_mag_if_mag_u8,
11687 struct bmi160_fifo_data_header_t *fifo_header_data);
11688 #endif
11689 
11697 struct bmi160_t *bmi160_get_ptr(void);
11722 struct bmi160_mag_fifo_data_t mag_fifo_data,
11723 u8 v_mag_second_if_u8);
11724 #ifdef YAS537
11725 /***************************************************/
11727 /***************************************************/
11732 struct yas_vector {
11733  s32 yas537_vector_xyz[3];
11734 };
11739 struct bst_yas537_calib_data_t {
11740 s8 a2;
11741 s8 a3;
11742 s8 a4;
11743 s16 a5;
11744 s8 a6;
11745 s8 a7;
11746 s8 a8;
11747 s16 a9;
11748 u8 k;
11749 u8 ver;
11750 };
11754 struct yas537_t {
11755 struct bst_yas537_calib_data_t calib_yas537;
11756 s8 measure_state;
11757 s8 hard_offset[3];
11758 u16 last_after_rcoil[3];
11759 s32 coef[3];
11760 s8 overflow;
11761 u8 dev_id;
11762 u8 average;
11763 const s8 *transform;
11764 u16 last_raw[4];
11765 struct yas_vector xyz;
11766 };
11784 u16 *a_xy1y2_u16, u8 v_over_flow_u8, u8 v_rcoil_u8, u8 v_busy_u8);
11796 void);
11812 u8 v_rcoil_u8);
11845 u8 v_command_reg_data_u8);
11864 u8 *v_coil_stat_u8, u8 *v_busy_u8,
11865 u16 *v_temperature_u16, u16 *xy1y2, u8 *v_ouflow_u8);
11880 u8 *v_ouflow_u8, struct yas_vector *vector_xyz);
11881 
11882 #endif
11883 
11884 #ifdef YAS532
11885 /***************************************************/
11887 /***************************************************/
11892 struct bst_yas532_calib_data_t {
11893 s32 cx;
11894 s32 cy1;
11895 s32 cy2;
11896 s32 a2;
11897 s32 a3;
11898 s32 a4;
11899 s32 a5;
11900 s32 a6;
11901 s32 a7;
11902 s32 a8;
11903 s32 a9;
11904 s32 k;
11905 s8 rxy1y2[3];
11906 u8 fxy1y2[3];
11907 };
11911 #if 1 < YAS532_MAG_TEMPERATURE_LOG
11912 struct yas_temp_filter_t {
11914 u8 num;
11915 u8 idx;
11916 };
11917 #endif
11918 
11921 struct yas532_t {
11922 struct bst_yas532_calib_data_t calib_yas532;
11923 s8 measure_state;
11924 s8 v_hard_offset_s8[3];
11925 s32 coef[3];
11926 s8 overflow;
11927 u8 dev_id;
11928 const s8 *transform;
11929 #if 1 < YAS532_MAG_TEMPERATURE_LOG
11930 struct yas_temp_filter_t temp_data;
11931 #endif
11932 u16 last_raw[4];
11933 };
11937 struct yas532_vector {
11938 s32 yas532_vector_xyz[3];
11939 };
11944 struct yas532_data {
11945 s32 x;
11946 s32 y;
11947 s32 z;
11948 };
11959 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yamaha_yas532_mag_interface_init(
11960 void);
11971 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_set_initial_values(void);
11982 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_magnetic_measure_set_offset(
11983 void);
11995 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yamaha_yas532_calib_values(void);
12007 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_xy1y2_to_linear(
12008 u16 *v_xy1y2_u16, s32 *xy1y2_linear);
12044 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_normal_measurement_data(
12045 u8 v_acquisition_command_u8, u8 *v_busy_u8,
12046 u16 *v_temp_u16, u16 *v_xy1y2_u16, u8 *v_overflow_u8);
12080 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_measurement_xyz_data(
12081 struct yas532_vector *xyz_data, u8 *v_overflow_s8, u8 v_temp_correction_u8,
12082 u8 v_acquisition_command_u8);
12117 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_acquisition_command_register(
12118 u8 v_command_reg_data_u8);
12131 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_set_offset(
12132 const s8 *p_offset_s8);
12149 BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas532_fifo_xyz_data(
12150 u16 *v_xy1y2_u16, u8 v_temp_correction_u8,
12151 s8 v_overflow_s8, u16 v_temp_u16, u8 v_busy_u8);
12152 
12153 #endif
12154 #endif
12155 
BMI160_RETURN_FUNCTION_TYPE bmi160_set_bmm150_mag_presetmode(u8 mode)
This API used to set the pre-set modes of bmm150 The pre-set mode setting is depend on data rate and ...
Definition: bmi160.c:17966
BMI160_RETURN_FUNCTION_TYPE bmi160_read_fifo_headerless_mode(u8 v_mag_if_u8, struct bmi160_fifo_data_header_less_t *headerless_data)
This function used for reading the fifo data of header less mode.
Definition: bmi160.c:16869
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_offset_compensation_zaxis(s8 v_accel_off_z_s8)
This API write accel manual offset compensation of z axis from the register 0x73 bit 0 to 7...
Definition: bmi160.c:14489
s32 bmi160_bmm150_mag_compensate_X(s16 v_mag_data_x_s16, u16 v_data_r_u16)
This API used to get the compensated BMM150-X data the out put of X as s32 Before start reading the m...
Definition: bmi160.c:17426
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_hyst(u8 v_orient_hyst_u8)
This API write Orient interrupt hysteresis, from the register 0x64 bit 4 to 7.
Definition: bmi160.c:11595
BMI160_RETURN_FUNCTION_TYPE bmi160_set_foc_gyro_enable(u8 v_foc_gyro_u8, s16 *v_gyro_off_x_s16, s16 *v_gyro_off_y_s16, s16 *v_gyro_off_z_s16)
This API write gyro fast offset enable from the register 0x69 bit 6.
Definition: bmi160.c:12808
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_step_intr(u8 *v_step_intr_u8)
This API reads the step detector interrupt status from the register 0x1C bit 0 flag is associated wit...
Definition: bmi160.c:1931
BMI160_RETURN_FUNCTION_TYPE bmi160_set_i2c_wdt_enable(u8 v_i2c_wdt_u8)
This API write I2C watchdog enable from the register 0x70 bit 2.
Definition: bmi160.c:13194
BMI160_RETURN_FUNCTION_TYPE bmi160_set_foc_accel_y(u8 v_foc_accel_y_u8)
This API write accel offset compensation target value for y-axis from the register 0x69 bit 2 and 3...
Definition: bmi160.c:12265
BMI160_RETURN_FUNCTION_TYPE bmi160_set_i2c_wdt_select(u8 v_i2c_wdt_u8)
This API write I2C Watchdog timer from the register 0x70 bit 1.
Definition: bmi160.c:13111
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_offset(u8 *v_mag_offset_u8)
This API is used to read trigger-readout offset in units of 2.5 ms. If set to zero, the offset is maximum, i.e. after readout a trigger is issued immediately. from the register 0x4C bit 2 to 5.
Definition: bmi160.c:5636
BMI160_RETURN_FUNCTION_TYPE bmi160_set_foc_accel_x(u8 v_foc_accel_x_u8)
This API write accel offset compensation target value for x-axis is from the register 0x69 bit 4 and ...
Definition: bmi160.c:12356
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_power_mode_stat(u8 *v_gyro_power_mode_stat_u8)
This API reads the gyroscope power mode from PMU status register 0x03 bit 2 and 3.
Definition: bmi160.c:544
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_data_rdy_err(u8 *v_mag_data_rdy_err_u8)
This API reads the magnetometer data ready interrupt not active. It reads from the error register 0x0...
Definition: bmi160.c:394
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_selftest_sign(u8 *acc_selftest_sign)
This API read accel self test axis sign from the register 0x6D bit 2.
Definition: bmi160.c:13785
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_axes_enable(u8 v_orient_axes_u8)
This API write orientation axes changes from the register 0x66 bit 7.
Definition: bmi160.c:11843
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_sleep_trigger(u8 *v_gyro_sleep_trigger_u8)
This API read gyro sleep trigger from the register 0x6C bit 0 to 2.
Definition: bmi160.c:13338
YAS537 sensor initialization.
Definition: bmi160.h:11757
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_range(u8 v_range_u8)
This API is used to set the ranges (g values) of the accel from the register 0x41 bit 0 to 3...
Definition: bmi160.c:3956
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_high_g_hyst(u8 v_high_g_hyst_u8)
This API write High-g interrupt hysteresis from the register 0x5C bit 6 and 7.
Definition: bmi160.c:9922
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_offset_compensation_zaxis(s16 *v_gyro_off_z_s16)
This API read gyro manual offset compensation of z axis from the register 0x76 bit 0 to 7 and 0x77 bi...
Definition: bmi160.c:14816
BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_gyro_enable(u8 *v_foc_gyro_u8)
This API read gyro fast offset enable from the register 0x69 bit 6.
Definition: bmi160.c:12768
BMI160_RETURN_FUNCTION_TYPE bmi160_get_latch_intr(u8 *v_latch_intr_u8)
This API is used to get the latch duration from the register 0x54 bit 0 to 3.
Definition: bmi160.c:7410
Struct used to store the FIFO mag data.
Definition: bmi160.h:1277
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_down_accel(u8 v_fifo_down_u8)
This API is used to set Down sampling for accel (2*downs_accel) from the register 0x45 bit 4 to 6...
Definition: bmi160.c:4654
BMI160_RETURN_FUNCTION_TYPE bmi160_read_gyro_y(s16 *v_gyro_y_s16)
This API reads gyro data Y values form the register 0x0E and 0x0F.
Definition: bmi160.c:1156
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_any_motion(u8 v_channel_u8, u8 *v_intr_any_motion_u8)
Reads the Any motion interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 a...
Definition: bmi160.c:7927
BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_y(s16 *v_mag_y_s16, u8 v_sensor_select_u8)
This API reads magnetometer data Y values from the register 0x06 and 0x07.
Definition: bmi160.c:734
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_header_enable(u8 *v_fifo_header_u8)
This API reads FIFO frame header enable from the register 0x47 bit 4.
Definition: bmi160.c:5124
Structure bmm150 mag compensated data with s32 output.
Definition: bmi160.h:1209
BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_accel_z(u8 *v_foc_accel_z_u8)
This API read accel offset compensation target value for z-axis from the register 0x69 bit 0 and 1...
Definition: bmi160.c:12140
u8 dev_addr
Definition: bmi160.h:1156
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_down_accel(u8 *v_fifo_down_u8)
This API is used to read Down sampling for accel (2*downs_accel) from the register 0x45 bit 4 to 6...
Definition: bmi160.c:4617
BMI160_RETURN_FUNCTION_TYPE bmi160_get_i2c_wdt_enable(u8 *v_i2c_wdt_u8)
This API read I2C watchdog enable from the register 0x70 bit 2.
Definition: bmi160.c:13158
#define BMI160_MDELAY_DATA_TYPE
Definition: bmi160.h:408
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_high_g_first_z(u8 *v_high_g_first_z_u8)
This API reads the high_g first z status from the register 0x1F bit 3.
Definition: bmi160.c:3060
BMI160_RETURN_FUNCTION_TYPE bmi160_set_nvm_prog_enable(u8 v_nvm_prog_u8)
This API write NVM program enable from the register 0x6A bit 1.
Definition: bmi160.c:12939
BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yamaha_yas537_mag_interface_init(void)
This function used to init the YAMAH-YAS537.
Definition: bmi160.c:19981
BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_write_data(u8 v_mag_write_data_u8)
This API is used to set magnetometer write data form the resister 0x4F bit 0 to 7.
Definition: bmi160.c:6002
BMI160_RETURN_FUNCTION_TYPE bmi160_set_target_page(u8 v_target_page_u8)
This API write target page from the register 0x7F bit 4 and 5.
Definition: bmi160.c:15665
BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_manual_enable(u8 v_mag_manual_u8)
This API is used to set Enable register access on MAG_IF[2] or MAG_IF[3] writes. This implies that th...
Definition: bmi160.c:5770
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_slow_no_motion_thres(u8 v_slow_no_motion_thres_u8)
This API is used to write threshold for the slow/no-motion interrupt from the register 0x61 bit 0 to ...
Definition: bmi160.c:10472
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_flat(u8 v_channel_u8, u8 *v_intr_flat_u8)
Reads the Flat interrupt mapped to interrupt1 and interrupt2 from the register 0x55 and 0x57...
Definition: bmi160.c:8597
BMI160_RETURN_FUNCTION_TYPE bmi160_get_sensor_time(u32 *v_sensor_time_u32)
This API reads sensor_time from the register 0x18 to 0x1A.
Definition: bmi160.c:1518
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_selftest_sign(u8 acc_selftest_sign)
This API write accel self test axis sign from the register 0x6D bit 2.
Definition: bmi160.c:13823
struct bmi160_t * bmi160_get_ptr(void)
This function used for reading bmi160_t structure.
Definition: bmi160.c:20858
BMI160_RETURN_FUNCTION_TYPE bmi160_write_reg(u8 v_addr_u8, u8 *v_data_u8, u8 v_len_u8)
This API write the data to the given register.
Definition: bmi160.c:178
BMI160_RETURN_FUNCTION_TYPE bmi160_set_paging_enable(u8 v_page_enable_u8)
This API write page enable from the register 0x7F bit 7.
Definition: bmi160.c:15754
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_offset_compensation_xaxis(s8 *v_accel_off_x_s8)
This API read accel manual offset compensation of x axis from the register 0x71 bit 0 to 7...
Definition: bmi160.c:14266
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_bw(u8 v_bw_u8)
This API is used to set the data of gyro from the register 0x42 bit 4 to 5.
Definition: bmi160.c:4179
BMI160_BRD_FUNC_PTR
Definition: bmi160.h:1160
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_pmu_trig(u8 v_channel_u8, u8 v_intr_pmu_trig_u8)
Write PMU trigger interrupt mapped to interrupt1 and interrupt2 form the register 0x56 bit 0 and 4...
Definition: bmi160.c:8802
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g_hyst(u8 *v_low_hyst_u8)
This API Reads Low-g interrupt hysteresis from the register 0x5C bit 0 to 1.
Definition: bmi160.c:9714
Struct used to store the FIFO header data.
Definition: bmi160.h:1256
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_selftest_amp(u8 *acc_selftest_amp)
This API read accel self test amplitude from the register 0x6D bit 3 select amplitude of the selftest...
Definition: bmi160.c:13873
signed char s8
Definition: bmi160.h:260
BMI160_RETURN_FUNCTION_TYPE bmi160_map_significant_motion_intr(u8 v_significant_u8)
This API used to trigger the signification motion interrupt.
Definition: bmi160.c:15410
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_flat_intr(u8 *v_flat_intr_u8)
This API reads the flat interrupt status from the register 0x1C bit 7 flag is associated with a speci...
Definition: bmi160.c:2298
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_wakeup_trigger(u8 *v_gyro_wakeup_trigger_u8)
This API read gyro wakeup trigger from the register 0x6C bit 3 and 4.
Definition: bmi160.c:13433
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_double_tap_intr(u8 *v_double_tap_intr_u8)
This API reads the double tab status from the register 0x1C bit 4 flag is associated with a specific ...
Definition: bmi160.c:2122
BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_r(s16 *v_mag_r_s16)
This API reads magnetometer data RHALL values from the register 0x0A and 0x0B.
Definition: bmi160.c:865
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_output_data_rate(u8 gyro_output_typer)
This API is used to set the gyroscope output data rate from the register 0x42 bit 0 to 3...
Definition: bmi160.c:4076
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g_thres(u8 v_low_g_thres_u8)
This API is used to write Threshold definition for the low-g interrupt from the register 0x5B bit 0 t...
Definition: bmi160.c:9683
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_flat_hyst(u8 v_flat_hyst_u8)
This API write flat interrupt hysteresis from the register 0x68 bit 0 to 3.
Definition: bmi160.c:12091
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_selftest_axis(u8 *acc_selftest_axis)
This API read accel select axis to be self-test.
Definition: bmi160.c:13696
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_high_g(u8 v_channel_u8, u8 *v_intr_high_g_u8)
Reads the HIGH g interrupt mapped to interrupt1 and interrupt2 from the register 0x55 and 0x57...
Definition: bmi160.c:7795
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_significant_motion_skip(u8 v_int_sig_mot_skip_u8)
This API is used to write the significant skip time from the register 0x62 bit 2 and 3...
Definition: bmi160.c:10821
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_data_rdy(u8 v_channel_u8, u8 *v_intr_data_rdy_u8)
Reads Data Ready interrupt mapped to interrupt1 and interrupt2 form the register 0x56.
Definition: bmi160.c:9170
BMI160_RETURN_FUNCTION_TYPE bmi160_set_spare0_trim(u8 v_spare0_trim_u8)
This API write the spare zero form register 0x70 bit 3.
Definition: bmi160.c:14147
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_range(u8 *v_range_u8)
This API is used to get the ranges (g values) of the accel from the register 0x41 bit 0 to 3...
Definition: bmi160.c:3913
BMI160_RETURN_FUNCTION_TYPE bmi160_read_gyro_xyz(struct bmi160_gyro_t *gyro)
This API reads gyro data X,Y,Z values from the register 0x0C to 0x11.
Definition: bmi160.c:1248
BMI160_RETURN_FUNCTION_TYPE bmi160_get_i2c_wdt_select(u8 *v_i2c_wdt_u8)
This API read I2C Watchdog timer from the register 0x70 bit 1.
Definition: bmi160.c:13074
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_range(u8 *v_range_u8)
This API reads the range of gyro from the register 0x43 bit 0 to 2.
Definition: bmi160.c:4228
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_single_tap(u8 v_channel_u8, u8 v_intr_single_tap_u8)
Write the Single Tap interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 a...
Definition: bmi160.c:8388
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_level(u8 v_channel_u8, u8 *v_intr_level_u8)
API used for get the Configure level condition of interrupt1 and interrupt2 pin form the register 0x5...
Definition: bmi160.c:6998
BMI160_RETURN_FUNCTION_TYPE bmi160_get_spi3(u8 *v_spi3_u8)
This API read to configure SPI Interface Mode for primary and OIS interface from the register 0x6B bi...
Definition: bmi160.c:12988
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_enable_2(u8 enable, u8 v_intr_enable_2_u8)
This API is used to set interrupt enable byte2 from the register bit 0x52 bit 0 to 3...
Definition: bmi160.c:6692
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_output_data_rate(u8 *v_output_data_rate_u8)
This API is used to get the accel output date rate form the register 0x40 bit 0 to 3...
Definition: bmi160.c:3398
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_burst(u8 *v_mag_burst_u8)
This API is used to read Burst data length (1,2,6,8 byte) from the register 0x4C bit 0 to 1...
Definition: bmi160.c:5552
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_flat(u8 *flat)
This API reads the flat status from the register 0x1F bit 7.
Definition: bmi160.c:3220
void(* delay_msec)(BMI160_MDELAY_DATA_TYPE)
Definition: bmi160.h:1161
BMI160_RETURN_FUNCTION_TYPE bmi160_init(struct bmi160_t *bmi160)
This function is used for initialize bus read and bus write functions assign the chip id and device a...
Definition: bmi160.c:142
BMI160_RETURN_FUNCTION_TYPE bmi160_read_fifo_header_data_user_defined_length(u16 v_fifo_user_length_u16, u8 v_mag_if_mag_u8, struct bmi160_fifo_data_header_t *fifo_header_data)
This function used for reading the fifo data of header mode for using user defined length...
Definition: bmi160.c:16219
BMI160_RETURN_FUNCTION_TYPE bmi160_get_nvm_counter(u8 *v_nvm_counter_u8)
This API read the NVM counter form register 0x70 bit 4 to 7.
Definition: bmi160.c:14188
BMI160_RETURN_FUNCTION_TYPE bmi160_set_if_mode(u8 v_if_mode_u8)
This API write I2C interface configuration(if) moe from the register 0x6B bit 4 and 5...
Definition: bmi160.c:13283
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_level(u8 v_channel_u8, u8 v_intr_level_u8)
API used for set the Configure level condition of interrupt1 and interrupt2 pin form the register 0x5...
Definition: bmi160.c:7056
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_time_enable(u8 v_fifo_time_enable_u8)
This API set fifo sensor time frame after the last valid data frame form the register 0x47 bit 1...
Definition: bmi160.c:4898
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_thres(u8 v_tap_thres_u8)
This API write Threshold of the single/double tap interrupt from the register 0x64 bit 0 to 4...
Definition: bmi160.c:11318
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_data_rdy(u8 *v_data_rdy_u8)
This API reads the status of gyro data ready form the register 0x1B bit 6 The status get reset when g...
Definition: bmi160.c:1852
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_fifo_filter_data(u8 v_gyro_fifo_filter_data_u8)
This API is used to set gyro fifo filter data from the register 0x45 bit 3.
Definition: bmi160.c:4566
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_selftest_axis(u8 acc_selftest_axis)
This API write accel select axis to be self-test.
Definition: bmi160.c:13736
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_source(u8 *v_tap_source_u8)
This API reads data source for the interrupt engine for the single and double tap interrupts from the...
Definition: bmi160.c:9298
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_offset_enable(u8 acc_off_en)
This API write the accel offset enable bit from the register 0x77 bit 6.
Definition: bmi160.c:14995
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient(u8 v_channel_u8, u8 v_intr_orient_u8)
Write the Orient interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 and 0...
Definition: bmi160.c:8522
BMI160_RETURN_FUNCTION_TYPE bmi160_set_spi3(u8 v_spi3_u8)
This API write to configure SPI Interface Mode for primary and OIS interface from the register 0x6B b...
Definition: bmi160.c:13026
BMI160_RETURN_FUNCTION_TYPE bmi160_set_step_detector_enable(u8 v_step_intr_u8)
This API is used to set interrupt enable step detector interrupt from the register bit 0x52 bit 3...
Definition: bmi160.c:6817
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_nomotion_intr(u8 *nomo_intr)
This API reads data ready no motion interrupt status from the register 0x1D bit 7 flag is associated ...
Definition: bmi160.c:2607
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_foc_trigger(u8 axis, u8 foc_acc, s8 *accel_offset)
This API writes accel fast offset compensation from the register 0x69 bit 0 to 5. ...
Definition: bmi160.c:12417
BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_x(s16 *v_mag_x_s16, u8 v_sensor_select_u8)
This API reads magnetometer data X values from the register 0x04 and 0x05.
Definition: bmi160.c:666
FIFO used to store the FIFO header less data.
Definition: bmi160.h:1238
BMI160_RETURN_FUNCTION_TYPE bmi160_read_bmm150_mag_trim(void)
This function used for read the trim values of magnetometer.
Definition: bmi160.c:18128
BMI160_RETURN_FUNCTION_TYPE bmi160_get_data_rdy_mag(u8 *v_data_rdy_u8)
This API reads the status of mag data ready from the register 0x1B bit 5 The status get reset when on...
Definition: bmi160.c:1817
BMI160_RETURN_FUNCTION_TYPE bmi160_fifo_data(u8 *v_fifodata_u8, u16 v_fifo_length_u16)
This API reads the fifo data of the sensor from the register 0x24.
Definition: bmi160.c:3350
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_fifo_wm(u8 v_channel_u8, u8 v_intr_fifo_wm_u8)
Write FIFO Watermark interrupt mapped to interrupt1 and interrupt2 form the register 0x56 bit 6 and 2...
Definition: bmi160.c:9091
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_significant_motion_select(u8 *int_sig_mot_sel)
This API is used to select the significant or any motion interrupt from the register 0x62 bit 1...
Definition: bmi160.c:10602
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_high_g_sign(u8 *v_high_g_sign_u8)
This API reads the high sign status from the register 0x1F bit 3.
Definition: bmi160.c:3102
BMI160_RD_FUNC_PTR
Definition: bmi160.h:1159
BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_xyzr(struct bmi160_mag_xyzr_t *mag)
This API reads magnetometer data X,Y,Z,r values from the register 0x04 to 0x0B.
Definition: bmi160.c:1024
BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_x(s16 *v_accel_x_s16)
This API reads accelerometer data X values form the register 0x12 and 0x13.
Definition: bmi160.c:1317
Structure bmm150 mag trim data.
Definition: bmi160.h:1217
BMI160_RETURN_FUNCTION_TYPE bmi160_bmm150_mag_set_power_mode(u8 mag_pow_mode)
This function used for set the magnetometer power mode.
Definition: bmi160.c:17870
unsigned short int u16
Definition: bmi160.h:267
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_any_motion_intr(u8 *v_any_motion_intr_u8)
This API reads the any motion interrupt status from the register 0x1C bit 2 flag is associated with a...
Definition: bmi160.c:2019
BMI160_RETURN_FUNCTION_TYPE bmi160_get_step_config(u16 *v_step_config_u16)
This API Reads step counter configuration from the register 0x7A bit 0 to 7 and from the register 0x7...
Definition: bmi160.c:15165
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_offset_compensation_yaxis(s16 v_gyro_off_y_s16)
This API write gyro manual offset compensation of y axis from the register 0x75 bit 0 to 7 and 0x77 b...
Definition: bmi160.c:14733
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_write_data(u8 *v_mag_write_data_u8)
This API is used to read magnetometer write data form the resister 0x4F bit 0 to 7.
Definition: bmi160.c:5965
BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_z(s16 *v_mag_z_s16, u8 v_sensor_select_u8)
This API reads magnetometer data Z values from the register 0x08 and 0x09.
Definition: bmi160.c:802
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_tag_intr1_enable(u8 v_fifo_tag_intr1_u8)
This API set FIFO tag interrupt1 enable status from the resister 0x47 bit 3.
Definition: bmi160.c:5074
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_wm(u8 v_fifo_wm_u8)
This API is used to Trigger an interrupt when FIFO contains water mark level from the register 0x46 b...
Definition: bmi160.c:4823
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_bw(u8 *v_bw_u8)
This API is used to get the accel bandwidth from the register 0x40 bit 4 to 6.
Definition: bmi160.c:3699
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g_hyst(u8 v_low_hyst_u8)
This API write Low-g interrupt hysteresis from the register 0x5C bit 0 to 1.
Definition: bmi160.c:9749
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_offset_compensation_zaxis(s16 v_gyro_off_z_s16)
This API write gyro manual offset compensation of z axis from the register 0x76 bit 0 to 7 and 0x77 b...
Definition: bmi160.c:14871
BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_y(s16 *v_accel_y_s16)
This API reads accelerometer data Y values form the register 0x14 and 0x15.
Definition: bmi160.c:1363
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_slow_no_motion_durn(u8 *v_slow_no_motion_u8)
This API read Slow/no-motion interrupt trigger delay duration from the register 0x5F bit 2 to 7...
Definition: bmi160.c:10218
BMI160_RETURN_FUNCTION_TYPE bmi160_get_target_page(u8 *v_target_page_u8)
This API read target page from the register 0x7F bit 4 and 5.
Definition: bmi160.c:15631
BMI160_RETURN_FUNCTION_TYPE bmi160_read_fifo_headerless_mode_user_defined_length(u16 v_fifo_user_length_u16, struct bmi160_fifo_data_header_less_t *fifo_data, u8 v_mag_if_mag_u8)
This function used for reading the fifo data of header less mode for using user defined length...
Definition: bmi160.c:16912
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_significant_intr(u8 *sigmot_intr)
This API reads the significant motion interrupt status from the register 0x1C bit 1 flag is associate...
Definition: bmi160.c:1977
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_offset_compensation_xaxis(s16 v_gyro_off_x_s16)
This API write gyro manual offset compensation of x axis from the register 0x74 bit 0 to 7 and 0x77 b...
Definition: bmi160.c:14599
BMI160_RETURN_FUNCTION_TYPE bmi160_set_step_config(u16 v_step_config_u16)
This API write step counter configuration from the register 0x7A bit 0 to 7 and from the register 0x7...
Definition: bmi160.c:15217
BMI160_RETURN_FUNCTION_TYPE bmi160_set_step_counter_enable(u8 v_step_counter_u8)
This API write enable step counter from the register 0x7B bit 3.
Definition: bmi160.c:15316
signed int s32
Definition: bmi160.h:262
BMI160_RETURN_FUNCTION_TYPE bmi160_set_command_register(u8 v_command_reg_u8)
This API writes value to the register 0x7E bit 0 to 7.
Definition: bmi160.c:15601
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_pmu_trigger_intr(u8 *v_pmu_trigger_intr_u8)
This API reads the power mode trigger interrupt status from the register 0x1C bit 3 flag is associate...
Definition: bmi160.c:2063
Structure containing bmm150 and akm09911 magnetometer values for x,y and z-axis in s16...
Definition: bmi160.h:1168
BMI160_RETURN_FUNCTION_TYPE bmi160_accel_foc_trigger_xyz(u8 v_foc_accel_x_u8, u8 v_foc_accel_y_u8, u8 v_foc_accel_z_u8, s8 *acc_off_x, s8 *acc_off_y, s8 *acc_off_z)
This API write fast accel offset compensation it writes all axis together.To the register 0x69 bit 0 ...
Definition: bmi160.c:12633
BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_interface_normal(void)
This API switch mag interface to normal mode and confirm whether the mode switching done successfully...
Definition: bmi160.c:619
BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_z(s16 *v_accel_z_s16)
This API reads accelerometer data Z values form the register 0x16 and 0x17.
Definition: bmi160.c:1409
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_fifo_wm(u8 v_channel_u8, u8 *v_intr_fifo_wm_u8)
Reads FIFO Watermark interrupt mapped to interrupt1 and interrupt2 form the register 0x56 bit 6 and 2...
Definition: bmi160.c:9026
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_gyro_enable(u8 *v_fifo_gyro_u8)
This API is used to read stored gyro data in FIFO (all 3 axes) from the resister 0x47 bit 7...
Definition: bmi160.c:5385
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_thres(u8 *v_tap_thres_u8)
This API read Threshold of the single/double tap interrupt from the register 0x64 bit 0 to 4...
Definition: bmi160.c:11275
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g_mode(u8 v_low_g_mode_u8)
This API write Low-g interrupt mode from the register 0x5C bit 2.
Definition: bmi160.c:9829
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_high_source(u8 *v_low_high_source_u8)
This API Reads Data source for the interrupt engine for the low and high g interrupts from the regist...
Definition: bmi160.c:9385
bmi160 structure This structure holds all relevant information about bmi160
Definition: bmi160.h:1154
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_enable_2(u8 enable, u8 *v_intr_enable_2_u8)
This API is used to read interrupt enable byte2 from the register bit 0x52 bit 0 to 3...
Definition: bmi160.c:6618
BMI160_RETURN_FUNCTION_TYPE bmi160_set_pullup_configuration(u8 v_control_pullup_u8)
This API write pull up configuration from the register 0X85 bit 4 an 5.
Definition: bmi160.c:15840
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_manual_enable(u8 *v_mag_manual_u8)
This API is used to read Enable register access on MAG_IF[2] or MAG_IF[3] writes. This implies that t...
Definition: bmi160.c:5725
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_enable_1(u8 enable, u8 v_intr_enable_1_u8)
This API is used to set interrupt enable byte1 from the register 0x51 bit 0 to 6. ...
Definition: bmi160.c:6454
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_data_rdy_intr(u8 *v_data_rdy_intr_u8)
This API reads data ready interrupt status from the register 0x1D bit 4 flag is associated with a spe...
Definition: bmi160.c:2462
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient(u8 v_channel_u8, u8 *v_intr_orient_u8)
Reads the Orient interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 and 0...
Definition: bmi160.c:8461
BMI160_RETURN_FUNCTION_TYPE bmi160_set_output_enable(u8 v_channel_u8, u8 v_output_enable_u8)
API used to set the Output enable for interrupt1 and interrupt2 pin from the register 0x53...
Definition: bmi160.c:7326
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_orient_z(u8 *v_orient_z_u8)
This API reads the status of orient z plane from the register 0x1F bit 6.
Definition: bmi160.c:3181
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_flat_hyst(u8 *v_flat_hyst_u8)
This API read flat interrupt hysteresis from the register 0x68 bit 0 to 3.
Definition: bmi160.c:12056
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_any_motion_thres(u8 v_any_motion_thres_u8)
This API is used to write threshold definition for the any-motion interrupt from the register 0x60 bi...
Definition: bmi160.c:10371
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_theta(u8 v_orient_theta_u8)
This API write Orient blocking angle (0 to 44.8) from the register 0x66 bit 0 to 5.
Definition: bmi160.c:11671
BMI160_RETURN_FUNCTION_TYPE bmi160_set_nvm_counter(u8 v_nvm_counter_u8)
This API write the NVM counter form register 0x70 bit 4 to 7.
Definition: bmi160.c:14222
BMI160_RETURN_FUNCTION_TYPE bmi160_get_paging_enable(u8 *v_page_enable_u8)
This API read page enable from the register 0x7F bit 7.
Definition: bmi160.c:15716
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_sleep_state(u8 v_gyro_sleep_state_u8)
This API write Target state for gyro sleep mode from the register 0x6C bit 5.
Definition: bmi160.c:13560
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_tap_first_z(u8 *v_tap_first_z_u8)
This API reads the tap first z interrupt status from the register 0x1E bit 6.
Definition: bmi160.c:2893
BMI160_RETURN_FUNCTION_TYPE bmi160_get_step_counter_enable(u8 *v_step_counter_u8)
This API read enable step counter from the register 0x7B bit 3.
Definition: bmi160.c:15283
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_significant_motion_skip(u8 *v_int_sig_mot_skip_u8)
This API is used to read the significant skip time from the register 0x62 bit 2 and 3...
Definition: bmi160.c:10779
#define BMI160_RETURN_FUNCTION_TYPE
Definition: bmi160.h:748
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_any_motion_first_y(u8 *v_any_motion_first_y_u8)
This API reads the status of any motion first y interrupt from the register 0x1E bit 1...
Definition: bmi160.c:2686
BMI160_RETURN_FUNCTION_TYPE bmi160_set_input_enable(u8 v_channel_u8, u8 v_input_en_u8)
API used to set input enable for interrupt1 and interrupt2 pin from the register 0x54.
Definition: bmi160.c:7580
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_shock(u8 v_tap_shock_u8)
This API write the tap shock duration from the register 0x63 bit 2.
Definition: bmi160.c:11136
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_flat_hold(u8 v_flat_hold_u8)
This API write Flat interrupt hold time; from the register 0x68 bit 4 and 5.
Definition: bmi160.c:12011
BMI160_WR_FUNC_PTR
Definition: bmi160.h:1158
BMI160_RETURN_FUNCTION_TYPE bmi160_set_i2c_device_addr(u8 v_i2c_device_addr_u8)
This API is used to set I2C device address of auxiliary mag from the register 0x4B bit 1 to 7...
Definition: bmi160.c:5507
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_sleep_trigger(u8 v_gyro_sleep_trigger_u8)
This API write gyro sleep trigger from the register 0x6C bit 0 to 2.
Definition: bmi160.c:13383
BMI160_RETURN_FUNCTION_TYPE bmi160_get_pullup_configuration(u8 *v_control_pullup_u8)
This API read pull up configuration from the register 0X85 bit 4 an 5.
Definition: bmi160.c:15803
BMI160_RETURN_FUNCTION_TYPE bmi160_read_fifo_header_data(u8 v_mag_if_u8, struct bmi160_fifo_data_header_t *header_data)
This function used for reading the fifo data of header mode.
Definition: bmi160.c:16180
BMI160_RETURN_FUNCTION_TYPE bmi160_get_output_enable(u8 v_channel_u8, u8 *v_output_enable_u8)
API used to get the Output enable for interrupt1 and interrupt2 pin from the register 0x53...
Definition: bmi160.c:7265
BMI160_RETURN_FUNCTION_TYPE bmi160_get_spare0_trim(u8 *v_spare0_trim_u8)
This API read the spare zero form register 0x70 bit 3.
Definition: bmi160.c:14113
BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_read_addr(u8 v_mag_read_addr_u8)
This API is used to set magnetometer write address from the register 0x4D bit 0 to 7...
Definition: bmi160.c:5859
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g(u8 v_channel_u8, u8 v_intr_low_g_u8)
set the Low g interrupt mapped to interrupt1 and interrupt2 from the register 0x55 and 0x57 ...
Definition: bmi160.c:7710
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_enable_0(u8 enable, u8 v_intr_enable_zero_u8)
This API is used to set interrupt enable from the register 0x50 bit 0 to 7.
Definition: bmi160.c:6176
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_power_mode_stat(u8 *v_accel_power_mode_stat_u8)
This API reads the accelerometer power mode from PMU status register 0x03 bit 4 and 5...
Definition: bmi160.c:590
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_high_g_first_y(u8 *v_high_g_first_y_u8)
This API reads the high_g first y status from the register 0x1F bit 1.
Definition: bmi160.c:3018
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_shock(u8 *v_tap_shock_u8)
This API read the tap shock duration from the register 0x63 bit 2.
Definition: bmi160.c:11099
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_mag_enable(u8 *v_fifo_mag_u8)
This API is used to read stored magnetometer data in FIFO (all 3 axes) from the register 0x47 bit 5...
Definition: bmi160.c:5208
BMI160_RETURN_FUNCTION_TYPE bmi160_get_i2c_fail_err(u8 *v_i2c_error_code_u8)
This API Reads the i2c error code from the Register 0x02 bit 5. This error occurred in I2C master det...
Definition: bmi160.c:321
BMI160_RETURN_FUNCTION_TYPE bmi160_read_mag_xyz(struct bmi160_mag_t *mag, u8 v_sensor_select_u8)
This API reads magnetometer data X,Y,Z values from the register 0x04 to 0x09.
Definition: bmi160.c:914
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fatal_err(u8 *v_fatal_err_u8)
This API used to reads the fatal error from the Register 0x02 bit 0 This flag will be reset only by p...
Definition: bmi160.c:243
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_selftest_start(u8 v_gyro_selftest_start_u8)
This API write gyro self test trigger.
Definition: bmi160.c:13987
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_output_data_rate(u8 v_output_data_rate_u8, u8 v_accel_bw_u8)
This API is used to set the accel output date rate form the register 0x40 bit 0 to 3...
Definition: bmi160.c:3481
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_wakeup_trigger(u8 v_gyro_wakeup_trigger_u8)
This API write gyro wakeup trigger from the register 0x6C bit 3 and 4.
Definition: bmi160.c:13473
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_fifo_wm_intr(u8 *v_fifo_wm_intr_u8)
This API reads data ready FIFO watermark interrupt status from the register 0x1D bit 6 flag is associ...
Definition: bmi160.c:2553
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_any_motion_durn(u8 nomotion)
This API write any motion duration from the register 0x5F bit 0 and 1.
Definition: bmi160.c:10170
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_slow_no_motion_durn(u8 v_slow_no_motion_u8)
This API write Slow/no-motion interrupt trigger delay duration from the register 0x5F bit 2 to 7...
Definition: bmi160.c:10260
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_wm(u8 *v_fifo_wm_u8)
This API is used to Trigger an interrupt when FIFO contains water mark level from the register 0x46 b...
Definition: bmi160.c:4787
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_output_data_rate(u8 *odr)
This API is used to get the output data rate of magnetometer from the register 0x44 bit 0 to 3...
Definition: bmi160.c:4332
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_sleep_state(u8 *v_gyro_sleep_state_u8)
This API read Target state for gyro sleep mode from the register 0x6C bit 5.
Definition: bmi160.c:13522
unsigned int u32
Definition: bmi160.h:268
Structure containing accel gyro data and sensor time.
Definition: bmi160.h:1201
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_mag_enable(u8 v_fifo_mag_u8)
This API is used to set stored magnetometer data in FIFO (all 3 axes) from the register 0x47 bit 5...
Definition: bmi160.c:5244
BMI160_RETURN_FUNCTION_TYPE bmi160_get_step_detector_enable(u8 *v_step_intr_u8)
This API is used to read interrupt enable step detector interrupt from the register bit 0x52 bit 3...
Definition: bmi160.c:6779
unsigned char u8
Definition: bmi160.h:266
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_tag_intr2_enable(u8 v_fifo_tag_intr2_u8)
This API set FIFO tag interrupt2 enable status from the resister 0x47 bit 2.
Definition: bmi160.c:4988
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_flat_hold(u8 *v_flat_hold_u8)
This API read Flat interrupt hold time; from the register 0x68 bit 4 and 5.
Definition: bmi160.c:11972
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_enable_0(u8 enable, u8 *v_intr_enable_zero_u8)
This API is used to read interrupt enable from the register 0x50 bit 0 to 7.
Definition: bmi160.c:6050
BMI160_RETURN_FUNCTION_TYPE bmi160_get_spi_enable(u8 *v_spi_enable_u8)
This API read primary interface selection I2C or SPI from the register 0x70 bit 0.
Definition: bmi160.c:14036
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_header_enable(u8 v_fifo_header_u8)
This API set FIFO frame header enable from the register 0x47 bit 4.
Definition: bmi160.c:5160
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_output_data_rate(u8 *gyro_output_typer)
This API is used to get the gyroscope output data rate from the register 0x42 bit 0 to 3...
Definition: bmi160.c:4023
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_slow_no_motion_select(u8 v_intr_slow_no_motion_select_u8)
This API is used to write the slow/no-motion selection from the register 0x62 bit 0...
Definition: bmi160.c:10550
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_any_motion(u8 v_channel_u8, u8 v_intr_any_motion_u8)
Write the Any motion interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 a...
Definition: bmi160.c:7988
BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yamaha_yas537_calib_values(u8 v_rcoil_u8)
This function used for read the YAMAHA YAS537 calibration data.
Definition: bmi160.c:20109
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_offset_compensation_xaxis(s16 *v_gyro_off_x_s16)
This API read gyro manual offset compensation of x axis from the register 0x74 bit 0 to 7 and 0x77 bi...
Definition: bmi160.c:14547
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_edge_ctrl(u8 v_channel_u8, u8 *v_intr_edge_ctrl_u8)
Configure trigger condition of interrupt1 and interrupt2 pin from the register 0x53.
Definition: bmi160.c:6868
BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yas537_acquisition_command_register(u8 v_command_reg_data_u8)
This function used for YAS537 write data acquisition command register write.
Definition: bmi160.c:20473
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_range(u8 v_range_u8)
This API set the range of gyro from the register 0x43 bit 0 to 2.
Definition: bmi160.c:4267
BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_rdy(u8 *v_foc_rdy_u8)
This API reads the fast offset compensation status form the register 0x1B bit 3.
Definition: bmi160.c:1744
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_high_g_intr(u8 *v_high_g_intr_u8)
This API reads the high_g interrupt status from the register 0x1D bit 2 flag is associated with a spe...
Definition: bmi160.c:2358
BMI160_RETURN_FUNCTION_TYPE bmi160_set_spi_enable(u8 v_spi_enable_u8)
This API write primary interface selection I2C or SPI from the register 0x70 bit 0.
Definition: bmi160.c:14072
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_significant_motion_proof(u8 int_sig_mot_proof)
This API is used to write the significant proof time from the register 0x62 bit 4 and 5...
Definition: bmi160.c:10919
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_offset_enable(u8 v_gyro_off_enable_u8)
This API write the accel offset enable bit from the register 0x77 bit 7.
Definition: bmi160.c:15080
#define YAS532_MAG_TEMPERATURE_LOG
Definition: bmi160.h:985
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_orient_xy(u8 *v_orient_xy_u8)
This API reads the status of orient_xy plane from the register 0x1F bit 4 and 5.
Definition: bmi160.c:3143
Structure containing gyro xyz data.
Definition: bmi160.h:1185
signed short int s16
Definition: bmi160.h:261
BMI160_RETURN_FUNCTION_TYPE bmi160_unmap_significant_motion_intr(u8 v_significant_u8)
This API used to unmap the signification motion interrupt.
Definition: bmi160.c:10700
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_fifo_filter_data(u8 *v_gyro_fifo_filter_data_u8)
This API is used to read gyro fifo filter data from the register 0x45 bit 3.
Definition: bmi160.c:4527
s32 bmi160_bmm150_mag_compensate_Y(s16 v_mag_data_y_s16, u16 v_data_r_u16)
This API used to get the compensated BMM150-Y data the out put of Y as s32 Before start reading the m...
Definition: bmi160.c:17493
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_accel_enable(u8 *v_fifo_accel_u8)
This API is used to read stored accel data in FIFO (all 3 axes) from the register 0x47 bit 6...
Definition: bmi160.c:5297
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_single_tap(u8 v_channel_u8, u8 *v_intr_single_tap_u8)
Reads the Single Tap interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 a...
Definition: bmi160.c:8328
BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yamaha_yas537_measure_xyz_data(u8 *v_ouflow_u8, struct yas_vector *vector_xyz)
This function used for read the YAMAHA YAS537 xy1y2 data.
Definition: bmi160.c:20676
BMI160_RETURN_FUNCTION_TYPE bmi160_read_gyro_x(s16 *v_gyro_x_s16)
This API reads gyro data X values form the register 0x0C and 0x0D.
Definition: bmi160.c:1111
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_flat(u8 v_channel_u8, u8 v_intr_flat_u8)
Write the Flat interrupt mapped to interrupt1 and interrupt2 from the register 0x55 and 0x57...
Definition: bmi160.c:8661
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_tag_intr2_enable(u8 *v_fifo_tag_intr2_u8)
This API reads FIFO tag interrupt2 enable status from the resister 0x47 bit 2.
Definition: bmi160.c:4949
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_flat_theta(u8 v_flat_theta_u8)
This API write Flat angle (0 to 44.8) for flat interrupt from the register 0x67 bit 0 to 5...
Definition: bmi160.c:11922
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g_durn(u8 *v_low_durn_u8)
This API is used to read the low_g duration from register 0x5A bit 0 to 7.
Definition: bmi160.c:9562
BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_gyro_sensor_time(u8 accel_gyro_sensortime_select, struct bmi160_sensortime_accel_gyro_data *accel_gyro_sensor_time)
This API reads sensor_time ,Accel data ,Gyro data from the register 0x0C to 0x1A. ...
Definition: bmi160.c:1566
YAMAHA-YAS532 struct Calibration YAS532 data struct.
Definition: bmi160.h:11742
signed short int s16
Definition: bma2x2.h:187
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_offset_compensation_zaxis(s8 *v_accel_off_z_s8)
This API read accel manual offset compensation of z axis from the register 0x73 bit 0 to 7...
Definition: bmi160.c:14452
BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_accel_x(u8 *v_foc_accel_x_u8)
This API read accel offset compensation target value for x-axis is from the register 0x69 bit 4 and 5...
Definition: bmi160.c:12316
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_down_gyro(u8 v_fifo_down_gyro_u8)
This API is used to set Down sampling for gyro (2**downs_gyro) in the register 0x45 bit 0 to 2...
Definition: bmi160.c:4480
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_any_motion_thres(u8 *v_any_motion_thres_u8)
This API is used to read threshold definition for the any-motion interrupt from the register 0x60 bit...
Definition: bmi160.c:10319
BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_offset(u8 v_mag_offset_u8)
This API is used to set trigger-readout offset in units of 2.5 ms. If set to zero, the offset is maximum, i.e. after readout a trigger is issued immediately. from the register 0x4C bit 2 to 5.
Definition: bmi160.c:5675
BMI160_RETURN_FUNCTION_TYPE bmi160_read_step_count(s16 *v_step_cnt_s16)
This API reads step counter value form the register 0x78 and 0x79.
Definition: bmi160.c:15124
BMI160_RETURN_FUNCTION_TYPE bmi160_read_gyro_z(s16 *v_gyro_z_s16)
This API reads gyro data Z values form the register 0x10 and 0x11.
Definition: bmi160.c:1202
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_bw(u8 v_bw_u8)
This API is used to set the accel bandwidth from the register 0x40 bit 4 to 6.
Definition: bmi160.c:3763
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_double_tap(u8 v_channel_u8, u8 v_intr_double_tap_u8)
Write the Double Tap interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 a...
Definition: bmi160.c:8256
BMI160_RETURN_FUNCTION_TYPE bmi160_get_input_enable(u8 v_channel_u8, u8 *v_input_en_u8)
API used to get input enable for interrupt1 and interrupt2 pin from the register 0x54.
Definition: bmi160.c:7520
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_high_g(u8 v_channel_u8, u8 v_intr_high_g_u8)
Write the HIGH g interrupt mapped to interrupt1 and interrupt2 from the register 0x55 and 0x57...
Definition: bmi160.c:7856
unsigned char u8
Definition: bma2x2.h:192
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_significant_motion_select(u8 int_sig_mot_sel)
This API is used to write, select the significant or any motion interrupt from the register 0x62 bit ...
Definition: bmi160.c:10644
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_offset_compensation_yaxis(s8 *v_accel_off_y_s8)
This API read accel manual offset compensation of y axis from the register 0x72 bit 0 to 7...
Definition: bmi160.c:14359
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_any_motion_first_x(u8 *v_anymotion_first_x_u8)
This API reads the status of any motion first x from the register 0x1E bit 0.
Definition: bmi160.c:2645
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_tag_intr1_enable(u8 *v_fifo_tag_intr1_u8)
This API get FIFO tag interrupt1 enable status from the resister 0x47 bit 3.
Definition: bmi160.c:5038
BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yamaha_yas537_read_xy1y2_data(u8 *v_coil_stat_u8, u8 *v_busy_u8, u16 *v_temperature_u16, u16 *xy1y2, u8 *v_ouflow_u8)
This function used for read the YAMAHA YAS537 xy1y2 data.
Definition: bmi160.c:20541
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat3_high_g_first_x(u8 *v_high_g_first_x_u8)
This API reads the high_g first x status from the register 0x1F bit 0.
Definition: bmi160.c:2976
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g_mode(u8 *v_low_g_mode_u8)
This API reads Low-g interrupt mode from the register 0x5C bit 2.
Definition: bmi160.c:9793
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_hyst(u8 *v_orient_hyst_u8)
This API read Orient interrupt hysteresis, from the register 0x64 bit 4 to 7.
Definition: bmi160.c:11556
BMI160_RETURN_FUNCTION_TYPE bmi160_get_drop_cmd_err(u8 *v_drop_cmd_err_u8)
This API Reads the dropped command error from the register 0x02 bit 6.
Definition: bmi160.c:355
BMI160_RETURN_FUNCTION_TYPE bmi160_fifo_length(u32 *v_fifo_length_u32)
This API reads the of the sensor form the register 0x23 and 0x24 bit 0 to 7 and 0 to 2...
Definition: bmi160.c:3299
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_nomotion(u8 v_channel_u8, u8 v_intr_nomotion_u8)
Write the No motion interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 an...
Definition: bmi160.c:8127
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_offset_compensation_yaxis(s16 *v_gyro_off_y_s16)
This API read gyro manual offset compensation of y axis from the register 0x75 bit 0 to 7 and 0x77 bi...
Definition: bmi160.c:14681
BMI160_RETURN_FUNCTION_TYPE bmi160_second_if_mag_compensate_xyz(struct bmi160_mag_fifo_data_t mag_fifo_data, u8 v_mag_second_if_u8)
This function used for reading the compensated data of mag secondary interface xyz data...
Definition: bmi160.c:15892
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g_thres(u8 *v_low_g_thres_u8)
This API is used to read Threshold definition for the low-g interrupt from the register 0x5B bit 0 to...
Definition: bmi160.c:9641
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_tap_first_y(u8 *v_tap_first_y_u8)
This API reads the tap first y interrupt status from the register 0x1E bit 5.
Definition: bmi160.c:2851
BMI160_RETURN_FUNCTION_TYPE bmi160_get_error_status(u8 *v_fatal_er_u8r, u8 *v_err_code_u8, u8 *v_i2c_fail_err_u8, u8 *v_drop_cmd_err_u8, u8 *v_mag_data_rdy_err_u8)
This API reads the error status from the error register 0x02 bit 0 to 7.
Definition: bmi160.c:433
BMI160_RETURN_FUNCTION_TYPE bmi160_set_step_mode(u8 v_step_mode_u8)
This API set Step counter modes.
Definition: bmi160.c:15365
s32 bmi160_bmm150_mag_compensate_Z(s16 v_mag_data_z_s16, u16 v_data_r_u16)
This API used to get the compensated BMM150-Z data the out put of Z as s32 Before start reading the m...
Definition: bmi160.c:17558
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_single_tap_intr(u8 *v_single_tap_intr_u8)
This API reads the single tab status from the register 0x1C bit 5 flag is associated with a specific ...
Definition: bmi160.c:2181
BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_burst(u8 v_mag_burst_u8)
This API is used to set Burst data length (1,2,6,8 byte) from the register 0x4C bit 0 to 1...
Definition: bmi160.c:5589
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_tap_sign(u8 *tap_sign)
This API reads the tap sign status from the register 0x1E bit 7.
Definition: bmi160.c:2934
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_high_g_durn(u8 *v_high_g_durn_u8)
This API is used to read Delay time definition for the high-g interrupt from the register 0x5D bit 0 ...
Definition: bmi160.c:9967
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_gyro_enable(u8 v_fifo_gyro_u8)
This API is used to set stored gyro data in FIFO (all 3 axes) from the resister 0x47 bit 7...
Definition: bmi160.c:5423
BMI160_RETURN_FUNCTION_TYPE bmi160_get_temp(s16 *v_temp_s16)
This API reads the temperature of the sensor from the register 0x21 bit 0 to 7.
Definition: bmi160.c:3256
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_slow_no_motion_select(u8 *v_intr_slow_no_motion_select_u8)
This API is used to read the slow/no-motion selection from the register 0x62 bit 0.
Definition: bmi160.c:10509
BMI160_RETURN_FUNCTION_TYPE bmi160_get_i2c_device_addr(u8 *v_i2c_device_addr_u8)
This API is used to read I2C device address of auxiliary mag from the register 0x4B bit 1 to 7...
Definition: bmi160.c:5471
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_fifo_full_intr(u8 *v_fifo_full_intr_u8)
This API reads data ready FIFO full interrupt status from the register 0x1D bit 5 flag is associated ...
Definition: bmi160.c:2507
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_mode(u8 *v_orient_mode_u8)
This API read the threshold for orientation interrupt from the register 0x65 bit 0 and 1...
Definition: bmi160.c:11365
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_write_addr(u8 *v_mag_write_addr_u8)
This API is used to read magnetometer write address from the register 0x4E bit 0 to 7...
Definition: bmi160.c:5893
unsigned int u32
Definition: bma2x2.h:194
BMI160_RETURN_FUNCTION_TYPE bmi160_set_foc_accel_z(u8 v_foc_accel_z_u8)
This API write accel offset compensation target value for z-axis from the register 0x69 bit 0 and 1...
Definition: bmi160.c:12177
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_flat_theta(u8 *v_flat_theta_u8)
This API read Flat angle (0 to 44.8) for flat interrupt from the register 0x67 bit 0 to 5...
Definition: bmi160.c:11888
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat1_low_g_intr(u8 *v_low_g_intr_u8)
This API reads the low g interrupt status from the register 0x1D bit 3 flag is associated with a spec...
Definition: bmi160.c:2415
BMI160_RETURN_FUNCTION_TYPE bmi160_read_reg(u8 v_addr_u8, u8 *v_data_u8, u8 v_len_u8)
This API reads the data from the given register.
Definition: bmi160.c:211
BMI160_RETURN_FUNCTION_TYPE bmi160_bmm150_mag_interface_init(u8 *v_chip_id_u8)
This function used for initialize the bmm150 sensor.
Definition: bmi160.c:17594
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_power_mode_stat(u8 *v_mag_power_mode_stat_u8)
This API reads the magnetometer power mode from PMU status register 0x03 bit 0 and 1...
Definition: bmi160.c:499
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_edge_ctrl(u8 v_channel_u8, u8 v_intr_edge_ctrl_u8)
Configure trigger condition of interrupt1 and interrupt2 pin from the register 0x53.
Definition: bmi160.c:6926
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_output_type(u8 v_channel_u8, u8 *v_intr_output_type_u8)
API used to get configured output enable of interrupt1 and interrupt2 from the register 0x53...
Definition: bmi160.c:7129
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_motion_source(u8 v_motion_source_u8)
This API write Data source for the interrupt engine for the nomotion and anymotion interrupts from th...
Definition: bmi160.c:9510
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_blocking(u8 v_orient_blocking_u8)
This API write the orient blocking mode that is used for the generation of the orientation interrupt...
Definition: bmi160.c:11507
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_any_motion_first_z(u8 *v_any_motion_first_z_u8)
This API reads the status of any motion first z interrupt from the register 0x1E bit 2...
Definition: bmi160.c:2728
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_fifo_filter_data(u8 v_accel_fifo_filter_u8)
This API is used to set accel fifo filter data from the register 0x45 bit 7.
Definition: bmi160.c:4739
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_ud_enable(u8 *v_orient_ud_u8)
This API read orient change of up/down bit from the register 0x66 bit 6.
Definition: bmi160.c:11719
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_under_sampling_parameter(u8 v_accel_under_sampling_u8)
This API is used to set the accel under sampling parameter form the register 0x40 bit 7...
Definition: bmi160.c:3858
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_mode(u8 v_orient_mode_u8)
This API write the threshold for orientation interrupt from the register 0x65 bit 0 and 1...
Definition: bmi160.c:11405
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_fifo_full(u8 v_channel_u8, u8 v_intr_fifo_full_u8)
Write FIFO Full interrupt mapped to interrupt1 and interrupt2 form the register 0x56 bit 5 and 1...
Definition: bmi160.c:8945
BMI160_RETURN_FUNCTION_TYPE bmi160_get_nvm_rdy(u8 *v_nvm_rdy_u8)
This API Reads the nvm_rdy status from the resister 0x1B bit 4.
Definition: bmi160.c:1782
BMI160_RETURN_FUNCTION_TYPE bmi160_get_if_mode(u8 *v_if_mode_u8)
This API read I2C interface configuration(if) moe from the register 0x6B bit 4 and 5...
Definition: bmi160.c:13244
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_data_rdy(u8 *drdy_acc)
This API reads the status of accel data ready form the register 0x1B bit 7 The status get reset when ...
Definition: bmi160.c:1887
BMI160_RETURN_FUNCTION_TYPE bmi160_set_gyro_wakeup_intr(u8 v_gyro_wakeup_intr_u8)
This API write gyro wakeup interrupt from the register 0x6C bit 6.
Definition: bmi160.c:13646
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_source(u8 v_tap_source_u8)
This API write data source for the interrupt engine for the single and double tap interrupts from the...
Definition: bmi160.c:9336
signed int s32
Definition: bma2x2.h:188
BMI160_RETURN_FUNCTION_TYPE bmi160_read_accel_xyz(struct bmi160_accel_t *accel)
This API reads accelerometer data X,Y,Z values from the register 0x12 to 0x17.
Definition: bmi160.c:1455
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_offset_enable(u8 *acc_off_en)
This API read the accel offset enable bit from the register 0x77 bit 6.
Definition: bmi160.c:14956
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_high_source(u8 v_low_high_source_u8)
This API write Data source for the interrupt engine for the low and high g interrupts from the regist...
Definition: bmi160.c:9423
s8 mag_manual_enable
Definition: bmi160.h:1157
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_double_tap(u8 v_channel_u8, u8 *v_intr_double_tap_u8)
Reads the Double Tap interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 a...
Definition: bmi160.c:8198
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_orient_ud_enable(u8 v_orient_ud_u8)
This API write orient change of up/down bit from the register 0x66 bit 6.
Definition: bmi160.c:11757
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_slow_no_motion_thres(u8 *v_slow_no_motion_thres_u8)
This API is used to read threshold for the slow/no-motion interrupt from the register 0x61 bit 0 to 7...
Definition: bmi160.c:10420
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_theta(u8 *v_orient_theta_u8)
This API read Orient blocking angle (0 to 44.8) from the register 0x66 bit 0 to 5.
Definition: bmi160.c:11636
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_high_g_thres(u8 v_high_g_thres_u8)
This API is used to write Threshold definition for the high-g interrupt from the register 0x5E 0 to 7...
Definition: bmi160.c:10105
BMI160_RETURN_FUNCTION_TYPE bmi160_set_bmm150_mag_and_secondary_if_power_mode(u8 v_mag_sec_if_pow_mode_u8)
This function used for set the magnetometer power mode.
Definition: bmi160.c:17780
#define BMI160_FIFO_FRAME_CNT
Definition: bmi160.h:1144
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_any_motion_durn(u8 *v_any_motion_durn_u8)
This API reads any motion duration from the register 0x5F bit 0 and 1.
Definition: bmi160.c:10135
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_time_enable(u8 *v_fifo_time_enable_u8)
This API reads fifo sensor time frame after the last valid data frame form the register 0x47 bit 1...
Definition: bmi160.c:4859
Structure containing bmm150 xyz data and temperature.
Definition: bmi160.h:1176
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_axes_enable(u8 *v_orient_axes_u8)
This API read orientation axes changes from the register 0x66 bit 7.
Definition: bmi160.c:11805
signed char s8
If your machine support 16 bit define the MACHINE_16_BIT.
Definition: bma2x2.h:186
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_offset_compensation_yaxis(s8 v_accel_off_y_s8)
This API write accel manual offset compensation of y axis from the register 0x72 bit 0 to 7...
Definition: bmi160.c:14396
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_output_type(u8 v_channel_u8, u8 v_intr_output_type_u8)
API used to set output enable of interrupt1 and interrupt2 from the register 0x53.
Definition: bmi160.c:7190
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_enable_1(u8 enable, u8 *v_intr_enable_1_u8)
This API is used to read interrupt enable byte1 from the register 0x51 bit 0 to 6.
Definition: bmi160.c:6340
BMI160_RETURN_FUNCTION_TYPE bmi160_map_step_detector_intr(u8 v_step_detector_u8)
This API used to trigger the step detector interrupt.
Definition: bmi160.c:15491
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_selftest_start(u8 *v_gyro_selftest_start_u8)
This API read gyro self test trigger.
Definition: bmi160.c:13955
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_high_g_thres(u8 *v_high_g_thres_u8)
This API is used to read Threshold definition for the high-g interrupt from the register 0x5E 0 to 7...
Definition: bmi160.c:10054
BMI160_RETURN_FUNCTION_TYPE bmi160_bst_yamaha_yas537_fifo_xyz_data(u16 *a_xy1y2_u16, u8 v_over_flow_u8, u8 v_rcoil_u8, u8 v_busy_u8)
This function used for read the YAMAHA YAS537 xy1y2 data of fifo.
Definition: bmi160.c:20774
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_offset_compensation_xaxis(s8 v_accel_off_x_s8)
This API write accel manual offset compensation of x axis from the register 0x71 bit 0 to 7...
Definition: bmi160.c:14303
BMI160_RETURN_FUNCTION_TYPE bmi160_get_err_code(u8 *v_error_code_u8)
This API used to read the error code from register 0x02 bit 1 to 4.
Definition: bmi160.c:287
BMI160_RETURN_FUNCTION_TYPE bmi160_get_fifo_down_gyro(u8 *v_fifo_down_gyro_u8)
This API is used to read Down sampling for gyro (2**downs_gyro) in the register 0x45 bit 0 to 2...
Definition: bmi160.c:4444
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_nomotion(u8 v_channel_u8, u8 *v_intr_nomotion_u8)
Reads the No motion interrupt interrupt mapped to interrupt1 and interrupt2 from the register 0x55 an...
Definition: bmi160.c:8067
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_bw(u8 *v_bw_u8)
This API is used to get the data of gyro from the register 0x42 bit 4 to 5.
Definition: bmi160.c:4138
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_low_g(u8 v_channel_u8, u8 *v_intr_low_g_u8)
reads the Low g interrupt mapped to interrupt1 and interrupt2 from the register 0x55 and 0x57 ...
Definition: bmi160.c:7650
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_high_g_hyst(u8 *v_high_g_hyst_u8)
This API reads High-g interrupt hysteresis from the register 0x5C bit 6 and 7.
Definition: bmi160.c:9881
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_offset_enable(u8 *v_gyro_off_enable_u8)
This API read the accel offset enable bit from the register 0x77 bit 7.
Definition: bmi160.c:15041
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_manual_operation_stat(u8 *v_mag_manual_stat_u8)
This API reads the status of mag manual interface operation form the register 0x1B bit 2...
Definition: bmi160.c:1709
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_pmu_trig(u8 v_channel_u8, u8 *v_intr_pmu_trig_u8)
Reads PMU trigger interrupt mapped to interrupt1 and interrupt2 form the register 0x56 bit 0 and 4...
Definition: bmi160.c:8739
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_data_rdy(u8 v_channel_u8, u8 v_intr_data_rdy_u8)
Write Data Ready interrupt mapped to interrupt1 and interrupt2 form the register 0x56.
Definition: bmi160.c:9230
BMI160_RETURN_FUNCTION_TYPE bmi160_set_fifo_accel_enable(u8 v_fifo_accel_u8)
This API is used to set stored accel data in FIFO (all 3 axes) from the register 0x47 bit 6...
Definition: bmi160.c:5336
Structure containing accel xyz data.
Definition: bmi160.h:1193
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat0_orient_intr(u8 *v_orient_intr_u8)
This API reads the orient status from the register 0x1C bit 6 flag is associated with a specific inte...
Definition: bmi160.c:2243
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_wakeup_intr(u8 *v_gyro_wakeup_intr_u8)
This API read gyro wakeup interrupt from the register 0x6C bit 6.
Definition: bmi160.c:13608
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_fifo_full(u8 v_channel_u8, u8 *v_intr_fifo_full_u8)
Reads FIFO Full interrupt mapped to interrupt1 and interrupt2 form the register 0x56 bit 5 and 1...
Definition: bmi160.c:8881
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_motion_source(u8 *v_motion_source_u8)
This API reads Data source for the interrupt engine for the nomotion and anymotion interrupts from th...
Definition: bmi160.c:9472
BMI160_RETURN_FUNCTION_TYPE bmi160_set_latch_intr(u8 v_latch_intr_u8)
This API is used to set the latch duration from the register 0x54 bit 0 to 3.
Definition: bmi160.c:7465
BMI160_RETURN_FUNCTION_TYPE bmi160_bmm150_mag_compensate_xyz(struct bmi160_mag_xyz_s32_t *mag_comp_xyz)
This function used for read the compensated value of mag Before start reading the mag compensated dat...
Definition: bmi160.c:17376
BMI160_RETURN_FUNCTION_TYPE bmi160_get_gyro_selftest(u8 *v_gyro_selftest_u8)
This API reads the Gyroscope self test status from the register 0x1B bit 1.
Definition: bmi160.c:1670
BMI160_RETURN_FUNCTION_TYPE bmi160_get_nvm_prog_enable(u8 *v_nvm_prog_u8)
This API read NVM program enable from the register 0x6A bit 1.
Definition: bmi160.c:12903
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_quiet(u8 v_tap_quiet_u8)
This API write tap quiet duration from the register 0x63 bit 7.
Definition: bmi160.c:11223
u8 chip_id
Definition: bmi160.h:1155
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_significant_motion_proof(u8 *int_sig_mot_proof)
This API is used to read the significant proof time from the register 0x62 bit 4 and 5...
Definition: bmi160.c:10875
BMI160_RETURN_FUNCTION_TYPE bmi160_clear_step_counter(void)
This API used to clear the step counter interrupt interrupt.
Definition: bmi160.c:15552
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_tap_first_x(u8 *v_tap_first_x_u8)
This API reads the any motion tap first x status from the register 0x1E bit 4.
Definition: bmi160.c:2809
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_durn(u8 *v_tap_durn_u8)
This API is used to get the tap duration from the register 0x63 bit 0 to 2.
Definition: bmi160.c:10976
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_under_sampling_parameter(u8 *v_accel_under_sampling_u8)
This API is used to get the accel under sampling parameter form the register 0x40 bit 7...
Definition: bmi160.c:3816
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_tap_durn(u8 v_tap_durn_u8)
This API is used to write the tap duration from the register 0x63 bit 0 to 2.
Definition: bmi160.c:11022
BMI160_RETURN_FUNCTION_TYPE bmi160_get_accel_fifo_filter_data(u8 *accel_fifo_filter_u8)
This API is used to read accel fifo filter data from the register 0x45 bit 7.
Definition: bmi160.c:4700
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_tap_quiet(u8 *v_tap_quiet_u8)
This API read tap quiet duration from the register 0x63 bit 7.
Definition: bmi160.c:11184
unsigned short int u16
Definition: bma2x2.h:193
BMI160_RETURN_FUNCTION_TYPE bmi160_get_stat2_any_motion_sign(u8 *v_anymotion_sign_u8)
This API reads the any motion sign status from the register 0x1E bit 3.
Definition: bmi160.c:2769
signed long long int s64
Definition: bmi160.h:263
BMI160_RETURN_FUNCTION_TYPE bmi160_get_mag_read_addr(u8 *v_mag_read_addr_u8)
This API is used to read data magnetometer address to read from the register 0x4D bit 0 to 7...
Definition: bmi160.c:5821
unsigned long long int u64
Definition: bmi160.h:269
BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_output_data_rate(u8 odr)
This API is used to set the output data rate of magnetometer from the register 0x44 bit 0 to 3...
Definition: bmi160.c:4387
Stores the sensor data.
Definition: bmi160.h:11735
BMI160_RETURN_FUNCTION_TYPE bmi160_get_intr_orient_blocking(u8 *v_orient_blocking_u8)
This API read the orient blocking mode that is used for the generation of the orientation interrupt...
Definition: bmi160.c:11461
BMI160_RETURN_FUNCTION_TYPE bmi160_set_accel_selftest_amp(u8 acc_selftest_amp)
This API write accel self test amplitude from the register 0x6D bit 3 select amplitude of the selftes...
Definition: bmi160.c:13912
BMI160_RETURN_FUNCTION_TYPE bmi160_bmm150_mag_wakeup(void)
This function used for set the mag power control bit enable.
Definition: bmi160.c:17726
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_low_g_durn(u8 v_low_durn_u8)
This API is used to write the low_g duration from register 0x5A bit 0 to 7.
Definition: bmi160.c:9604
BMI160_RETURN_FUNCTION_TYPE bmi160_get_foc_accel_y(u8 *v_foc_accel_y_u8)
This API read accel offset compensation target value for y-axis from the register 0x69 bit 2 and 3...
Definition: bmi160.c:12225
BMI160_RETURN_FUNCTION_TYPE bmi160_set_mag_write_addr(u8 v_mag_write_addr_u8)
This API is used to set magnetometer write address from the register 0x4E bit 0 to 7...
Definition: bmi160.c:5931
BMI160_RETURN_FUNCTION_TYPE bmi160_set_intr_high_g_durn(u8 v_high_g_durn_u8)
This API is used to write Delay time definition for the high-g interrupt from the register 0x5D bit 0...
Definition: bmi160.c:10006
Copyright 2017, Texas Instruments Incorporated