76 #include <linux/types.h>
84 typedef u_int16_t
u16;
85 typedef u_int32_t
u32;
86 typedef u_int64_t u64;
95 # if !defined(__STDC_VERSION__)
100 #if (__STDC_VERSION__ == 201112L)
108 typedef uint16_t
u16;
109 typedef uint32_t
u32;
110 typedef uint64_t u64;
121 #elif (__STDC_VERSION__ == 199901L)
131 typedef uint16_t
u16;
132 typedef uint32_t
u32;
133 typedef uint64_t u64;
150 #define MACHINE_32_BIT
156 #ifdef MACHINE_16_BIT
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;
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.
177 typedef unsigned char u8;
178 typedef unsigned short int u16;
179 typedef unsigned long int u32;
183 #elif defined MACHINE_32_BIT
185 typedef signed char s8;
186 typedef signed short int s16;
190 typedef unsigned char u8;
191 typedef unsigned short int u16;
196 #elif defined MACHINE_64_BIT
198 typedef signed char s8;
199 typedef signed short int s16;
200 typedef signed int s32;
201 typedef signed long int s64;
204 typedef unsigned char u8;
205 typedef unsigned short int u16;
206 typedef unsigned int u32;
207 typedef unsigned long int u64;
210 #warning The data types defined above which not supported \
211 define the data types manually
224 #define MACHINE_32_BIT
228 #ifdef MACHINE_16_BIT
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;
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.
249 typedef unsigned char u8;
250 typedef unsigned short int u16;
251 typedef unsigned long int u32;
255 #elif defined MACHINE_32_BIT
257 typedef signed char s8;
258 typedef signed short int s16;
259 typedef signed int s32;
262 typedef unsigned char u8;
263 typedef unsigned short int u16;
264 typedef unsigned int u32;
268 #elif defined MACHINE_64_BIT
270 typedef signed char s8;
271 typedef signed short int s16;
272 typedef signed int s32;
273 typedef signed long int s64;
276 typedef unsigned char u8;
277 typedef unsigned short int u16;
278 typedef unsigned int u32;
279 typedef unsigned long int u64;
282 #warning The data types defined above which not supported \
283 define the data types manually
310 #define BHY_WR_FUNC_PTR s8 (*bus_write)(u8, u8,\
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)
353 #define BHY_SPI_READ_MASK 0x80
355 #define BHY_RD_FUNC_PTR s8 (*bus_read)(u8, u8, u8 *, u16)
357 #define BHY_BRD_FUNC_PTR s8 (*burst_read)(u8, u8, u8 *, u32)
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)
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)
389 #define BHY_MDELAY_DATA_TYPE u32
393 #define BHY_I2C_ADDR1 (0x28)
394 #define BHY_I2C_ADDR2 (0x29)
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)
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)
422 #define BHY_BYTES_REMAINING_SIZE (2)
423 #define BHY_BYTES_REMAINING_LSB (0)
424 #define BHY_BYTES_REMAINING_MSB (1)
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)
436 #define BHY_INDEX_LEN (19)
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)
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)
466 #define BHY_FIFO_SENSOR_DATA_SIZE (100)
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)
483 #define BHY_DELAY_SETTLING_TIME (5)
484 #define BHY_FIFO_BUFFER_SIZE (50)
486 #define BHY_RETURN_FUNCTION_TYPE s8
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)
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)
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)
508 #define BHY_I2C_REG_PARAMETER_READ_BUFFER_ZERO (0x3B)
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)
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)
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)
551 #define BHY_ROM_VERSION_SIZE (2)
552 #define BHY_ROM_VERSION_LSB_DATA (0)
553 #define BHY_ROM_VERSION_MSB_DATA (1)
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)
560 #define BHY_ROM_VERSION_DI01 (u16)(0x2112)
562 #define BHY_ROM_VERSION_DI03 (u16)(0x2DAD)
929 #define BHY_SENSOR_ID_INDEX (1)
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)
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)
955 #define BHY_ACTIVITY_BIT_ON (1)
956 #define BHY_ACTIVITY_BIT_OFF (0)
957 #define BHY_ACTIVITY_LENGTH (2)
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)
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)
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)
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)
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)
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)
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)
1047 #define BHY_PAGE_1 (0x01)
1049 #define BHY_PAGE_2 (0x02)
1051 #define BHY_PAGE_3 (0x03)
1053 #define BHY_PAGE_15 (0x0F)
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)
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)
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)
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)
1235 #define PAGE2_SIC_MATRIX_0_1 1
1236 #define PAGE2_SIC_MATRIX_2_3 2
1237 #define PAGE2_SIC_MATRIX_4_5 3
1238 #define PAGE2_SIC_MATRIX_6_7 4
1239 #define PAGE2_SIC_MATRIX_8 5
1241 #define PAGE2_CUS_FIRMWARE_VERSION 125
1242 #define PAGE2_BSX_VERSION 126
1255 #define BHY_META_EVENT1_INTR_ENABLE (0x01)
1256 #define BHY_META_EVENT1_EVENT_ENABLE (0x02)
1258 #define BHY_META_EVENT2_INTR_ENABLE (0x04)
1259 #define BHY_META_EVENT2_EVENT_ENABLE (0x08)
1261 #define BHY_META_EVENT3_INTR_ENABLE (0x10)
1262 #define BHY_META_EVENT3_EVENT_ENABLE (0x20)
1264 #define BHY_META_EVENT4_INTR_ENABLE (0x40)
1265 #define BHY_META_EVENT4_EVENT_ENABLE (0x80)
1267 #define BHY_META_EVENT5_INTR_ENABLE (0x01)
1268 #define BHY_META_EVENT5_EVENT_ENABLE (0x02)
1270 #define BHY_META_EVENT6_INTR_ENABLE (0x04)
1271 #define BHY_META_EVENT6_EVENT_ENABLE (0x08)
1273 #define BHY_META_EVENT7_INTR_ENABLE (0x10)
1274 #define BHY_META_EVENT7_EVENT_ENABLE (0x20)
1276 #define BHY_META_EVENT8_INTR_ENABLE (0x40)
1277 #define BHY_META_EVENT8_EVENT_ENABLE (0x80)
1279 #define BHY_META_EVENT9_INTR_ENABLE (0x01)
1280 #define BHY_META_EVENT9_EVENT_ENABLE (0x02)
1282 #define BHY_META_EVENT10_INTR_ENABLE (0x04)
1283 #define BHY_META_EVENT10_EVENT_ENABLE (0x08)
1285 #define BHY_META_EVENT11_INTR_ENABLE (0x10)
1286 #define BHY_META_EVENT11_EVENT_ENABLE (0x20)
1288 #define BHY_META_EVENT12_INTR_ENABLE (0x40)
1289 #define BHY_META_EVENT12_EVENT_ENABLE (0x80)
1291 #define BHY_META_EVENT13_INTR_ENABLE (0x01)
1292 #define BHY_META_EVENT13_EVENT_ENABLE (0x02)
1294 #define BHY_META_EVENT14_INTR_ENABLE (0x04)
1295 #define BHY_META_EVENT14_EVENT_ENABLE (0x08)
1297 #define BHY_META_EVENT15_INTR_ENABLE (0x10)
1298 #define BHY_META_EVENT15_EVENT_ENABLE (0x20)
1300 #define BHY_META_EVENT16_INTR_ENABLE (0x40)
1301 #define BHY_META_EVENT16_EVENT_ENABLE (0x80)
1303 #define BHY_META_EVENT17_INTR_ENABLE (0x01)
1304 #define BHY_META_EVENT17_EVENT_ENABLE (0x02)
1306 #define BHY_META_EVENT18_INTR_ENABLE (0x04)
1307 #define BHY_META_EVENT18_EVENT_ENABLE (0x08)
1309 #define BHY_META_EVENT19_INTR_ENABLE (0x10)
1310 #define BHY_META_EVENT19_EVENT_ENABLE (0x20)
1312 #define BHY_META_EVENT20_INTR_ENABLE (0x40)
1313 #define BHY_META_EVENT20_EVENT_ENABLE (0x80)
1315 #define BHY_META_EVENT21_INTR_ENABLE (0x01)
1316 #define BHY_META_EVENT21_EVENT_ENABLE (0x02)
1318 #define BHY_META_EVENT22_INTR_ENABLE (0x04)
1319 #define BHY_META_EVENT22_EVENT_ENABLE (0x08)
1321 #define BHY_META_EVENT23_INTR_ENABLE (0x10)
1322 #define BHY_META_EVENT23_EVENT_ENABLE (0x20)
1324 #define BHY_META_EVENT24_INTR_ENABLE (0x40)
1325 #define BHY_META_EVENT24_EVENT_ENABLE (0x80)
1327 #define BHY_META_EVENT25_INTR_ENABLE (0x01)
1328 #define BHY_META_EVENT25_EVENT_ENABLE (0x02)
1330 #define BHY_META_EVENT26_INTR_ENABLE (0x04)
1331 #define BHY_META_EVENT26_EVENT_ENABLE (0x08)
1333 #define BHY_META_EVENT27_INTR_ENABLE (0x10)
1334 #define BHY_META_EVENT27_EVENT_ENABLE (0x20)
1336 #define BHY_META_EVENT28_INTR_ENABLE (0x40)
1337 #define BHY_META_EVENT28_EVENT_ENABLE (0x80)
1339 #define BHY_META_EVENT29_INTR_ENABLE (0x01)
1340 #define BHY_META_EVENT29_EVENT_ENABLE (0x02)
1342 #define BHY_META_EVENT30_INTR_ENABLE (0x04)
1343 #define BHY_META_EVENT30_EVENT_ENABLE (0x08)
1345 #define BHY_META_EVENT31_INTR_ENABLE (0x10)
1346 #define BHY_META_EVENT31_EVENT_ENABLE (0x20)
1348 #define BHY_META_EVENT32_INTR_ENABLE (0x40)
1349 #define BHY_META_EVENT32_EVENT_ENABLE (0x80)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
1692 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NON_WAKEUP_FIFO_DISABLE__POS \
1694 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NON_WAKEUP_FIFO_DISABLE__MSK \
1696 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NON_WAKEUP_FIFO_DISABLE__LEN \
1698 #define BHY_I2C_REG_HOST_INTERFACE_CONTROL_NON_WAKEUP_FIFO_DISABLE__REG \
1699 (BHY_I2C_REG_HOST_INTERFACE_CONTROL_ADDR)
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)
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)
1721 #define BHY_GET_BITSLICE(regvar, bitname)\
1722 ((regvar & bitname##__MSK) >> bitname##__POS)
1725 #define BHY_SET_BITSLICE(regvar, bitname, val)\
1726 ((regvar & ~bitname##__MSK) | \
1727 ((val<<bitname##__POS)&bitname##__MSK))
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)
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)
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)
1759 #define BHY_PAGE_SELECT_PARAMETER_PAGE (0)
1760 #define BHY_PAGE_SELECT_PARAMETER_SIZE (1)
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)
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)
1786 #define BHY_META_INTR_ENABLE (0)
1787 #define BHY_META_EVENT_ENABLE (1)
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)
1798 #define BHY_SENSOR_ERROR (0)
1799 #define BHY_FIFO_OVERFLOW (1)
1803 #define BHY_DYNAMIC_RANGE (0)
1804 #define BHY_FIFO_WM (1)
1805 #define BHY_SELF_TEST_RESULT (2)
1806 #define BHY_INITIALIZED (3)
1811 #define BHY_FIFO_WATER_MARK_WAKEUP (0)
1812 #define BHY_FIFO_WATER_MARK_NON_WAKEUP (1)
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)
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)
1849 #define PRODUCT_ID_7183 (0x83)
1896 u8 *v_data_u8,
u16 v_len_u16);
1915 u8 *v_data_u8,
u16 v_len_u16);
1993 u8 *v_algo_standby_u8,
u8 *v_algo_id_u8,
1994 u8 *v_host_interface_id_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);
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);
2071 u16 *v_bytes_remaining_u16);
2092 u8 *v_parameter_acknowledge_u8);
2116 u8 v_page_select_u8,
u8 *v_parameter_page_u8);
2135 u8 v_page_select_u8);
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);
2201 u8 v_host_interface_select_u8,
u8 v_host_interface_status_u8);
2217 u8 *v_parameter_request_u8);
2233 u8 v_parameter_request_u8);
2249 u32 *v_host_irq_timestamp_u32);
2265 u16 *v_rom_version_u16);
2281 u16 *v_ram_version_u16);
2407 u8 v_input_data_u8,
u8 v_event_type_u8,
2408 u8 v_meta_parameter_request_u8);
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);
2498 u8 v_parameter_u8,
u16 *v_fifo_water_mark_u16);
2521 u16 v_fifo_water_mark_u16);
2546 u8 v_fifo_size_select_u8,
u16 *v_fifo_size_u16);
2596 u8 v_sensor_status_parameter_u8,
u8 v_sensor_type_u8);
2623 u8 v_time_stamp_selection_u8,
u32 *v_time_stamp_u32);
2699 u8 v_parameter_request_u8,
2748 u8 v_parameter_request_u8,
2795 u8 v_parameter_request_u8);
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);
2893 u8 v_parameter_request_u8);
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);
2968 u8 v_parameter_request_u8);
2993 u8 v_parameter_request_u8);
3010 u8 v_page_select_u8,
u8 v_parameter_request_u8);
3027 u8 v_page_select_u8,
u8 v_parameter_request_u8);
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);
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
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
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 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 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