MBot Software Library  v1.0
An API documentation to mbot_firmware repository
bhy.h
Go to the documentation of this file.
1 
57 #ifndef __BHY_H__
58 #define __BHY_H__
59 /****************************************************************/
61 /************************************************************/
74 #ifdef __KERNEL__
75 
76 #include <linux/types.h>
77 /* singed integer type*/
78 typedef int8_t s8;
79 typedef int16_t s16;
80 typedef int32_t s32;
81 typedef int64_t s64;
83 typedef u_int8_t u8;
84 typedef u_int16_t u16;
85 typedef u_int32_t u32;
86 typedef u_int64_t u64;
90 #else /* ! __KERNEL__ */
91 /**********************************************************
92 * These definition uses for define the C
93 * standard version data types
94 ***********************************************************/
95 # if !defined(__STDC_VERSION__)
96 
97 /************************************************
98  * compiler is C11 C standard
99 ************************************************/
100 #if (__STDC_VERSION__ == 201112L)
101 
102 /************************************************/
103 #include <stdint.h>
104 /************************************************/
105 
106 /*unsigned integer types*/
107 typedef uint8_t u8;
108 typedef uint16_t u16;
109 typedef uint32_t u32;
110 typedef uint64_t u64;
112 /*signed integer types*/
113 typedef int8_t s8;
114 typedef int16_t s16;
115 typedef int32_t s32;
116 typedef int64_t s64;
117 /************************************************
118  * compiler is C99 C standard
119 ************************************************/
120 
121 #elif (__STDC_VERSION__ == 199901L)
122 
123 /* stdint.h is a C99 supported c library.
124 which is used to fixed the integer size*/
125 /************************************************/
126 #include <stdint.h>
127 /************************************************/
128 
129 /*unsigned integer types*/
130 typedef uint8_t u8;
131 typedef uint16_t u16;
132 typedef uint32_t u32;
133 typedef uint64_t u64;
135 /*signed integer types*/
136 typedef int8_t s8;
137 typedef int16_t s16;
138 typedef int32_t s32;
139 typedef int64_t s64;
140 /************************************************
141  * compiler is C89 or other C standard
142 ************************************************/
143 
144 #else /* !defined(__STDC_VERSION__) */
150 #define MACHINE_32_BIT
151 
156 #ifdef MACHINE_16_BIT
157 #include <limits.h>
158 /*signed integer types*/
159 typedef signed char s8;
160 typedef signed short int s16;
161 typedef signed long int s32;
163 #if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
164 typedef long int s64;
165 typedef unsigned long int u64;
166 #elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
167 typedef long long int s64;
168 typedef unsigned long long int u64;
169 #else
170 #warning Either the correct data type for signed 64 bit integer \
171 could not be found, or 64 bit integers are not supported in your environment.
172 #warning If 64 bit integers are supported on your platform, \
173 please set s64 manually.
174 #endif
175 
176 /*unsigned integer types*/
177 typedef unsigned char u8;
178 typedef unsigned short int u16;
179 typedef unsigned long int u32;
181 /* If your machine support 32 bit
182 define the MACHINE_32_BIT*/
183 #elif defined MACHINE_32_BIT
184 /*signed integer types*/
185 typedef signed char s8;
186 typedef signed short int s16;
187 typedef signed int s32;
189 /*unsigned integer types*/
190 typedef unsigned char u8;
191 typedef unsigned short int u16;
192 typedef unsigned int u32;
194 /* If your machine support 64 bit
195 define the MACHINE_64_BIT*/
196 #elif defined MACHINE_64_BIT
197 /*signed integer types*/
198 typedef signed char s8;
199 typedef signed short int s16;
200 typedef signed int s32;
201 typedef signed long int s64;
203 /*unsigned integer types*/
204 typedef unsigned char u8;
205 typedef unsigned short int u16;
206 typedef unsigned int u32;
207 typedef unsigned long int u64;
209 #else
210 #warning The data types defined above which not supported \
211 define the data types manually
212 #endif
213 #endif
214 
215 /*** This else will execute for the compilers
216  * which are not supported the C standards
217  * Like C89/C99/C11***/
218 #else
224 #define MACHINE_32_BIT
225 
226 /* If your machine support 16 bit
227 define the MACHINE_16_BIT*/
228 #ifdef MACHINE_16_BIT
229 #include <limits.h>
230 /*signed integer types*/
231 typedef signed char s8;
232 typedef signed short int s16;
233 typedef signed long int s32;
235 #if defined(LONG_MAX) && LONG_MAX == 0x7fffffffffffffffL
236 typedef long int s64;
237 typedef unsigned long int u64;
238 #elif defined(LLONG_MAX) && (LLONG_MAX == 0x7fffffffffffffffLL)
239 typedef long long int s64;
240 typedef unsigned long long int u64;
241 #else
242 #warning Either the correct data type for signed 64 bit integer \
243 could not be found, or 64 bit integers are not supported in your environment.
244 #warning If 64 bit integers are supported on your platform, \
245 please set s64 manually.
246 #endif
247 
248 /*unsigned integer types*/
249 typedef unsigned char u8;
250 typedef unsigned short int u16;
251 typedef unsigned long int u32;
255 #elif defined MACHINE_32_BIT
256 /*signed integer types*/
257 typedef signed char s8;
258 typedef signed short int s16;
259 typedef signed int s32;
261 /*unsigned integer types*/
262 typedef unsigned char u8;
263 typedef unsigned short int u16;
264 typedef unsigned int u32;
266 /* If your machine support 64 bit
267 define the MACHINE_64_BIT*/
268 #elif defined MACHINE_64_BIT
269 /*signed integer types*/
270 typedef signed char s8;
271 typedef signed short int s16;
272 typedef signed int s32;
273 typedef signed long int s64;
275 /*unsigned integer types*/
276 typedef unsigned char u8;
277 typedef unsigned short int u16;
278 typedef unsigned int u32;
279 typedef unsigned long int u64;
281 #else
282 #warning The data types defined above which not supported \
283 define the data types manually
284 #endif
285 #endif
286 #endif
287 /***************************************************************/
289 /***************************************************************/
310 #define BHY_WR_FUNC_PTR s8 (*bus_write)(u8, u8,\
311 u8 *, u16)
332 #define BHY_BUS_WRITE_FUNC(device_addr, reg_addr, reg_data, wr_len)\
333 bus_write(device_addr, reg_addr, reg_data, wr_len)
334 
353 #define BHY_SPI_READ_MASK 0x80 /* for spi read transactions on SPI the
354  MSB has to be set */
355 #define BHY_RD_FUNC_PTR s8 (*bus_read)(u8, u8, u8 *, u16)
356 
357 #define BHY_BRD_FUNC_PTR s8 (*burst_read)(u8, u8, u8 *, u32)
358 
382 #define BHY_BUS_READ_FUNC(device_addr, reg_addr, reg_data, r_len)\
383  bus_read(device_addr, reg_addr, reg_data, r_len)
384 
385 #define BHY_BURST_READ_FUNC(device_addr, register_addr, register_data, rd_len)\
386  burst_read(device_addr, register_addr, register_data, rd_len)
387 
388 
389 #define BHY_MDELAY_DATA_TYPE u32
390 /***************************************************************/
392 /***************************************************************/
393 #define BHY_I2C_ADDR1 (0x28)
394 #define BHY_I2C_ADDR2 (0x29)
395 /***************************************************************/
397 /***************************************************************/
398 #define BHY_INIT_VALUE (0)
399 #define BHY_GEN_READ_WRITE_LENGTH (1)
400 #define BHY_BYTES_REMAINING_LENGTH (2)
401 #define BHY_CRC_HOST_LENGTH (4)
402 #define BHY_PARAMETER_ACK_LENGTH (250)
403 #define BHY_READ_BUFFER_LENGTH (16)
404 #define BHY_PARAMETER_ACK_DELAY (50)
405 #define BHY_SIGNATURE_MEM_LEN (17)
406 /***************************************************************/
408 /***************************************************************/
409 #define BHY_SHIFT_BIT_POSITION_BY_01_BIT (1)
410 #define BHY_SHIFT_BIT_POSITION_BY_02_BITS (2)
411 #define BHY_SHIFT_BIT_POSITION_BY_03_BITS (3)
412 #define BHY_SHIFT_BIT_POSITION_BY_04_BITS (4)
413 #define BHY_SHIFT_BIT_POSITION_BY_05_BITS (5)
414 #define BHY_SHIFT_BIT_POSITION_BY_06_BITS (6)
415 #define BHY_SHIFT_BIT_POSITION_BY_07_BITS (7)
416 #define BHY_SHIFT_BIT_POSITION_BY_08_BITS (8)
417 #define BHY_SHIFT_BIT_POSITION_BY_16_BITS (16)
418 #define BHY_SHIFT_BIT_POSITION_BY_24_BITS (24)
419 /****************************************************/
421 /***************************************************/
422 #define BHY_BYTES_REMAINING_SIZE (2)
423 #define BHY_BYTES_REMAINING_LSB (0)
424 #define BHY_BYTES_REMAINING_MSB (1)
425 
426 #define BHY_CRC_HOST_SIZE (4)
427 #define BHY_CRC_HOST_LSB (0)
428 #define BHY_CRC_HOST_XLSB (1)
429 #define BHY_CRC_HOST_XXLSB (2)
430 #define BHY_CRC_HOST_MSB (3)
431 #define BHY_CRC_HOST_FILE_LSB (4)
432 #define BHY_CRC_HOST_FILE_XLSB (5)
433 #define BHY_CRC_HOST_FILE_XXLSB (6)
434 #define BHY_CRC_HOST_FILE_MSB (7)
435 
436 #define BHY_INDEX_LEN (19)
437 
438 #define BHY_WRITE_BUFFER_SIZE (8)
439 #define BHY_WRITE_BUFFER_1_REG (0)
440 #define BHY_WRITE_BUFFER_2_REG (1)
441 #define BHY_WRITE_BUFFER_3_REG (2)
442 #define BHY_WRITE_BUFFER_4_REG (3)
443 #define BHY_WRITE_BUFFER_5_REG (4)
444 #define BHY_WRITE_BUFFER_6_REG (5)
445 #define BHY_WRITE_BUFFER_7_REG (6)
446 #define BHY_WRITE_BUFFER_8_REG (7)
447 
448 #define BHY_READ_BUFFER_SIZE (16)
449 #define BHY_READ_BUFFER_1_REG (0)
450 #define BHY_READ_BUFFER_2_REG (1)
451 #define BHY_READ_BUFFER_3_REG (2)
452 #define BHY_READ_BUFFER_4_REG (3)
453 #define BHY_READ_BUFFER_5_REG (4)
454 #define BHY_READ_BUFFER_6_REG (5)
455 #define BHY_READ_BUFFER_7_REG (6)
456 #define BHY_READ_BUFFER_8_REG (7)
457 #define BHY_READ_BUFFER_9_REG (8)
458 #define BHY_READ_BUFFER_10_REG (9)
459 #define BHY_READ_BUFFER_11_REG (10)
460 #define BHY_READ_BUFFER_12_REG (11)
461 #define BHY_READ_BUFFER_13_REG (12)
462 #define BHY_READ_BUFFER_14_REG (13)
463 #define BHY_READ_BUFFER_15_REG (14)
464 #define BHY_READ_BUFFER_16_REG (15)
465 
466 #define BHY_FIFO_SENSOR_DATA_SIZE (100)
467 /****************************************************/
469 /***************************************************/
470 
471 #define BHY_NULL_PTR ((void *) 0)
472 #define BHY_NULL ((u8)0)
473 #define BHY_COMM_RES ((s8)-1)
474 #define BHY_OUT_OF_RANGE ((s8)-2)
475 #define BHY_SUCCESS ((u8)0)
476 #define BHY_ERROR ((s8)-3)
477 #define BHY_RAMPATCH_NOT_MATCH ((s8)-4)
478 #define BHY_RAMPATCH_NOT_SUPPORT ((s8)-5)
479 #define BHY_CRC_ERROR ((s8)-6)
480 #define BHY_PRODUCT_ID_ERROR ((s8)-7)
481 
482 /* Constants */
483 #define BHY_DELAY_SETTLING_TIME (5)
484 #define BHY_FIFO_BUFFER_SIZE (50)
485 /*This refers BHY return type as s8 */
486 #define BHY_RETURN_FUNCTION_TYPE s8
487 /****************************************************/
489 /***************************************************/
490 /****************************************************/
492 /***************************************************/
493 /* i2c buffer read for sensor fifo data*/
494 #define BHY_I2C_REG_BUFFER_ZERO_ADDR (0x00)
495 #define BHY_I2C_REG_BUFFER_END_ADDR (0x31)
496 #define BHY_I2C_REG_BUFFER_LENGTH ((BHY_I2C_REG_BUFFER_END_ADDR) - (BHY_I2C_REG_BUFFER_ZERO_ADDR) + 1)
497 /* fifo flush, chip control and status registers*/
498 #define BHY_I2C_REG_FIFO_FLUSH_ADDR (0x32)
499 #define BHY_I2C_REG_CHIP_CONTROL_ADDR (0x34)
500 #define BHY_I2C_REG_HOST_STATUS_ADDR (0x35)
501 #define BHY_I2C_REG_INT_STATUS_ADDR (0x36)
502 #define BHY_I2C_REG_CHIP_STATUS_ADDR (0x37)
503 /* bytes remaining register*/
504 #define BHY_I2C_REG_BYTES_REMAINING_LSB_ADDR (0x38)
505 #define BHY_I2C_REG_BYTES_REMAINING_MSB_ADDR (0x39)
506 #define BHY_I2C_REG_PARAMETER_ACKNOWLEDGE_ADDR (0x3A)
507 /* saved parameter */
508 #define BHY_I2C_REG_PARAMETER_READ_BUFFER_ZERO (0x3B)
509 
510 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT_ADDR (0x54)
512 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR (0x55)
516 #define BHY_I2C_REG_PARAMETER_WRITE_BUFFER_ZERO (0x5C)
517 #define BHY_I2C_REG_PARAMETER_REQUEST_ADDR (0x64)
520 /* product and revision id */
521 #define BHY_BHY_HOST_IRQ_TIMESTAMP_ADDR (0x6C)
523 #define BHY_ROM_VERSION_ADDR (0x70)
525 #define BHY_RAM_VERSION_ADDR (0x72)
527 #define BHY_I2C_REG_PRODUCT_ID_ADDR (0x90)
529 #define BHY_I2C_REG_REVISION_ID_ADDR (0x91)
531 #define BHY_I2C_REG_UPLOAD_0_ADDR (0x94)
532 #define BHY_I2C_REG_UPLOAD_1_ADDR (0x95)
534 #define BHY_I2C_REG_UPLOAD_DATA_ADDR (0x96)
536 #define BHY_I2C_REG_CRC_HOST_ADDR (0x97)
538 #define BHY_I2C_REG_RESET_REQUEST_ADDR (0x9B)
540 /****************************************************/
542 /**************************************************************/
543 #define BHY_HOST_IRQ_TIMESTAMP_SIZE (4)
544 #define BHY_HOST_IRQ_TIMESTAMP_LSB_DATA (0)
545 #define BHY_HOST_IRQ_TIMESTAMP_XLSB_DATA (1)
546 #define BHY_HOST_IRQ_TIMESTAMP_XXLSB_DATA (2)
547 #define BHY_HOST_IRQ_TIMESTAMP_MSB_DATA (3)
548 /****************************************************/
550 /**************************************************************/
551 #define BHY_ROM_VERSION_SIZE (2)
552 #define BHY_ROM_VERSION_LSB_DATA (0)
553 #define BHY_ROM_VERSION_MSB_DATA (1)
554 
555 #define BHY_RAM_VERSION_SIZE (2)
556 #define BHY_RAM_VERSION_LSB_DATA (0)
557 #define BHY_RAM_VERSION_MSB_DATA (1)
558 #define BHY_FIFO_DATA_BUFFER (200)
559 
560 #define BHY_ROM_VERSION_DI01 (u16)(0x2112)
561 //#define BHY_ROM_VERSION_DI02 (u16)(0x2112) //DI02 is not supported
562 #define BHY_ROM_VERSION_DI03 (u16)(0x2DAD)
563 /**************************************************************/
565 /**************************************************************/
570 struct bhy_t {
571 u8 product_id;
579 void (*delay_msec)(BHY_MDELAY_DATA_TYPE);
580 };
603 };
618 };
624 struct meta_event_intr_t {
657 };
663 struct meta_event_event_t {
696 };
701 struct sensor_status_bank_t {
709 };
718 };
723 struct gyro_physical_status_t {
727 };
732 struct mag_physical_status_t {
736 };
755 };
774 };
784 };
794 };
808 };
822 };
823 
824 
825 /**************************************************************/
827 /**************************************************************/
832 struct xyz_accuracy_t {
833 s16 x;
841 };
846 struct xyzw_radians_t {
847 s16 x;
857 };
863 struct fifo_size_two_t {
865 };
869 struct process_temperature_t {
871 };
875 struct process_meta_event_t {
879 };
884 struct uncalib_bias_t {
885 s16 uncalib_x;
893 };
897 struct activity_t {
898 u8 bit_on;
900 };
904 struct barometer_process_t {
905 u32 barometer;
907 };
913 u8 data;
915 };
919 struct bsx_process_data_t {
920 s32 x;
925 };
926 /**************************************************************/
928 /**************************************************************/
929 #define BHY_SENSOR_ID_INDEX (1)
930 
931 /* rotational vector data */
932 #define BHY_RVECTOR_X_LSB_DATA (0)
933 #define BHY_RVECTOR_X_MSB_DATA (1)
934 #define BHY_RVECTOR_Y_LSB_DATA (2)
935 #define BHY_RVECTOR_Y_MSB_DATA (3)
936 #define BHY_RVECTOR_Z_LSB_DATA (4)
937 #define BHY_RVECTOR_Z_MSB_DATA (5)
938 #define BHY_RVECTOR_W_LSB_DATA (6)
939 #define BHY_RVECTOR_W_MSB_DATA (7)
940 #define BHY_RVECTOR_ACCURACY_LSB_DATA (8)
941 #define BHY_RVECTOR_ACCURACY_MSB_DATA (9)
942 #define BHY_RVECTOR_LENGTH (10)
943 
944 /* barometer data */
945 #define BHY_BAROMETER_LSB_DATA (0)
946 #define BHY_BAROMETER_XLSB_DATA (1)
947 #define BHY_BAROMETER_MSB_DATA (2)
948 #define BHY_BAROMETER_LENGTH (3)
949 #define BHY_TWO_BYTE_LENGTH (2)
950 #define BHY_STEP_AMBIENT_TEMPERATURE_MSB_DATA (1)
951 #define BHY_STEP_AMBIENT_TEMPERATURE_LSB_DATA (0)
952 
953 
954 /* activity*/
955 #define BHY_ACTIVITY_BIT_ON (1)
956 #define BHY_ACTIVITY_BIT_OFF (0)
957 #define BHY_ACTIVITY_LENGTH (2)
958 
959 
960 /* BSX a */
961 #define BHY_BSXA_X_LSB_DATA (0)
962 #define BHY_BSXA_X_XLSB_DATA (1)
963 #define BHY_BSXA_X_XXLSB_DATA (2)
964 #define BHY_BSXA_X_MSB_DATA (3)
965 #define BHY_BSXA_Y_LSB_DATA (4)
966 #define BHY_BSXA_Y_XLSB_DATA (5)
967 #define BHY_BSXA_Y_XXLSB_DATA (6)
968 #define BHY_BSXA_Y_MSB_DATA (7)
969 #define BHY_BSXA_Z_LSB_DATA (8)
970 #define BHY_BSXA_Z_XLSB_DATA (9)
971 #define BHY_BSXA_Z_XXLSB_DATA (10)
972 #define BHY_BSXA_Z_MSB_DATA (11)
973 #define BHY_BSXA_TIMESTAMP_LSB_DATA (12)
974 #define BHY_BSXA_TIMESTAMP_XLSB_DATA (13)
975 #define BHY_BSXA_TIMESTAMP_XXLSB_DATA (14)
976 #define BHY_BSXA_TIMESTAMP_MSB_DATA (15)
977 #define BHY_BSXA_VECTOR_DATA (16)
978 #define BHY_BSXA_LENGTH (17)
979 
980 /* meta event*/
981 #define BHY_BHY_META_EVENT_NUMBER (0)
982 #define BHY_BHY_META_EVENT_SENSOR_TYPE (1)
983 #define BHY_BHY_META_EVENT_SPEC_VALUE (2)
984 #define BHY_BHY_META_EVENT_LENGTH (3)
985 /* RAM PATCH definitions*/
986 /* accel data */
987 #define BHY_X_LSB_DATA (0)
988 #define BHY_X_MSB_DATA (1)
989 #define BHY_Y_LSB_DATA (2)
990 #define BHY_Y_MSB_DATA (3)
991 #define BHY_Z_LSB_DATA (4)
992 #define BHY_Z_MSB_DATA (5)
993 #define BHY_VECTOR_DATA (6)
994 #define BHY_XYZ_VECTOR_LENGTH (7)
995 #define INCREMENT_INDEX (1)
996 #define DECREMENT_INDEX (1)
997 
998 #define BHY_TWO_LENGTH (2)
999 #define BHY_LSB_DATA (0)
1000 #define BHY_MSB_DATA (1)
1001 #define BHY_FALSE (0)
1002 #define BHY_TRUE (1)
1003 
1004 /* rotational vector data */
1005 #define BHY_RVECTOR_X_LSB_DATA (0)
1006 #define BHY_RVECTOR_X_MSB_DATA (1)
1007 #define BHY_RVECTOR_Y_LSB_DATA (2)
1008 #define BHY_RVECTOR_Y_MSB_DATA (3)
1009 #define BHY_RVECTOR_Z_LSB_DATA (4)
1010 #define BHY_RVECTOR_Z_MSB_DATA (5)
1011 #define BHY_RVECTOR_W_LSB_DATA (6)
1012 #define BHY_RVECTOR_W_MSB_DATA (7)
1013 #define BHY_RVECTOR_ACCURACY_LSB_DATA (8)
1014 #define BHY_RVECTOR_ACCURACY_MSB_DATA (9)
1015 #define BHY_RVECTOR_LENGTH (10)
1016 
1017 /* uncalibration mag data*/
1018 #define BHY_UNCALIB_X_LSB_DATA (0)
1019 #define BHY_UNCALIB_X_MSB_DATA (1)
1020 #define BHY_UNCALIB_Y_LSB_DATA (2)
1021 #define BHY_UNCALIB_Y_MSB_DATA (3)
1022 #define BHY_UNCALIB_Z_LSB_DATA (4)
1023 #define BHY_UNCALIB_Z_MSB_DATA (5)
1024 #define BHY_BIAS_X_LSB_DATA (6)
1025 #define BHY_BIAS_X_MSB_DATA (7)
1026 #define BHY_BIAS_Y_LSB_DATA (8)
1027 #define BHY_BIAS_Y_MSB_DATA (9)
1028 #define BHY_BIAS_Z_LSB_DATA (10)
1029 #define BHY_BIAS_Z_MSB_DATA (11)
1030 #define BHY_UNCALIB_ACCURACY_DATA (12)
1031 #define BHY_UNCALIB_LENGTH (13)
1032 /**************************************************************/
1034 /**************************************************************/
1035 #define BHY_PARAMETER_ACK_CHECK (0x80)
1036 #define BHY_MASK_LSB_DATA (0x00FF)
1037 #define BHY_MASK_MSB_DATA (0xFF00)
1038 #define BHY_SIC_MASK_MSB_DATA (0x000000FF)
1039 #define BHY_SIC_MASK_LSB_DATA (0x0000FF00)
1040 #define BHY_SIC_MASK_LSB1_DATA (0x00FF0000)
1041 #define BHY_SIC_MASK_LSB2_DATA (0xFF000000)
1042 #define BHY_MASK_META_EVENT (0xFF)
1043 
1044 /**************************************************************/
1046 /**************************************************************/
1047 #define BHY_PAGE_1 (0x01)
1049 #define BHY_PAGE_2 (0x02)
1051 #define BHY_PAGE_3 (0x03)
1053 #define BHY_PAGE_15 (0x0F)
1055 /**************************************************************/
1057 /**************************************************************/
1058 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_0 (0x00)
1059 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_1 (0x01)
1060 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_2 (0x02)
1061 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_3 (0x03)
1062 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_4 (0x04)
1063 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_5 (0x05)
1064 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_6 (0x06)
1065 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_7 (0x07)
1066 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_8 (0x08)
1067 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_9 (0x09)
1068 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_10 (0x0A)
1069 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_11 (0x0B)
1070 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_12 (0x0C)
1071 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_13 (0x0D)
1072 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_14 (0x0E)
1073 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_15 (0x0F)
1074 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_16 (0x10)
1075 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_17 (0x11)
1076 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_18 (0x12)
1077 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_19 (0x13)
1078 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_20 (0x14)
1079 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_21 (0x15)
1080 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_22 (0x16)
1081 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_23 (0x17)
1082 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_24 (0x18)
1083 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_25 (0x19)
1084 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_30 (0x1E)
1085 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_31 (0x1F)
1086 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_33 (0x21)
1087 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_34 (0x22)
1088 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_35 (0x23)
1089 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_36 (0x24)
1090 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_37 (0x25)
1091 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_38 (0x26)
1092 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_39 (0x27)
1093 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_40 (0x28)
1094 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_41 (0x29)
1095 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_42 (0x2A)
1096 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_43 (0x2B)
1097 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_44 (0x2C)
1098 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_45 (0x2D)
1099 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_46 (0x2E)
1100 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_47 (0x2F)
1101 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_48 (0x30)
1102 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_49 (0x31)
1103 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_50 (0x32)
1104 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_51 (0x33)
1105 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_52 (0x34)
1106 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_53 (0x35)
1107 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_54 (0x36)
1108 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_55 (0x37)
1109 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_56 (0x38)
1110 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_57 (0x39)
1111 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_63 (0x3F)
1112 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_64 (0x40)
1113 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_65 (0x41)
1114 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_66 (0x42)
1115 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_67 (0x43)
1116 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_68 (0x44)
1117 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_73 (0x49)
1118 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_74 (0x4A)
1119 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_75 (0x4B)
1120 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_76 (0x4C)
1121 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_77 (0x4D)
1122 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_78 (0x4E)
1123 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_79 (0x4F)
1124 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_80 (0x50)
1125 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_81 (0x51)
1126 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_82 (0x52)
1127 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_83 (0x53)
1128 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_84 (0x54)
1129 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_86 (0x56)
1130 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_87 (0x57)
1131 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_88 (0x58)
1132 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_89 (0x59)
1133 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_95 (0x5F)
1134 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_97 (0x61)
1135 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_98 (0x62)
1136 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_99 (0x63)
1137 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_100 (0x64)
1138 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_101 (0x65)
1139 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_102 (0x66)
1140 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_103 (0x67)
1141 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_104 (0x68)
1142 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_105 (0x69)
1143 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_106 (0x6A)
1144 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_107 (0x6B)
1145 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_108 (0x6C)
1146 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_109 (0x6D)
1147 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_110 (0x6E)
1148 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_111 (0x6F)
1149 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_112 (0x70)
1150 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_113 (0x71)
1151 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_114 (0x72)
1152 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_115 (0x73)
1153 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_116 (0x74)
1154 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_117 (0x75)
1155 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_118 (0x76)
1156 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_119 (0x77)
1157 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_120 (0x78)
1158 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_121 (0x79)
1159 #define BHY_PARAMETER_REQUEST_READ_PARAMETER_127 (0x7F)
1160 /**************************************************************/
1162 /**************************************************************/
1163 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_0 (0x80)
1164 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_1 (0x81)
1165 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_2 (0x82)
1166 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_3 (0x83)
1167 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_4 (0x84)
1168 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_5 (0x85)
1169 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_6 (0x86)
1170 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_7 (0x87)
1171 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_8 (0x88)
1172 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_9 (0x89)
1173 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_10 (0x8A)
1174 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_11 (0x8B)
1175 /* non wakeup sensor configuration*/
1176 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_64 (0xC0)
1177 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_65 (0xC1)
1178 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_66 (0xC2)
1179 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_67 (0xC3)
1180 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_68 (0xC4)
1181 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_69 (0xC5)
1182 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_70 (0xC6)
1183 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_71 (0xC7)
1184 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_72 (0xC8)
1185 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_73 (0xC9)
1186 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_74 (0xCA)
1187 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_75 (0xCB)
1188 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_76 (0xCC)
1189 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_77 (0xCD)
1190 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_78 (0xCE)
1191 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_79 (0xCF)
1192 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_80 (0xD0)
1193 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_81 (0xD1)
1194 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_82 (0xD2)
1195 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_83 (0xD3)
1196 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_84 (0xD4)
1197 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_85 (0xD5)
1198 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_86 (0xD6)
1199 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_87 (0xD7)
1200 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_88 (0xD8)
1201 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_89 (0xD9)
1202 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_90 (0xDA)
1203 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_95 (0xDF)
1204 /* wakeup sensor configuration*/
1205 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_97 (0xE1)
1206 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_98 (0xE2)
1207 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_99 (0xE3)
1208 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_100 (0xE4)
1209 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_101 (0xE5)
1210 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_102 (0xE6)
1211 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_103 (0xE7)
1212 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_104 (0xE8)
1213 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_105 (0xE9)
1214 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_106 (0xEA)
1215 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_107 (0xEB)
1216 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_108 (0xEC)
1217 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_109 (0xED)
1218 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_110 (0xEE)
1219 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_111 (0xEF)
1220 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_112 (0xF0)
1221 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_113 (0xF1)
1222 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_114 (0xF2)
1223 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_115 (0xF3)
1224 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_116 (0xF4)
1225 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_117 (0xF5)
1226 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_118 (0xF6)
1227 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_119 (0xF7)
1228 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_120 (0xF8)
1229 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_121 (0xF9)
1230 #define BHY_PARAMETER_REQUEST_WRITE_PARAMETER_127 (0xFF)
1231 
1232 /****************************************************/
1234 /**************************************************************/
1235 #define PAGE2_SIC_MATRIX_0_1 1 /* X1, X2 */
1236 #define PAGE2_SIC_MATRIX_2_3 2 /* X3, Y1 */
1237 #define PAGE2_SIC_MATRIX_4_5 3 /* Y2, Y2 */
1238 #define PAGE2_SIC_MATRIX_6_7 4 /* Z1, Z2 */
1239 #define PAGE2_SIC_MATRIX_8 5 /* Z3, */
1240 
1241 #define PAGE2_CUS_FIRMWARE_VERSION 125 /* return CUS SDK version information */
1242 #define PAGE2_BSX_VERSION 126 /* return BSX library version information */
1243 
1244 
1245 struct cus_version_t
1246 {
1248  u8 major;
1250 };
1252 /**************************************************************/
1254 /**************************************************************/
1255 #define BHY_META_EVENT1_INTR_ENABLE (0x01)
1256 #define BHY_META_EVENT1_EVENT_ENABLE (0x02)
1257 
1258 #define BHY_META_EVENT2_INTR_ENABLE (0x04)
1259 #define BHY_META_EVENT2_EVENT_ENABLE (0x08)
1260 
1261 #define BHY_META_EVENT3_INTR_ENABLE (0x10)
1262 #define BHY_META_EVENT3_EVENT_ENABLE (0x20)
1263 
1264 #define BHY_META_EVENT4_INTR_ENABLE (0x40)
1265 #define BHY_META_EVENT4_EVENT_ENABLE (0x80)
1266 
1267 #define BHY_META_EVENT5_INTR_ENABLE (0x01)
1268 #define BHY_META_EVENT5_EVENT_ENABLE (0x02)
1269 
1270 #define BHY_META_EVENT6_INTR_ENABLE (0x04)
1271 #define BHY_META_EVENT6_EVENT_ENABLE (0x08)
1272 
1273 #define BHY_META_EVENT7_INTR_ENABLE (0x10)
1274 #define BHY_META_EVENT7_EVENT_ENABLE (0x20)
1275 
1276 #define BHY_META_EVENT8_INTR_ENABLE (0x40)
1277 #define BHY_META_EVENT8_EVENT_ENABLE (0x80)
1278 
1279 #define BHY_META_EVENT9_INTR_ENABLE (0x01)
1280 #define BHY_META_EVENT9_EVENT_ENABLE (0x02)
1281 
1282 #define BHY_META_EVENT10_INTR_ENABLE (0x04)
1283 #define BHY_META_EVENT10_EVENT_ENABLE (0x08)
1284 
1285 #define BHY_META_EVENT11_INTR_ENABLE (0x10)
1286 #define BHY_META_EVENT11_EVENT_ENABLE (0x20)
1287 
1288 #define BHY_META_EVENT12_INTR_ENABLE (0x40)
1289 #define BHY_META_EVENT12_EVENT_ENABLE (0x80)
1290 
1291 #define BHY_META_EVENT13_INTR_ENABLE (0x01)
1292 #define BHY_META_EVENT13_EVENT_ENABLE (0x02)
1293 
1294 #define BHY_META_EVENT14_INTR_ENABLE (0x04)
1295 #define BHY_META_EVENT14_EVENT_ENABLE (0x08)
1296 
1297 #define BHY_META_EVENT15_INTR_ENABLE (0x10)
1298 #define BHY_META_EVENT15_EVENT_ENABLE (0x20)
1299 
1300 #define BHY_META_EVENT16_INTR_ENABLE (0x40)
1301 #define BHY_META_EVENT16_EVENT_ENABLE (0x80)
1302 
1303 #define BHY_META_EVENT17_INTR_ENABLE (0x01)
1304 #define BHY_META_EVENT17_EVENT_ENABLE (0x02)
1305 
1306 #define BHY_META_EVENT18_INTR_ENABLE (0x04)
1307 #define BHY_META_EVENT18_EVENT_ENABLE (0x08)
1308 
1309 #define BHY_META_EVENT19_INTR_ENABLE (0x10)
1310 #define BHY_META_EVENT19_EVENT_ENABLE (0x20)
1311 
1312 #define BHY_META_EVENT20_INTR_ENABLE (0x40)
1313 #define BHY_META_EVENT20_EVENT_ENABLE (0x80)
1314 
1315 #define BHY_META_EVENT21_INTR_ENABLE (0x01)
1316 #define BHY_META_EVENT21_EVENT_ENABLE (0x02)
1317 
1318 #define BHY_META_EVENT22_INTR_ENABLE (0x04)
1319 #define BHY_META_EVENT22_EVENT_ENABLE (0x08)
1320 
1321 #define BHY_META_EVENT23_INTR_ENABLE (0x10)
1322 #define BHY_META_EVENT23_EVENT_ENABLE (0x20)
1323 
1324 #define BHY_META_EVENT24_INTR_ENABLE (0x40)
1325 #define BHY_META_EVENT24_EVENT_ENABLE (0x80)
1326 
1327 #define BHY_META_EVENT25_INTR_ENABLE (0x01)
1328 #define BHY_META_EVENT25_EVENT_ENABLE (0x02)
1329 
1330 #define BHY_META_EVENT26_INTR_ENABLE (0x04)
1331 #define BHY_META_EVENT26_EVENT_ENABLE (0x08)
1332 
1333 #define BHY_META_EVENT27_INTR_ENABLE (0x10)
1334 #define BHY_META_EVENT27_EVENT_ENABLE (0x20)
1335 
1336 #define BHY_META_EVENT28_INTR_ENABLE (0x40)
1337 #define BHY_META_EVENT28_EVENT_ENABLE (0x80)
1338 
1339 #define BHY_META_EVENT29_INTR_ENABLE (0x01)
1340 #define BHY_META_EVENT29_EVENT_ENABLE (0x02)
1341 
1342 #define BHY_META_EVENT30_INTR_ENABLE (0x04)
1343 #define BHY_META_EVENT30_EVENT_ENABLE (0x08)
1344 
1345 #define BHY_META_EVENT31_INTR_ENABLE (0x10)
1346 #define BHY_META_EVENT31_EVENT_ENABLE (0x20)
1347 
1348 #define BHY_META_EVENT32_INTR_ENABLE (0x40)
1349 #define BHY_META_EVENT32_EVENT_ENABLE (0x80)
1350 
1351 /**************************************************************/
1353 /**************************************************************/
1354 #define BHY_SENSOR_BANK_STATUS_DATA_AVAILABLE (0x01)
1355 #define BHY_SENSOR_BANK_STATUS_I2C_NACK (0x02)
1356 #define BHY_SENSOR_BANK_STATUS_DEVICE_ID_ERROR (0x04)
1357 #define BHY_SENSOR_BANK_STATUS_TRANSIENT_ERROR (0x08)
1358 #define BHY_SENSOR_BANK_STATUS_DATA_LOST (0x10)
1359 #define BHY_SENSOR_BANK_STATUS_POWER_MODE (0xE0)
1360 #define BHY_POWER_MODE_SENSOR_NOT_PRESENT (0x00)
1361 #define BHY_POWER_MODE_POWER_DOWN (0x01)
1362 #define BHY_POWER_MODE_POWER_SUSPEND (0x02)
1363 #define BHY_POWER_MODE_POWER_SELFTEST (0x03)
1364 #define BHY_POWER_MODE_POWER_INTR_MOTION (0x04)
1365 #define BHY_POWER_MODE_POWER_ONE_SHOT (0x05)
1366 #define BHY_POWER_MODE_POWER_LOW_POWER (0x06)
1367 #define BHY_POWER_MODE_POWER_ACTIVE (0x07)
1368 #define BHY_SIGNATURE_1 (0)
1369 #define BHY_SIGNATURE_2 (1)
1370 #define BHY_SIG_FLAG_1_POS (2)
1371 #define BHY_SIG_FLAG_2_POS (3)
1372 #define BHY_SIGNATURE_LENGTH (16)
1373 #define BHY_RAM_WRITE_LENGTH (4)
1374 #define BHY_RAM_WRITE_LENGTH_API (32)
1375 #define BHY_CHIP_CTRL_ENABLE_1 (0x02)
1376 #define BHY_CHIP_CTRL_ENABLE_2 (0x01)
1377 #define BHY_UPLOAD_DATA (0x00)
1378 #define BHY_RESET_ENABLE (0x01)
1379 #define BHY_INIT_READ_BYTES (19)
1380 #define BHY_INIT_BYTE_MINUS_ONE (1)
1381 #define BHY_CHECK_BYTE (3)
1382 #define BHY_IMAGE_SIGNATURE1 (0x2A)
1383 #define BHY_IMAGE_SIGNATURE2 (0x65)
1384 #define BHY_GET_ROMVEREXP(bhy_sig_flag) ((bhy_sig_flag>>11)&0x03)
1385 #define BHY_ROM_VER_ANY (0x00)
1386 #define BHY_ROM_VER_DI01 (0x01)
1387 #define BHY_ROM_VER_DI02 (0x02)
1388 #define BHY_ROM_VER_DI03 (0x03)
1389 /**************************************************************/
1391 /**************************************************************/
1392 #define BHY_META_EVENT_1 (1)
1393 #define BHY_META_EVENT_2 (2)
1394 #define BHY_META_EVENT_3 (3)
1395 #define BHY_META_EVENT_4 (4)
1396 #define BHY_META_EVENT_5 (5)
1397 #define BHY_META_EVENT_6 (6)
1398 #define BHY_META_EVENT_7 (7)
1399 #define BHY_META_EVENT_8 (8)
1400 #define BHY_META_EVENT_9 (9)
1401 #define BHY_META_EVENT_10 (10)
1402 #define BHY_META_EVENT_11 (11)
1403 #define BHY_META_EVENT_12 (12)
1404 #define BHY_META_EVENT_13 (13)
1405 #define BHY_META_EVENT_14 (14)
1406 #define BHY_META_EVENT_15 (15)
1407 #define BHY_META_EVENT_16 (16)
1408 #define BHY_META_EVENT_17 (17)
1409 #define BHY_META_EVENT_18 (18)
1410 #define BHY_META_EVENT_19 (19)
1411 #define BHY_META_EVENT_20 (20)
1412 #define BHY_META_EVENT_21 (21)
1413 #define BHY_META_EVENT_22 (22)
1414 #define BHY_META_EVENT_23 (23)
1415 #define BHY_META_EVENT_24 (24)
1416 #define BHY_META_EVENT_25 (25)
1417 #define BHY_META_EVENT_26 (26)
1418 #define BHY_META_EVENT_27 (27)
1419 #define BHY_META_EVENT_28 (28)
1420 #define BHY_META_EVENT_29 (29)
1421 #define BHY_META_EVENT_30 (30)
1422 #define BHY_META_EVENT_31 (31)
1423 #define BHY_META_EVENT_32 (32)
1424 /**************************************************************/
1426 /**************************************************************/
1427 #define BHY_NON_WAKEUP_ROTATION_VECTOR (11)
1428 #define BHY_NON_WAKEUP_GAME_ROTATION_VECTOR (15)
1429 #define BHY_NON_WAKEUP_GEOMAG_ROTATION_VECTOR (20)
1430 #define BHY_NON_WAKEUP_ACCELR (1)
1431 #define BHY_NON_WAKEUP_MAG (2)
1432 #define BHY_NON_WAKEUP_ORIENTATION (3)
1433 #define BHY_NON_WAKEUP_GYRO (4)
1434 #define BHY_NON_WAKEUP_GRAVITY (9)
1435 #define BHY_NON_WAKEUP_LINEAR_ACCEL (10)
1436 #define BHY_NON_WAKEUP_LIGHT (5)
1437 #define BHY_NON_WAKEUP_PROXIMITY (8)
1438 #define BHY_NON_WAKEUP_HUMIDITY (12)
1439 #define BHY_NON_WAKEUP_STEP_COUNTER (19)
1440 #define BHY_NON_WAKEUP_TEMPERATURE (7)
1441 #define BHY_NON_WAKEUP_AMBIENT_TEMPERATURE (13)
1442 #define BHY_NON_WAKEUP_BAROMETER (6)
1443 #define BHY_NON_WAKEUP_SIGNIFICANT_MOTION (17)
1444 #define BHY_NON_WAKEUP_STEP_DETECTOR (18)
1445 #define BHY_NON_WAKEUP_TILT_DETECTOR (22)
1446 #define BHY_NON_WAKEUP_WAKE_GESTURE (23)
1447 #define BHY_NON_WAKEUP_GLANCE_GESTURE (24)
1448 #define BHY_NON_WAKEUP_PICKUP_GESTURE (25)
1449 #define BHY_NON_WAKEUP_UNCALIB_MAG (14)
1450 #define BHY_NON_WAKEUP_UNCALIB_GYRO (16)
1451 #define BHY_NON_WAKEUP_HEART_RATE (21)
1452 #define BHY_NON_WAKEUP_ACTIVITY (31)
1453 #define BHY_NON_WAKEUP_BSX_C (249)
1454 #define BHY_NON_WAKEUP_BSX_B (250)
1455 #define BHY_NON_WAKEUP_BSX_A (251)
1456 #define BHY_NON_WAKEUP_TIMESTAMP_LSW (252)
1457 #define BHY_NON_WAKEUP_TIMESTAMP_MSW (253)
1458 #define BHY_NON_WAKEUP_META_EVENTS (254)
1459 
1460 /**************************************************************/
1462 /**************************************************************/
1463 #define BHY_WAKEUP_ROTATION_VECTOR (43)
1464 #define BHY_WAKEUP_GAME_ROTATION_VECTOR (47)
1465 #define WAKEUP_GEOMAG_ROTATION_VECTOR (52)
1466 #define BHY_WAKEUP_ACCEL (33)
1467 #define BHY_WAKEUP_MAG (34)
1468 #define BHY_WAKEUP_ORIENTATION (35)
1469 #define BHY_WAKEUP_GYRO (36)
1470 #define BHY_WAKEUP_GRAVITY (41)
1471 #define BHY_WAKEUP_LINEAR_ACCEL (42)
1472 #define BHY_WAKEUP_LIGHT (37)
1473 #define BHY_WAKEUP_PROXIMITY (40)
1474 #define BHY_WAKEUP_HUMIDITY (44)
1475 #define BHY_WAKEUP_STEP_COUNTER (51)
1476 #define BHY_WAKEUP_TEMPERATURE (39)
1477 #define BHY_WAKEUP_AMBIENT_TEMPERATURE (45)
1478 #define BHY_WAKEUP_BAROMETER (38)
1479 #define BHY_WAKEUP_SIGNIFICANT_MOTION (49)
1480 #define BHY_WAKEUP_STEP_DETECTOR (50)
1481 #define BHY_WAKEUP_TILT_DETECTOR (54)
1482 #define BHY_WAKEUP_WAKE_GESTURE (55)
1483 #define BHY_WAKEUP_GLANCE_GESTURE (56)
1484 #define BHY_WAKEUP_PICKUP_GESTURE (57)
1485 #define BHY_WAKEUP_UNCALIB_MAG (46)
1486 #define BHY_WAKEUP_UNCALIB_GYRO (48)
1487 #define BHY_WAKEUP_HEART_RATE (53)
1488 #define BHY_WAKEUP_ACTIVITY (63)
1489 #define BHY_WAKEUP_TIMESTAMP_LSW (246)
1490 #define BHY_WAKEUP_TIMESTAMP_MSW (247)
1491 #define BHY_WAKEUP_META_EVENTS (248)
1492 /**************************************************************/
1494 /**************************************************************/
1495 
1496 /**************************************************************/
1498 /**************************************************************/
1499 #define BHY_I2C_REG_FIFO_FLUSH__POS (0)
1500 #define BHY_I2C_REG_FIFO_FLUSH__MSK (0xFF)
1501 #define BHY_I2C_REG_FIFO_FLUSH__LEN (8)
1502 #define BHY_I2C_REG_FIFO_FLUSH__REG (BHY_I2C_REG_FIFO_FLUSH_ADDR)
1503 /**************************************************************/
1505 /**************************************************************/
1506 #define BHY_I2C_REG_CHIP_CONTROL__POS (0)
1507 #define BHY_I2C_REG_CHIP_CONTROL__MSK (0xFF)
1508 #define BHY_I2C_REG_CHIP_CONTROL__LEN (8)
1509 #define BHY_I2C_REG_CHIP_CONTROL__REG \
1510 (BHY_I2C_REG_CHIP_CONTROL_ADDR)
1511 /**************************************************************/
1513 /**************************************************************/
1514 #define BHY_I2C_REG_HOST_STATUS__POS (0)
1515 #define BHY_I2C_REG_HOST_STATUS__MSK (0xFF)
1516 #define BHY_I2C_REG_HOST_STATUS__LEN (8)
1517 #define BHY_I2C_REG_HOST_STATUS__REG (BHY_I2C_REG_HOST_STATUS_ADDR)
1518 
1519 #define BHY_I2C_REG_HOST_STATUS_ALGO_STANDBY__POS (1)
1520 #define BHY_I2C_REG_HOST_STATUS_ALGO_STANDBY__MSK (0x02)
1521 #define BHY_I2C_REG_HOST_STATUS_ALGO_STANDBY__LEN (1)
1522 #define BHY_I2C_REG_HOST_STATUS_ALGO_STANDBY__REG \
1523 (BHY_I2C_REG_HOST_STATUS_ADDR)
1524 
1525 #define BHY_I2C_REG_BHY_HOST_INTERFACE_ID__POS (2)
1526 #define BHY_I2C_REG_BHY_HOST_INTERFACE_ID__MSK (0x1C)
1527 #define BHY_I2C_REG_BHY_HOST_INTERFACE_ID__LEN (3)
1528 #define BHY_I2C_REG_BHY_HOST_INTERFACE_ID__REG \
1529 (BHY_I2C_REG_HOST_STATUS_ADDR)
1530 
1531 #define BHY_I2C_REG_BHY_HOST_STATUS_ALGO_ID__POS (5)
1532 #define BHY_I2C_REG_BHY_HOST_STATUS_ALGO_ID__MSK (0xE0)
1533 #define BHY_I2C_REG_BHY_HOST_STATUS_ALGO_ID__LEN (3)
1534 #define BHY_I2C_REG_BHY_HOST_STATUS_ALGO_ID__REG \
1535 (BHY_I2C_REG_HOST_STATUS_ADDR)
1536 /**************************************************************/
1538 /**************************************************************/
1539 #define BHY_I2C_REG_INT_STATUS__POS (0)
1540 #define BHY_I2C_REG_INT_STATUS__MSK (0xFF)
1541 #define BHY_I2C_REG_INT_STATUS__LEN (8)
1542 #define BHY_I2C_REG_INT_STATUS__REG (BHY_I2C_REG_INT_STATUS_ADDR)
1543 
1544 #define BHY_I2C_REG_BHY_INT_STATUS_HOST_INTR__POS (0)
1545 #define BHY_I2C_REG_BHY_INT_STATUS_HOST_INTR__MSK (0x01)
1546 #define BHY_I2C_REG_BHY_INT_STATUS_HOST_INTR__LEN (1)
1547 #define BHY_I2C_REG_BHY_INT_STATUS_HOST_INTR__REG (BHY_I2C_REG_INT_STATUS_ADDR)
1548 
1549 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_WM__POS (1)
1550 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_WM__MSK (0x02)
1551 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_WM__LEN (1)
1552 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_WM__REG \
1553 (BHY_I2C_REG_INT_STATUS_ADDR)
1554 
1555 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_LATENCY__POS (2)
1556 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_LATENCY__MSK (0x04)
1557 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_LATENCY__LEN (1)
1558 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_LATENCY__REG \
1559 (BHY_I2C_REG_INT_STATUS_ADDR)
1560 
1561 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_IMMEDIATE__POS (3)
1562 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_IMMEDIATE__MSK (0x08)
1563 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_IMMEDIATE__LEN (1)
1564 #define BHY_I2C_REG_BHY_INT_STATUS_WAKEUP_IMMEDIATE__REG \
1565 (BHY_I2C_REG_INT_STATUS_ADDR)
1566 
1567 #define BHY_I2C_REG_BHY_INT_STATUS_NON_WAKEUP_WM__POS (4)
1568 #define BHY_I2C_REG_BHY_INT_STATUS_NON_WAKEUP_WM__MSK (0x10)
1569 #define BHY_I2C_REG_BHY_INT_STATUS_NON_WAKEUP_WM__LEN (1)
1570 #define BHY_I2C_REG_BHY_INT_STATUS_NON_WAKEUP_WM__REG \
1571 (BHY_I2C_REG_INT_STATUS_ADDR)
1572 
1573 #define BHY_I2C_REG_INT_STATUS_NON_WAKEUP_LATENCY__POS (5)
1574 #define BHY_I2C_REG_INT_STATUS_NON_WAKEUP_LATENCY__MSK (0x20)
1575 #define BHY_I2C_REG_INT_STATUS_NON_WAKEUP_LATENCY__LEN (1)
1576 #define BHY_I2C_REG_INT_STATUS_NON_WAKEUP_LATENCY__REG \
1577 (BHY_I2C_REG_INT_STATUS_ADDR)
1578 
1579 #define BHY_I2C_REG_INT_STATUS_NON_WAKEUP_IMMEDIATE__POS (6)
1580 #define BHY_I2C_REG_INT_STATUS_NON_WAKEUP_IMMEDIATE__MSK (0x40)
1581 #define BHY_I2C_REG_INT_STATUS_NON_WAKEUP_IMMEDIATE__LEN (1)
1582 #define BHY_I2C_REG_INT_STATUS_NON_WAKEUP_IMMEDIATE__REG \
1583 (BHY_I2C_REG_INT_STATUS_ADDR)
1584 /**************************************************************/
1586 /**************************************************************/
1587 #define BHY_I2C_REG_CHIP_STATUS__POS (0)
1588 #define BHY_I2C_REG_CHIP_STATUS__MSK (0xFF)
1589 #define BHY_I2C_REG_CHIP_STATUS__LEN (8)
1590 #define BHY_I2C_REG_CHIP_STATUS__REG (BHY_I2C_REG_CHIP_STATUS_ADDR)
1591 
1592 #define BHY_I2C_REG_CHIP_STATUS_EEPROM_DETECTED__POS (0)
1593 #define BHY_I2C_REG_CHIP_STATUS_EEPROM_DETECTED__MSK (0x01)
1594 #define BHY_I2C_REG_CHIP_STATUS_EEPROM_DETECTED__LEN (1)
1595 #define BHY_I2C_REG_CHIP_STATUS_EEPROM_DETECTED__REG \
1596 (BHY_I2C_REG_CHIP_STATUS_ADDR)
1597 
1598 #define BHY_I2C_REG_CHIP_STATUS_EE_UPLOAD_DONE__POS (1)
1599 #define BHY_I2C_REG_CHIP_STATUS_EE_UPLOAD_DONE__MSK (0x02)
1600 #define BHY_I2C_REG_CHIP_STATUS_EE_UPLOAD_DONE__LEN (1)
1601 #define BHY_I2C_REG_CHIP_STATUS_EE_UPLOAD_DONE__REG \
1602 (BHY_I2C_REG_CHIP_STATUS_ADDR)
1603 
1604 #define BHY_I2C_REG_CHIP_STATUS_EE_UPLOAD_ERROR__POS (2)
1605 #define BHY_I2C_REG_CHIP_STATUS_EE_UPLOAD_ERROR__MSK (0x04)
1606 #define BHY_I2C_REG_CHIP_STATUS_EE_UPLOAD_ERROR__LEN (1)
1607 #define BHY_I2C_REG_CHIP_STATUS_EE_UPLOAD_ERROR__REG \
1608 (BHY_I2C_REG_CHIP_STATUS_ADDR)
1609 
1610 #define BHY_I2C_REG_CHIP_STATUS_FIRMWARE_IDLE__POS (3)
1611 #define BHY_I2C_REG_CHIP_STATUS_FIRMWARE_IDLE__MSK (0x08)
1612 #define BHY_I2C_REG_CHIP_STATUS_FIRMWARE_IDLE__LEN (1)
1613 #define BHY_I2C_REG_CHIP_STATUS_FIRMWARE_IDLE__REG \
1614 (BHY_I2C_REG_CHIP_STATUS_ADDR)
1615 
1616 #define BHY_I2C_REG_CHIP_STATUS_NO_EEPROM__POS (4)
1617 #define BHY_I2C_REG_CHIP_STATUS_NO_EEPROM__MSK (0x10)
1618 #define BHY_I2C_REG_CHIP_STATUS_NO_EEPROM__LEN (1)
1619 #define BHY_I2C_REG_CHIP_STATUS_NO_EEPROM__REG (BHY_I2C_REG_CHIP_STATUS_ADDR)
1620 
1621 /**************************************************************/
1623 /**************************************************************/
1624 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT__POS (0)
1625 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT__MSK (0xFF)
1626 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT__LEN (8)
1627 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT__REG \
1628 (BHY_I2C_REG_PARAMETER_PAGE_SELECT_ADDR)
1629 
1630 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT_PARAMETER_PAGE__POS (0)
1631 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT_PARAMETER_PAGE__MSK (0x0F)
1632 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT_PARAMETER_PAGE__LEN (4)
1633 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT_PARAMETER_PAGE__REG \
1634 (BHY_I2C_REG_PARAMETER_PAGE_SELECT_ADDR)
1635 
1636 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT_PARAMETER_SIZE__POS (4)
1637 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT_PARAMETER_SIZE__MSK (0xF0)
1638 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT_PARAMETER_SIZE__LEN (4)
1639 #define BHY_I2C_REG_PARAMETER_PAGE_SELECT_PARAMETER_SIZE__REG \
1640 (BHY_I2C_REG_PARAMETER_PAGE_SELECT_ADDR)
1641 /**************************************************************/
1643 /**************************************************************/
1644 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL__POS (0)
1645 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL__MSK (0xFF)
1646 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL__LEN (8)
1647 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL__REG \
1648 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
1649 
1650 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_ALGO_STABDY_REQUEST__POS (0)
1651 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_ALGO_STABDY_REQUEST__MSK (0x01)
1652 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_ALGO_STABDY_REQUEST__LEN (1)
1653 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_ALGO_STABDY_REQUEST__REG \
1654 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
1655 
1656 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_ABORT_TRANSFER__POS (1)
1657 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_ABORT_TRANSFER__MSK (0x02)
1658 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_ABORT_TRANSFER__LEN (1)
1659 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_ABORT_TRANSFER__REG \
1660 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
1661 
1662 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_TRANSFER_COUNT__POS (2)
1663 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_TRANSFER_COUNT__MSK (0x04)
1664 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_TRANSFER_COUNT__LEN (1)
1665 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_TRANSFER_COUNT__REG \
1666 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
1667 
1668 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_WAKEUP_FIFO_DISABLE__POS (3)
1669 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_WAKEUP_FIFO_DISABLE__MSK (0x08)
1670 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_WAKEUP_FIFO_DISABLE__LEN (1)
1671 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_WAKEUP_FIFO_DISABLE__REG \
1672 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
1673 
1674 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NED_COORDINATE__POS (4)
1675 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NED_COORDINATE__MSK (0x10)
1676 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NED_COORDINATE__LEN (1)
1677 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NED_COORDINATE__REG \
1678 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
1679 
1680 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_AP_SUSPEND__POS (5)
1681 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_AP_SUSPEND__MSK (0x20)
1682 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_AP_SUSPEND__LEN (1)
1683 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_AP_SUSPEND__REG \
1684 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
1685 
1686 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_SELFTEST__POS (6)
1687 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_SELFTEST__MSK (0x40)
1688 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_SELFTEST__LEN (1)
1689 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_SELFTEST__REG \
1690 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
1691 
1692 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NON_WAKEUP_FIFO_DISABLE__POS \
1693 (7)
1694 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NON_WAKEUP_FIFO_DISABLE__MSK \
1695 (0x80)
1696 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NON_WAKEUP_FIFO_DISABLE__LEN \
1697 (1)
1698 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NON_WAKEUP_FIFO_DISABLE__REG \
1699 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
1700 /**************************************************************/
1702 /**************************************************************/
1703 #define BHY_I2C_REG_LOAD_PARAMETER_REQUEST__POS (0)
1704 #define BHY_I2C_REG_LOAD_PARAMETER_REQUEST__MSK (0xFF)
1705 #define BHY_I2C_REG_LOAD_PARAMETER_REQUEST__LEN (8)
1706 #define BHY_I2C_REG_LOAD_PARAMETER_REQUEST__REG \
1707 (BHY_I2C_REG_PARAMETER_REQUEST_ADDR)
1708 
1709 /**************************************************************/
1711 /**************************************************************/
1712 #define BHY_I2C_REG_RESET_REQUEST__POS (0)
1713 #define BHY_I2C_REG_RESET_REQUEST__MSK (0xFF)
1714 #define BHY_I2C_REG_RESET_REQUEST__LEN (8)
1715 #define BHY_I2C_REG_RESET_REQUEST__REG \
1716 (BHY_I2C_REG_RESET_REQUEST_ADDR)
1717 
1718 /**************************************************/
1720 /*************************************************/
1721 #define BHY_GET_BITSLICE(regvar, bitname)\
1722  ((regvar & bitname##__MSK) >> bitname##__POS)
1723 
1724 
1725 #define BHY_SET_BITSLICE(regvar, bitname, val)\
1726  ((regvar & ~bitname##__MSK) | \
1727  ((val<<bitname##__POS)&bitname##__MSK))
1728 
1729 /**************************************************************/
1731 /**************************************************************/
1732 #define BHY_HOST_STATUS_ALGO_STANDBY (0)
1733 #define BHY_HOST_STATUS_ALGO_ID (1)
1734 #define BHY_FIFO_SIZE_WAKEUP (0)
1735 #define BHY_FIFO_SIZE_NON_WAKEUP (1)
1736 #define BHY_HOST_IRQ_TIMESTAMP (0)
1737 #define BHY_CURRENT_TIME_STAMP (1)
1738 /**************************************************************/
1740 /**************************************************************/
1741 #define BHY_INT_STATUS_HOST_INTR (0)
1742 #define BHY_INT_STATUS_WAKEUP_WM (1)
1743 #define BHY_INT_STATUS_WAKEUP_LATENCY (2)
1744 #define BHY_INT_STATUS_WAKEUP_IMMEDIATE (3)
1745 #define BHY_INT_STATUS_NON_WAKEUP_WM (4)
1746 #define BHY_INT_STATUS_NON_WAKEUP_LATENCY (5)
1747 #define BHY_INT_STATUS_NON_WAKEUP (6)
1748 /**************************************************************/
1750 /**************************************************************/
1751 #define BHY_CHIP_STATUS_EEPROM_DETECTED (0)
1752 #define BHY_CHIP_STATUS_EE_UPLOAD_DONE (1)
1753 #define BHY_CHIP_STATUS_EE_UPLOAD_ERROR (2)
1754 #define BHY_CHIP_STATUS_FIRMWARE_IDLE (3)
1755 #define BHY_CHIP_STATUS_NO_EEPROM (4)
1756 /**************************************************************/
1758 /**************************************************************/
1759 #define BHY_PAGE_SELECT_PARAMETER_PAGE (0)
1760 #define BHY_PAGE_SELECT_PARAMETER_SIZE (1)
1761 /**************************************************************/
1763 /**************************************************************/
1764 #define BHY_HOST_ALGO_STANDBY_REQUEST (0)
1765 #define BHY_HOST_ABORT_TRANSFER (1)
1766 #define BHY_HOST_UPDATE_TRANSFER_COUNT (2)
1767 #define BHY_HOST_WAKEUP_FIFO_DISABLE (3)
1768 #define BHY_HOST_NED_COORDINATE (4)
1769 #define BHY_HOST_AP_SUSPEND (5)
1770 #define BHY_HOST_SELFTEST (6)
1771 #define BHY_HOST_NON_WAKEUP_FIFO_DISABLE (7)
1772 /**************************************************************/
1774 /**************************************************************/
1775 #define BHY_META_EVENT_BYTE_0 (0)
1776 #define BHY_META_EVENT_BYTE_1 (1)
1777 #define BHY_META_EVENT_BYTE_2 (2)
1778 #define BHY_META_EVENT_BYTE_3 (3)
1779 #define BHY_META_EVENT_BYTE_4 (4)
1780 #define BHY_META_EVENT_BYTE_5 (5)
1781 #define BHY_META_EVENT_BYTE_6 (6)
1782 #define BHY_META_EVENT_BYTE_7 (7)
1783 /**************************************************************/
1785 /**************************************************************/
1786 #define BHY_META_INTR_ENABLE (0)
1787 #define BHY_META_EVENT_ENABLE (1)
1788 /**************************************************************/
1790 /**************************************************************/
1791 #define BHY_FLUSH_COMPLETE (0)
1792 #define BHY_SAMPLE_RATE_CHANGE (1)
1793 #define BHY_POWER_MODE (2)
1794 #define BHY_META_ERROR (3)
1795 /**************************************************************/
1797 /**************************************************************/
1798 #define BHY_SENSOR_ERROR (0)
1799 #define BHY_FIFO_OVERFLOW (1)
1800 /**************************************************************/
1802 /**************************************************************/
1803 #define BHY_DYNAMIC_RANGE (0)
1804 #define BHY_FIFO_WM (1)
1805 #define BHY_SELF_TEST_RESULT (2)
1806 #define BHY_INITIALIZED (3)
1807 /**************************************************************/
1808 /**************************************************************/
1810 /**************************************************************/
1811 #define BHY_FIFO_WATER_MARK_WAKEUP (0)
1812 #define BHY_FIFO_WATER_MARK_NON_WAKEUP (1)
1813 /**************************************************************/
1815 /**************************************************************/
1816 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_1 (0)
1817 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_2 (1)
1818 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_3 (3)
1819 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_4 (4)
1820 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_5 (5)
1821 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_6 (6)
1822 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_7 (7)
1823 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_8 (8)
1824 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_9 (9)
1825 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_10 (10)
1826 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_11 (11)
1827 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_12 (12)
1828 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_13 (13)
1829 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_14 (14)
1830 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_15 (15)
1831 #define BHY_SENSOR_STATUS_BANK_SENSOR_TYPE_16 (16)
1832 
1833 /**************************************************************/
1835 /**************************************************************/
1836 
1837 #define BHY_SENSOR_NOT_PRESENT (0x00)
1838 #define BHY_POWER_DOWN (0x01)
1839 #define BHY_SUSPEND (0x02)
1840 #define BHY_SELF_TEST (0x03)
1841 #define BHY_INTR_MOTION (0x04)
1842 #define BHY_ONE_SHOT (0x05)
1843 #define BHY_LOW_POWER_ACTIVE (0x06)
1844 #define BHY_ACTIVE (0x07)
1845 
1846 /**************************************************************/
1848 /**************************************************************/
1849 #define PRODUCT_ID_7183 (0x83)
1850 
1851 /**************************************************************/
1853 /**************************************************************/
1877 BHY_RETURN_FUNCTION_TYPE bhy_init(struct bhy_t *bhy);
1895 BHY_RETURN_FUNCTION_TYPE bhy_write_reg(u8 v_addr_u8,
1896 u8 *v_data_u8, u16 v_len_u16);
1914 BHY_RETURN_FUNCTION_TYPE bhy_read_reg(u8 v_addr_u8,
1915 u8 *v_data_u8, u16 v_len_u16);
1928 BHY_RETURN_FUNCTION_TYPE bhy_get_fifo_flush(u8 *v_fifo_flush_u8);
1943 BHY_RETURN_FUNCTION_TYPE bhy_set_fifo_flush(u8 v_fifo_flush_u8);
1959 BHY_RETURN_FUNCTION_TYPE bhy_get_chip_control(u8 *v_chipcontrol_u8);
1975 BHY_RETURN_FUNCTION_TYPE bhy_set_chip_control(u8 v_chipcontrol_u8);
1992 BHY_RETURN_FUNCTION_TYPE bhy_get_host_status(
1993 u8 *v_algo_standby_u8, u8 *v_algo_id_u8,
1994 u8 *v_host_interface_id_u8);
2023 BHY_RETURN_FUNCTION_TYPE bhy_get_interrupt_status(
2024 u8 *v_host_int_u8,
2025 u8 *v_wakeup_water_mark_u8, u8 *v_wakeup_latency_u8,
2026 u8 *v_wakeup_immediate_u8, u8 *v_non_wakeup_water_mark_u8,
2027 u8 *v_non_wakeup_latency_u8, u8 *v_non_wakeup_immediate_u8);
2050 BHY_RETURN_FUNCTION_TYPE bhy_get_chip_status(
2051 u8 *v_eeprom_detected_u8,
2052 u8 *v_ee_upload_done_u8, u8 *v_ee_upload_error_u8,
2053 u8 *v_firmware_idle_u8, u8 *v_no_eeprom_u8);
2070 BHY_RETURN_FUNCTION_TYPE bhy_read_bytes_remaining(
2071 u16 *v_bytes_remaining_u16);
2091 BHY_RETURN_FUNCTION_TYPE bhy_get_parameter_acknowledge(
2092 u8 *v_parameter_acknowledge_u8);
2115 BHY_RETURN_FUNCTION_TYPE bhy_get_parameter_page_select(
2116 u8 v_page_select_u8, u8 *v_parameter_page_u8);
2134 BHY_RETURN_FUNCTION_TYPE bhy_set_parameter_page_select(
2135 u8 v_page_select_u8);
2165 BHY_RETURN_FUNCTION_TYPE bhy_get_host_interface_control(
2166 u8 *v_algo_standby_req_u8,
2167 u8 *v_abort_transfer_u8, u8 *v_update_transfer_cnt_u8,
2168 u8 *v_wakeup_fifo_intr_disable_u8, u8 *v_ned_coordinates_u8,
2169 u8 *v_ap_suspend_u8, u8 *v_sensor_selftest_u8,
2170 u8 *v_non_wakeup_fifo_intr_disable_u8);
2200 BHY_RETURN_FUNCTION_TYPE bhy_set_host_interface_control(
2201 u8 v_host_interface_select_u8, u8 v_host_interface_status_u8);
2216 BHY_RETURN_FUNCTION_TYPE bhy_get_parameter_request(
2217 u8 *v_parameter_request_u8);
2232 BHY_RETURN_FUNCTION_TYPE bhy_set_parameter_request(
2233 u8 v_parameter_request_u8);
2248 BHY_RETURN_FUNCTION_TYPE bhy_get_host_irq_timestamp(
2249 u32 *v_host_irq_timestamp_u32);
2264 BHY_RETURN_FUNCTION_TYPE bhy_get_rom_version(
2265 u16 *v_rom_version_u16);
2280 BHY_RETURN_FUNCTION_TYPE bhy_get_ram_version(
2281 u16 *v_ram_version_u16);
2296 BHY_RETURN_FUNCTION_TYPE bhy_get_product_id(u8 *v_product_id_u8);
2311 BHY_RETURN_FUNCTION_TYPE bhy_get_revision_id(u8 *v_revision_id_u8);
2326 BHY_RETURN_FUNCTION_TYPE bhy_get_crc_host(u32 *v_crc_host_u32);
2341 BHY_RETURN_FUNCTION_TYPE bhy_set_reset_request(u8 v_reset_request_u8);
2405 BHY_RETURN_FUNCTION_TYPE bhy_set_meta_event(
2406 u8 v_meta_event_u8,
2407 u8 v_input_data_u8, u8 v_event_type_u8,
2408 u8 v_meta_parameter_request_u8);
2471 BHY_RETURN_FUNCTION_TYPE bhy_get_meta_event(
2472 u8 v_meta_event_u8, u8 v_event_type_u8,
2473 u8* meta_event_intr,
2474 u8* meta_event_event,
2475 u8 v_meta_parameter_request_u8);
2497 BHY_RETURN_FUNCTION_TYPE bhy_get_fifo_water_mark(
2498 u8 v_parameter_u8, u16 *v_fifo_water_mark_u16);
2520 BHY_RETURN_FUNCTION_TYPE bhy_set_fifo_water_mark(u8 v_parameter_u8,
2521 u16 v_fifo_water_mark_u16);
2545 BHY_RETURN_FUNCTION_TYPE bhy_get_fifo_size(
2546 u8 v_fifo_size_select_u8, u16 *v_fifo_size_u16);
2547 
2595 BHY_RETURN_FUNCTION_TYPE bhy_get_sensor_status_bank(
2596 u8 v_sensor_status_parameter_u8, u8 v_sensor_type_u8);
2622 BHY_RETURN_FUNCTION_TYPE bhy_get_time_stamp(
2623 u8 v_time_stamp_selection_u8, u32 *v_time_stamp_u32);
2648 BHY_RETURN_FUNCTION_TYPE bhy_get_physical_sensor_status(
2649 struct accel_physical_status_t *accel_status,
2650 struct gyro_physical_status_t *gyro_status,
2651 struct mag_physical_status_t *mag_status);
2698 BHY_RETURN_FUNCTION_TYPE bhy_get_non_wakeup_sensor_information(
2699 u8 v_parameter_request_u8,
2700 struct sensor_information_non_wakeup_t *sensor_information);
2747 BHY_RETURN_FUNCTION_TYPE bhy_get_wakeup_sensor_information(
2748 u8 v_parameter_request_u8,
2749 struct sensor_information_wakeup_t *sensor_information);
2793 BHY_RETURN_FUNCTION_TYPE bhy_set_non_wakeup_sensor_configuration(
2794 struct sensor_configuration_non_wakeup_t *sensor_configuration,
2795 u8 v_parameter_request_u8);
2843 BHY_RETURN_FUNCTION_TYPE bhy_get_non_wakeup_sensor_configuration(
2844 u8 v_parameter_request_u8, u16 *v_sample_rate_u16,
2845 u16 *v_max_report_latency_u16,
2846 u16 *v_change_sensitivity_u16, u16 *v_dynamic_range_u16);
2891 BHY_RETURN_FUNCTION_TYPE bhy_set_wakeup_sensor_configuration(
2892 struct sensor_configuration_wakeup_t *sensor_configuration,
2893 u8 v_parameter_request_u8);
2941 BHY_RETURN_FUNCTION_TYPE bhy_get_wakeup_sensor_configuration(
2942 u8 v_parameter_request_u8, u16 *v_sample_rate_u16,
2943 u16 *v_max_report_latency_u16,
2944 u16 *v_change_sensitivity_u16, u16 *v_dynamic_range_u16);
2966 BHY_RETURN_FUNCTION_TYPE bhy_set_soft_pass_through(
2967 struct soft_pass_through_write_t *soft_pass_through,
2968 u8 v_parameter_request_u8);
2991 BHY_RETURN_FUNCTION_TYPE bhy_get_soft_pass_through(
2992 struct soft_pass_through_read_t *soft_pass_through,
2993 u8 v_parameter_request_u8);
3009 BHY_RETURN_FUNCTION_TYPE bhy_read_parameter_bytes(
3010 u8 v_page_select_u8, u8 v_parameter_request_u8);
3026 BHY_RETURN_FUNCTION_TYPE bhy_write_parameter_bytes(
3027 u8 v_page_select_u8, u8 v_parameter_request_u8);
3043 BHY_RETURN_FUNCTION_TYPE bhy_initialize(
3044 u8 *memory, u32 v_file_length_u32);
3045 BHY_RETURN_FUNCTION_TYPE bhy_initialize_from_rom(
3046 const u8 *memory, const u32 v_file_length_u32);
3047 
3048 
3049 #endif
signed int s32
Definition: bhy.h:187
unsigned int u32
Definition: bhy.h:192
BHY_RETURN_FUNCTION_TYPE bhy_write_parameter_bytes(u8 v_page_select_u8, u8 v_parameter_request_u8)
API used to set the data from the parameter I2C page register from 0x5C to 0x63.
Definition: bhy.c:4273
signed char s8
If your machine support 16 bit define the MACHINE_16_BIT.
Definition: bhy.h:185
BHY_RETURN_FUNCTION_TYPE bhy_get_product_id(u8 *v_product_id_u8)
API used to get the product id request from the register 0x90 bit 0 to 7.
Definition: bhy.c:1097
BHY_RETURN_FUNCTION_TYPE bhy_get_non_wakeup_sensor_configuration(u8 v_parameter_request_u8, u16 *v_sample_rate_u16, u16 *v_max_report_latency_u16, u16 *v_change_sensitivity_u16, u16 *v_dynamic_range_u16)
API used to get the sensor non wakeup configuration Sensor page-3 parameter 65 to 89.
Definition: bhy.c:3871
BHY_RETURN_FUNCTION_TYPE bhy_get_rom_version(u16 *v_rom_version_u16)
API used to get the ROM version request from the register 0x70 to 0x71 bit 0 to 7.
Definition: bhy.c:1024
BHY_RETURN_FUNCTION_TYPE bhy_set_reset_request(u8 v_reset_request_u8)
API used to set the reset request from the register 0x9B bit 0 to 7.
Definition: bhy.c:1207
BHY_RETURN_FUNCTION_TYPE bhy_set_meta_event(u8 v_meta_event_u8, u8 v_input_data_u8, u8 v_event_type_u8, u8 v_meta_parameter_request_u8)
API used to get the meta event control from system page-1 parameter 1.
Definition: bhy.c:1757
BHY_RETURN_FUNCTION_TYPE bhy_get_parameter_page_select(u8 v_page_select_u8, u8 *v_parameter_page_u8)
API used to get the parameter page select from the register 0x54 bit 0 to 7.
Definition: bhy.c:583
BHY_RETURN_FUNCTION_TYPE bhy_get_host_status(u8 *v_algo_standby_u8, u8 *v_algo_id_u8, u8 *v_host_interface_id_u8)
API used to get the host status from the register 0x35 bit 0 to 7.
Definition: bhy.c:328
signed short int s16
Definition: bhy.h:186
BHY_RETURN_FUNCTION_TYPE bhy_get_host_irq_timestamp(u32 *v_host_irq_timestamp_u32)
API used to get the host IRQ time stamp request from the register 0x6C to 0x6F bit 0 to 7.
Definition: bhy.c:983
BHY_RETURN_FUNCTION_TYPE bhy_get_host_interface_control(u8 *v_algo_standby_req_u8, u8 *v_abort_transfer_u8, u8 *v_update_transfer_cnt_u8, u8 *v_wakeup_fifo_intr_disable_u8, u8 *v_ned_coordinates_u8, u8 *v_ap_suspend_u8, u8 *v_sensor_selftest_u8, u8 *v_non_wakeup_fifo_intr_disable_u8)
API used to get the host interface control from the register 0x55 bit 0 to 7.
Definition: bhy.c:681
BHY_RETURN_FUNCTION_TYPE bhy_write_reg(u8 v_addr_u8, u8 *v_data_u8, u16 v_len_u16)
This API write the data to the given register.
Definition: bhy.c:122
BHY_RETURN_FUNCTION_TYPE bhy_set_wakeup_sensor_configuration(struct sensor_configuration_wakeup_t *sensor_configuration, u8 v_parameter_request_u8)
API used to set the sensor wakeup configuration Sensor page-3 parameter 65 to 89.
Definition: bhy.c:3944
BHY_RETURN_FUNCTION_TYPE bhy_set_parameter_page_select(u8 v_page_select_u8)
API used to set the parameter page select from the register 0x54 bit 0 to 7.
Definition: bhy.c:632
BHY_RETURN_FUNCTION_TYPE bhy_read_bytes_remaining(u16 *v_bytes_remaining_u16)
API used to get the bytes remaining from the register 0x38 and 0x39 bit 0 to 7.
Definition: bhy.c:499
BHY_RETURN_FUNCTION_TYPE bhy_set_non_wakeup_sensor_configuration(struct sensor_configuration_non_wakeup_t *sensor_configuration, u8 v_parameter_request_u8)
API used to set the sensor non wakeup configuration Sensor page-3 parameter 65 to 89.
Definition: bhy.c:3783
BHY_RETURN_FUNCTION_TYPE bhy_get_meta_event(u8 v_meta_event_u8, u8 v_event_type_u8, u8 *meta_event_intr, u8 *meta_event_event, u8 v_meta_parameter_request_u8)
API used to get the meta event control from system page-1 parameter 1.
Definition: bhy.c:2398
BHY_RETURN_FUNCTION_TYPE bhy_set_chip_control(u8 v_chipcontrol_u8)
API used to set the chip control from the register 0x34 bit 0 to 7.
Definition: bhy.c:287
BHY_RETURN_FUNCTION_TYPE bhy_get_chip_status(u8 *v_eeprom_detected_u8, u8 *v_ee_upload_done_u8, u8 *v_ee_upload_error_u8, u8 *v_firmware_idle_u8, u8 *v_no_eeprom_u8)
API used to get the chip status from the register 0x37 bit 0 to 7.
Definition: bhy.c:448
BHY_RETURN_FUNCTION_TYPE bhy_get_time_stamp(u8 v_time_stamp_selection_u8, u32 *v_time_stamp_u32)
API used to get the host IRQ time stamp and current time stamp from system page-1 parameter 30 Host I...
Definition: bhy.c:3439
BHY_RETURN_FUNCTION_TYPE bhy_read_reg(u8 v_addr_u8, u8 *v_data_u8, u16 v_len_u16)
This API reads the data from the given register.
Definition: bhy.c:155
BHY_RETURN_FUNCTION_TYPE bhy_get_fifo_size(u8 v_fifo_size_select_u8, u16 *v_fifo_size_u16)
API used to get the fifo size from system page-1 parameter 2.
Definition: bhy.c:3174
BHY_RETURN_FUNCTION_TYPE bhy_get_ram_version(u16 *v_ram_version_u16)
API used to get the RAM version request from the register 0x72 to 0x73 bit 0 to 7.
Definition: bhy.c:1060
BHY_RETURN_FUNCTION_TYPE bhy_get_interrupt_status(u8 *v_host_int_u8, u8 *v_wakeup_water_mark_u8, u8 *v_wakeup_latency_u8, u8 *v_wakeup_immediate_u8, u8 *v_non_wakeup_water_mark_u8, u8 *v_non_wakeup_latency_u8, u8 *v_non_wakeup_immediate_u8)
API used to get the interrupt status from the register 0x36 bit 0 to 7.
Definition: bhy.c:384
BHY_RETURN_FUNCTION_TYPE bhy_get_crc_host(u32 *v_crc_host_u32)
API used to get the CRC host request from the register 0x91 bit 0 to 7.
Definition: bhy.c:1161
BHY_RETURN_FUNCTION_TYPE bhy_get_non_wakeup_sensor_information(u8 v_parameter_request_u8, struct sensor_information_non_wakeup_t *sensor_information)
API used to get the non wakeup sensor information, Sensor page-3 parameter 1 to 31.
Definition: bhy.c:3598
unsigned short int u16
Definition: bhy.h:191
BHY_RETURN_FUNCTION_TYPE bhy_set_fifo_flush(u8 v_fifo_flush_u8)
API used to set the FIFO flush from the register 0x32 bit 0 to 7.
Definition: bhy.c:213
BHY_RETURN_FUNCTION_TYPE bhy_set_soft_pass_through(struct soft_pass_through_write_t *soft_pass_through, u8 v_parameter_request_u8)
API used to set the soft pass through Sensor page-15 parameter 0 to 7.
Definition: bhy.c:4135
BHY_RETURN_FUNCTION_TYPE bhy_set_parameter_request(u8 v_parameter_request_u8)
API used to get the parameter request from the register 0x64 bit 0 to 7.
Definition: bhy.c:950
BHY_RETURN_FUNCTION_TYPE bhy_init(struct bhy_t *bhy)
This function is used for initialize bus read and bus write functions and device address product id i...
Definition: bhy.c:90
BHY_RETURN_FUNCTION_TYPE bhy_initialize(u8 *memory, u32 v_file_length_u32)
API used to flash the ram patch. There is two versions, one that accepts constant input data.
Definition: bhy.c:1239
BHY_RETURN_FUNCTION_TYPE bhy_get_fifo_water_mark(u8 v_parameter_u8, u16 *v_fifo_water_mark_u16)
API used to get the fifo water mark from system page-1 parameter 2.
Definition: bhy.c:3058
BHY_RETURN_FUNCTION_TYPE bhy_get_parameter_request(u8 *v_parameter_request_u8)
API used to get the parameter request from the register 0x64 bit 0 to 7.
Definition: bhy.c:917
BHY_RETURN_FUNCTION_TYPE bhy_get_fifo_flush(u8 *v_fifo_flush_u8)
API used to get the FIFO flush from the register 0x32 bit 0 to 7.
Definition: bhy.c:183
BHY_RETURN_FUNCTION_TYPE bhy_get_sensor_status_bank(u8 v_sensor_status_parameter_u8, u8 v_sensor_type_u8)
API used to get the sensor status bank from system page-1 parameter 3 to 6.
Definition: bhy.c:3315
BHY_RETURN_FUNCTION_TYPE bhy_get_wakeup_sensor_information(u8 v_parameter_request_u8, struct sensor_information_wakeup_t *sensor_information)
API used to get the wakeup sensor information, Sensor page-3 parameter 32 to 63.
Definition: bhy.c:3692
BHY_RETURN_FUNCTION_TYPE bhy_get_parameter_acknowledge(u8 *v_parameter_acknowledge_u8)
API used to get the parameter acknowledgement from the register 0x3A bit 0 to 7.
Definition: bhy.c:542
BHY_RETURN_FUNCTION_TYPE bhy_set_fifo_water_mark(u8 v_parameter_u8, u16 v_fifo_water_mark_u16)
API used to set the fifo water mark from system page-1 parameter 2.
Definition: bhy.c:3114
BHY_RETURN_FUNCTION_TYPE bhy_get_soft_pass_through(struct soft_pass_through_read_t *soft_pass_through, u8 v_parameter_request_u8)
API used to get the soft pass through Sensor page-15 parameter 0 to 7.
Definition: bhy.c:4078
BHY_RETURN_FUNCTION_TYPE bhy_get_revision_id(u8 *v_revision_id_u8)
API used to get the revision id request from the register 0x91 bit 0 to 7.
Definition: bhy.c:1129
BHY_RETURN_FUNCTION_TYPE bhy_get_physical_sensor_status(struct accel_physical_status_t *accel_status, struct gyro_physical_status_t *gyro_status, struct mag_physical_status_t *mag_status)
API used to get the physical sensor status system page-1 parameter 31.
Definition: bhy.c:3512
unsigned char u8
Definition: bhy.h:190
BHY_RETURN_FUNCTION_TYPE bhy_set_host_interface_control(u8 v_host_interface_select_u8, u8 v_host_interface_status_u8)
API used to set the host interface control from the register 0x55 bit 0 to 7.
Definition: bhy.c:757
BHY_RETURN_FUNCTION_TYPE bhy_read_parameter_bytes(u8 v_page_select_u8, u8 v_parameter_request_u8)
API used to get the data from the parameter I2C page register from 0x3B to 0x4A.
Definition: bhy.c:4187
BHY_RETURN_FUNCTION_TYPE bhy_get_wakeup_sensor_configuration(u8 v_parameter_request_u8, u16 *v_sample_rate_u16, u16 *v_max_report_latency_u16, u16 *v_change_sensitivity_u16, u16 *v_dynamic_range_u16)
API used to get the sensor wakeup configuration Sensor page-3 parameter 65 to 89.
Definition: bhy.c:4027
BHY_RETURN_FUNCTION_TYPE bhy_get_chip_control(u8 *v_chipcontrol_u8)
API used to get the chip control from the register 0x34 bit 0 to 7.
Definition: bhy.c:253
physical sensor status This structure holds accel physical sensor status
Definition: bhy.h:716
u8 accel_flag
Definition: bhy.h:719
u16 accel_dynamic_range
Definition: bhy.h:718
u16 accel_sample_rate
Definition: bhy.h:717
used for processing the activity data
Definition: bhy.h:899
u8 bit_off
Definition: bhy.h:901
u8 bit_on
Definition: bhy.h:900
barometer data
Definition: bhy.h:906
u32 barometer
Definition: bhy.h:907
BHY structure This structure holds all relevant information about BHY.
Definition: bhy.h:572
BHY_WR_FUNC_PTR
Definition: bhy.h:575
BHY_RD_FUNC_PTR
Definition: bhy.h:577
void(* delay_msec)(BHY_MDELAY_DATA_TYPE)
Definition: bhy.h:581
BHY_BRD_FUNC_PTR
Definition: bhy.h:579
u8 device_addr
Definition: bhy.h:574
u8 product_id
Definition: bhy.h:573
used to process BSX_A, BSX_B and BSX_C data
Definition: bhy.h:921
s32 y
Definition: bhy.h:923
s32 x
Definition: bhy.h:922
s32 z
Definition: bhy.h:924
u32 timestamp
Definition: bhy.h:925
u8 vector
Definition: bhy.h:926
Definition: bhy.h:1248
s16 base
Definition: bhy.h:1251
u8 minor
Definition: bhy.h:1249
u8 major
Definition: bhy.h:1250
used for only one data validation of unsigned integer like light,humidity,proximity,...
Definition: bhy.h:865
u16 data_process
Definition: bhy.h:866
physical sensor status This structure holds gyro physical sensor status
Definition: bhy.h:725
u16 gyro_dynamic_range
Definition: bhy.h:727
u8 gyro_flag
Definition: bhy.h:728
u16 gyro_sample_rate
Definition: bhy.h:726
processing the one byte data like heart rate
Definition: bhy.h:914
u8 data
Definition: bhy.h:915
physical sensor status This structure holds mag physical sensor status
Definition: bhy.h:734
u16 mag_sample_rate
Definition: bhy.h:735
u8 mag_flag
Definition: bhy.h:737
u16 mag_dynamic_range
Definition: bhy.h:736
meta event Event structure This structure holds meta event Event details
Definition: bhy.h:665
u8 meta_event4_event
Definition: bhy.h:669
u8 meta_event29_event
Definition: bhy.h:694
u8 meta_event23_event
Definition: bhy.h:688
u8 meta_event20_event
Definition: bhy.h:685
u8 meta_event32_event
Definition: bhy.h:697
u8 meta_event18_event
Definition: bhy.h:683
u8 meta_event9_event
Definition: bhy.h:674
u8 meta_event25_event
Definition: bhy.h:690
u8 meta_event7_event
Definition: bhy.h:672
u8 meta_event1_event
Definition: bhy.h:666
u8 meta_event13_event
Definition: bhy.h:678
u8 meta_event5_event
Definition: bhy.h:670
u8 meta_event15_event
Definition: bhy.h:680
u8 meta_event26_event
Definition: bhy.h:691
u8 meta_event30_event
Definition: bhy.h:695
u8 meta_event28_event
Definition: bhy.h:693
u8 meta_event2_event
Definition: bhy.h:667
u8 meta_event19_event
Definition: bhy.h:684
u8 meta_event12_event
Definition: bhy.h:677
u8 meta_event27_event
Definition: bhy.h:692
u8 meta_event16_event
Definition: bhy.h:681
u8 meta_event8_event
Definition: bhy.h:673
u8 meta_event3_event
Definition: bhy.h:668
u8 meta_event17_event
Definition: bhy.h:682
u8 meta_event11_event
Definition: bhy.h:676
u8 meta_event22_event
Definition: bhy.h:687
u8 meta_event14_event
Definition: bhy.h:679
u8 meta_event21_event
Definition: bhy.h:686
u8 meta_event6_event
Definition: bhy.h:671
u8 meta_event10_event
Definition: bhy.h:675
u8 meta_event24_event
Definition: bhy.h:689
u8 meta_event31_event
Definition: bhy.h:696
meta event interrupt structure This structure holds meta event interrupt details
Definition: bhy.h:626
u8 meta_event32_intr
Definition: bhy.h:658
u8 meta_event11_intr
Definition: bhy.h:637
u8 meta_event22_intr
Definition: bhy.h:648
u8 meta_event27_intr
Definition: bhy.h:653
u8 meta_event17_intr
Definition: bhy.h:643
u8 meta_event1_intr
Definition: bhy.h:627
u8 meta_event2_intr
Definition: bhy.h:628
u8 meta_event9_intr
Definition: bhy.h:635
u8 meta_event21_intr
Definition: bhy.h:647
u8 meta_event29_intr
Definition: bhy.h:655
u8 meta_event25_intr
Definition: bhy.h:651
u8 meta_event18_intr
Definition: bhy.h:644
u8 meta_event28_intr
Definition: bhy.h:654
u8 meta_event12_intr
Definition: bhy.h:638
u8 meta_event3_intr
Definition: bhy.h:629
u8 meta_event14_intr
Definition: bhy.h:640
u8 meta_event20_intr
Definition: bhy.h:646
u8 meta_event19_intr
Definition: bhy.h:645
u8 meta_event6_intr
Definition: bhy.h:632
u8 meta_event13_intr
Definition: bhy.h:639
u8 meta_event26_intr
Definition: bhy.h:652
u8 meta_event7_intr
Definition: bhy.h:633
u8 meta_event31_intr
Definition: bhy.h:657
u8 meta_event5_intr
Definition: bhy.h:631
u8 meta_event15_intr
Definition: bhy.h:641
u8 meta_event4_intr
Definition: bhy.h:630
u8 meta_event16_intr
Definition: bhy.h:642
u8 meta_event8_intr
Definition: bhy.h:634
u8 meta_event23_intr
Definition: bhy.h:649
u8 meta_event30_intr
Definition: bhy.h:656
u8 meta_event24_intr
Definition: bhy.h:650
u8 meta_event10_intr
Definition: bhy.h:636
BHY parameter read buffer structure holds all relevant information about the respective parameter byt...
Definition: bhy.h:588
u8 parameter_14
Definition: bhy.h:602
u8 parameter_6
Definition: bhy.h:594
u8 parameter_1
Definition: bhy.h:589
u8 parameter_15
Definition: bhy.h:603
u8 parameter_3
Definition: bhy.h:591
u8 parameter_9
Definition: bhy.h:597
u8 parameter_4
Definition: bhy.h:592
u8 parameter_8
Definition: bhy.h:596
u8 parameter_16
Definition: bhy.h:604
u8 parameter_13
Definition: bhy.h:601
u8 parameter_12
Definition: bhy.h:600
u8 parameter_7
Definition: bhy.h:595
u8 parameter_2
Definition: bhy.h:590
u8 parameter_11
Definition: bhy.h:599
u8 parameter_10
Definition: bhy.h:598
u8 parameter_5
Definition: bhy.h:593
BHY load parameter bytes structure This structure holds all relevant information about BHY load param...
Definition: bhy.h:611
u8 write_parameter_byte6
Definition: bhy.h:617
u8 write_parameter_byte5
Definition: bhy.h:616
u8 write_parameter_byte8
Definition: bhy.h:619
u8 write_parameter_byte2
Definition: bhy.h:613
u8 write_parameter_byte7
Definition: bhy.h:618
u8 write_parameter_byte1
Definition: bhy.h:612
u8 write_parameter_byte4
Definition: bhy.h:615
u8 write_parameter_byte3
Definition: bhy.h:614
used for processing the meta events
Definition: bhy.h:877
u8 event_spec
Definition: bhy.h:880
u8 sensor_type
Definition: bhy.h:879
u8 event_number
Definition: bhy.h:878
used for processing the temperature data
Definition: bhy.h:871
s16 temperature
Definition: bhy.h:872
Sensor configuration This structure holds non wakeup sensor configuration.
Definition: bhy.h:781
u16 non_wakeup_dynamic_range
Definition: bhy.h:785
u16 non_wakeup_sample_rate
Definition: bhy.h:782
u16 non_wakeup_max_report_latency
Definition: bhy.h:783
u16 non_wakeup_change_sensitivity
Definition: bhy.h:784
Sensor configuration This structure holds wakeup sensor configuration.
Definition: bhy.h:791
u16 wakeup_change_sensitivity
Definition: bhy.h:794
u16 wakeup_sample_rate
Definition: bhy.h:792
u16 wakeup_dynamic_range
Definition: bhy.h:795
u16 wakeup_max_report_latency
Definition: bhy.h:793
Sensor information This structure holds non wakeup sensor information.
Definition: bhy.h:743
u16 non_wakeup_max_rate
Definition: bhy.h:752
u8 non_wakeup_event_size
Definition: bhy.h:755
u16 non_wakeup_fifo_max
Definition: bhy.h:754
u8 non_wakeup_driver_id
Definition: bhy.h:745
u16 non_wakeup_max_range
Definition: bhy.h:748
u8 non_wakeup_min_rate
Definition: bhy.h:756
u8 non_wakeup_power
Definition: bhy.h:747
u16 non_wakeup_fifo_reserved
Definition: bhy.h:753
u8 non_wakeup_sensor_type
Definition: bhy.h:744
u8 non_wakeup_driver_version
Definition: bhy.h:746
u16 non_wakeup_resolution
Definition: bhy.h:750
Sensor information This structure holds wakeup sensor information.
Definition: bhy.h:762
u8 wakeup_sensor_type
Definition: bhy.h:763
u8 wakeup_min_rate
Definition: bhy.h:775
u16 wakeup_resolution
Definition: bhy.h:769
u16 wakeup_max_range
Definition: bhy.h:767
u16 wakeup_max_rate
Definition: bhy.h:771
u16 wakeup_fifo_max
Definition: bhy.h:773
u8 wakeup_driver_id
Definition: bhy.h:764
u8 wakeup_power
Definition: bhy.h:766
u8 wakeup_event_size
Definition: bhy.h:774
u16 wakeup_fifo_reserved
Definition: bhy.h:772
u8 wakeup_driver_version
Definition: bhy.h:765
sensor status bank structure This structure holds sensor status bank information
Definition: bhy.h:703
u8 data_lost
Definition: bhy.h:708
u8 device_id_error
Definition: bhy.h:706
u8 transient_error
Definition: bhy.h:707
u8 data_available
Definition: bhy.h:704
u8 i2c_nack
Definition: bhy.h:705
u8 sensor_power_mode
Definition: bhy.h:709
Sensor configuration This structure holds soft pass through informations.
Definition: bhy.h:801
u8 completion_status
Definition: bhy.h:805
u8 start_register
Definition: bhy.h:803
u8 read_length
Definition: bhy.h:804
u8 reg_value_byte3
Definition: bhy.h:808
u8 i2c_slave_address
Definition: bhy.h:802
u8 reg_value_byte1
Definition: bhy.h:806
u8 reg_value_byte2
Definition: bhy.h:807
u8 reg_value_byte4
Definition: bhy.h:809
Sensor configuration This structure holds write soft pass through informations.
Definition: bhy.h:815
u8 reg_value_byte4
Definition: bhy.h:823
u8 write_length
Definition: bhy.h:818
u8 i2c_slave_address
Definition: bhy.h:816
u8 reg_value_byte1
Definition: bhy.h:820
u8 reg_value_byte2
Definition: bhy.h:821
u8 reg_value_byte3
Definition: bhy.h:822
u8 completion_status
Definition: bhy.h:819
u8 start_register
Definition: bhy.h:817
used for processing the uncalib mag and gyro data
Definition: bhy.h:886
s16 bias_z
Definition: bhy.h:892
s16 uncalib_z
Definition: bhy.h:889
s16 bias_y
Definition: bhy.h:891
s16 bias_x
Definition: bhy.h:890
u8 accuracy
Definition: bhy.h:893
s16 uncalib_y
Definition: bhy.h:888
s16 uncalib_x
Definition: bhy.h:887
used for x,y,z and accuracy status data processing
Definition: bhy.h:834
u8 accuracy
Definition: bhy.h:841
s16 z
Definition: bhy.h:839
s16 x
Definition: bhy.h:835
s16 y
Definition: bhy.h:837
used for x,y,z,w and radians status data processing
Definition: bhy.h:848
s16 radians
Definition: bhy.h:857
s16 w
Definition: bhy.h:855
s16 x
Definition: bhy.h:849
s16 y
Definition: bhy.h:851
s16 z
Definition: bhy.h:853