28 #define LSM6DS3H_DEFAULT_I2C_BUS 0 29 #define LSM6DS3H_DEFAULT_SPI_BUS 0 30 #define LSM6DS3H_DEFAULT_I2C_ADDR 0x6a 32 #define LSM6DS3H_CHIPID 0x69 53 LSM6DS3H_REG_FUNC_CFG_ACCESS = 0x01,
57 LSM6DS3H_REG_SENSOR_SYNC_TIME_FRAME = 0x04,
61 LSM6DS3H_REG_FIFO_CTRL1 = 0x06,
62 LSM6DS3H_REG_FIFO_CTRL2 = 0x07,
63 LSM6DS3H_REG_FIFO_CTRL3 = 0x08,
64 LSM6DS3H_REG_FIFO_CTRL4 = 0x09,
65 LSM6DS3H_REG_FIFO_CTRL5 = 0x0a,
67 LSM6DS3H_REG_ORIENT_CFG_G = 0x0b,
71 LSM6DS3H_REG_INT1_CTRL = 0x0d,
72 LSM6DS3H_REG_INT2_CTRL = 0x0e,
74 LSM6DS3H_REG_WHO_AM_I = 0x0f,
76 LSM6DS3H_REG_CTRL1_XL = 0x10,
77 LSM6DS3H_REG_CTRL2_G = 0x11,
78 LSM6DS3H_REG_CTRL3_C = 0x12,
79 LSM6DS3H_REG_CTRL4_C = 0x13,
80 LSM6DS3H_REG_CTRL5_C = 0x14,
81 LSM6DS3H_REG_CTRL6_C = 0x15,
82 LSM6DS3H_REG_CTRL7_G = 0x16,
83 LSM6DS3H_REG_CTRL8_XL = 0x17,
84 LSM6DS3H_REG_CTRL9_XL = 0x18,
85 LSM6DS3H_REG_CTRL10_C = 0x19,
87 LSM6DS3H_REG_MASTER_CFG = 0x1a,
88 LSM6DS3H_REG_WAKE_UP_SRC = 0x1b,
89 LSM6DS3H_REG_TAP_SRC = 0x1c,
90 LSM6DS3H_REG_TAP_D6D = 0x1d,
93 LSM6DS3H_REG_STATUS = 0x1e,
97 LSM6DS3H_REG_OUT_TEMP_L = 0x20,
98 LSM6DS3H_REG_OUT_TEMP_H = 0x21,
100 LSM6DS3H_REG_OUTX_L_G = 0x22,
101 LSM6DS3H_REG_OUTX_H_G = 0x23,
102 LSM6DS3H_REG_OUTY_L_G = 0x24,
103 LSM6DS3H_REG_OUTY_H_G = 0x25,
104 LSM6DS3H_REG_OUTZ_L_G = 0x26,
105 LSM6DS3H_REG_OUTZ_H_G = 0x27,
107 LSM6DS3H_REG_OUTX_L_XL = 0x28,
108 LSM6DS3H_REG_OUTX_H_XL = 0x29,
109 LSM6DS3H_REG_OUTY_L_XL = 0x2a,
110 LSM6DS3H_REG_OUTY_H_XL = 0x2b,
111 LSM6DS3H_REG_OUTZ_L_XL = 0x2c,
112 LSM6DS3H_REG_OUTZ_H_XL = 0x2d,
114 LSM6DS3H_REG_SENSORHUB1_REG = 0x2e,
115 LSM6DS3H_REG_SENSORHUB2_REG = 0x2f,
116 LSM6DS3H_REG_SENSORHUB3_REG = 0x30,
117 LSM6DS3H_REG_SENSORHUB4_REG = 0x31,
118 LSM6DS3H_REG_SENSORHUB5_REG = 0x32,
119 LSM6DS3H_REG_SENSORHUB6_REG = 0x33,
120 LSM6DS3H_REG_SENSORHUB7_REG = 0x34,
121 LSM6DS3H_REG_SENSORHUB8_REG = 0x35,
122 LSM6DS3H_REG_SENSORHUB9_REG = 0x36,
123 LSM6DS3H_REG_SENSORHUB10_REG = 0x37,
124 LSM6DS3H_REG_SENSORHUB11_REG = 0x38,
125 LSM6DS3H_REG_SENSORHUB12_REG = 0x39,
127 LSM6DS3H_REG_FIFO_STATUS1 = 0x3a,
128 LSM6DS3H_REG_FIFO_STATUS2 = 0x3b,
129 LSM6DS3H_REG_FIFO_STATUS3 = 0x3c,
130 LSM6DS3H_REG_FIFO_STATUS4 = 0x3d,
132 LSM6DS3H_REG_FIFO_DATA_OUT_L = 0x3e,
133 LSM6DS3H_REG_FIFO_DATA_OUT_H = 0x3f,
135 LSM6DS3H_REG_TIMESTAMP0_REG = 0x40,
136 LSM6DS3H_REG_TIMESTAMP1_REG = 0x41,
137 LSM6DS3H_REG_TIMESTAMP2_REG = 0x42,
141 LSM6DS3H_REG_STEP_TIMESTAMP_L = 0x49,
142 LSM6DS3H_REG_STEP_TIMESTAMP_H = 0x4a,
144 LSM6DS3H_REG_STEP_COUNTER_L = 0x4b,
145 LSM6DS3H_REG_STEP_COUNTER_H = 0x4c,
147 LSM6DS3H_REG_SENSORHUB13_REG = 0x4d,
148 LSM6DS3H_REG_SENSORHUB14_REG = 0x4e,
149 LSM6DS3H_REG_SENSORHUB15_REG = 0x4f,
150 LSM6DS3H_REG_SENSORHUB16_REG = 0x50,
151 LSM6DS3H_REG_SENSORHUB17_REG = 0x51,
152 LSM6DS3H_REG_SENSORHUB18_REG = 0x52,
154 LSM6DS3H_REG_FUNC_SRC = 0x53,
158 LSM6DS3H_REG_TAP_CFG = 0x58,
159 LSM6DS3H_REG_TAP_THS_6D = 0x59,
162 LSM6DS3H_REG_INT_DUR2 = 0x5a,
164 LSM6DS3H_REG_WAKE_UP_THS = 0x5b,
165 LSM6DS3H_REG_WAKE_UP_DUR = 0x5c,
167 LSM6DS3H_REG_FREE_FALL = 0x5d,
169 LSM6DS3H_REG_MD1_CFG = 0x5e,
170 LSM6DS3H_REG_MD2_CFG = 0x5f,
174 LSM6DS3H_REG_OUT_MAG_RAW_X_L = 0x66,
175 LSM6DS3H_REG_OUT_MAG_RAW_X_H = 0x67,
176 LSM6DS3H_REG_OUT_MAG_RAW_Y_L = 0x68,
177 LSM6DS3H_REG_OUT_MAG_RAW_Y_H = 0x69,
178 LSM6DS3H_REG_OUT_MAG_RAW_Z_L = 0x6a,
179 LSM6DS3H_REG_OUT_MAG_RAW_Z_H = 0x6b,
183 LSM6DS3H_REG_CTRL_SPIAUX = 0x70,
191 LSM6DS3H_FUNC_CFG_EN = 0x80,
192 } LSM6DS3H_FUNC_CFG_ACCESS_BITS_T;
199 LSM6DS3H_ORIENT_CFG_G_ORIENT0 = 0x01,
200 LSM6DS3H_ORIENT_CFG_G_ORIENT1 = 0x02,
201 LSM6DS3H_ORIENT_CFG_G_ORIENT2 = 0x04,
202 _LSM6DS3H_ORIENT_CFG_G_ORIENT_MASK = 7,
203 _LSM6DS3H_ORIENT_CFG_G_ORIENT_SHIFT = 0,
205 LSM6DS3H_ORIENT_CFG_G_SIGNZ = 0x08,
206 LSM6DS3H_ORIENT_CFG_G_SIGNY = 0x10,
207 LSM6DS3H_ORIENT_CFG_G_SIGNX = 0x20,
210 } LSM6DS3H_ORIENT_CFG_G_BITS_T;
216 LSM6DS3H_ORIENT_CFG_G_XYZ = 0,
217 LSM6DS3H_ORIENT_CFG_G_XZY = 1,
218 LSM6DS3H_ORIENT_CFG_G_YXZ = 2,
219 LSM6DS3H_ORIENT_CFG_G_YZX = 3,
220 LSM6DS3H_ORIENT_CFG_G_ZXY = 4,
221 LSM6DS3H_ORIENT_CFG_G_ZYX = 5,
222 } LSM6DS3H_ORIENT_G_ORIENT_T;
228 LSM6DS3H_INT1_CTRL_DRDY_XL = 0x01,
229 LSM6DS3H_INT1_CTRL_DRDY_G = 0x02,
230 LSM6DS3H_INT1_CTRL_BOOT = 0x04,
231 LSM6DS3H_INT1_CTRL_FTH = 0x08,
232 LSM6DS3H_INT1_CTRL_FIFO_OVR = 0x10,
233 LSM6DS3H_INT1_CTRL_FULL_FLAG = 0x20,
234 LSM6DS3H_INT1_CTRL_SIGN_MOT = 0x40,
235 LSM6DS3H_INT1_CTRL_STEP_DETECTOR = 0x80,
236 } LSM6DS3H_INT1_CTRL_BITS_T;
242 LSM6DS3H_INT2_CTRL_DRDY_XL = 0x01,
243 LSM6DS3H_INT2_CTRL_DRDY_G = 0x02,
244 LSM6DS3H_INT2_CTRL_DRDY_TEMP = 0x04,
245 LSM6DS3H_INT2_CTRL_FTH = 0x08,
246 LSM6DS3H_INT2_CTRL_FIFO_OVR = 0x10,
247 LSM6DS3H_INT2_CTRL_FULL_FLAG = 0x20,
248 LSM6DS3H_INT2_CTRL_COUNT_OV = 0x40,
249 LSM6DS3H_INT2_CTRL_STEP_DELTA = 0x80,
250 } LSM6DS3H_INT2_CTRL_BITS_T;
256 LSM6DS3H_CTRL1_XL_BW0 = 0x01,
257 LSM6DS3H_CTRL1_XL_BW1 = 0x02,
258 _LSM6DS3H_CTRL1_XL_BW_MASK = 3,
259 _LSM6DS3H_CTRL1_XL_BW_SHIFT = 0,
261 LSM6DS3H_CTRL1_XL_FS0 = 0x04,
262 LSM6DS3H_CTRL1_XL_FS1 = 0x08,
263 _LSM6DS3H_CTRL1_XL_FS_MASK = 3,
264 _LSM6DS3H_CTRL1_XL_FS_SHIFT = 2,
266 LSM6DS3H_CTRL1_XL_ODR0 = 0x10,
267 LSM6DS3H_CTRL1_XL_ODR1 = 0x20,
268 LSM6DS3H_CTRL1_XL_ODR2 = 0x40,
269 LSM6DS3H_CTRL1_XL_ODR3 = 0x80,
270 _LSM6DS3H_CTRL1_XL_ODR_MASK = 15,
271 _LSM6DS3H_CTRL1_XL_ODR_SHIFT = 4,
272 } LSM6DS3H_CTRL1_XL_BITS_T;
278 LSM6DS3H_XL_BW_400HZ = 0,
279 LSM6DS3H_XL_BW_200HZ = 1,
280 LSM6DS3H_XL_BW_100HZ = 2,
281 LSM6DS3H_XL_BW_50HZ = 3,
288 LSM6DS3H_XL_FS_2G = 0,
289 LSM6DS3H_XL_FS_16G = 1,
290 LSM6DS3H_XL_FS_4G = 2,
291 LSM6DS3H_XL_FS_8G = 3,
298 LSM6DS3H_XL_ODR_POWER_DOWN = 0,
299 LSM6DS3H_XL_ODR_12_5HZ = 1,
300 LSM6DS3H_XL_ODR_26HZ = 2,
301 LSM6DS3H_XL_ODR_52HZ = 3,
302 LSM6DS3H_XL_ODR_104HZ = 4,
303 LSM6DS3H_XL_ODR_208HZ = 5,
304 LSM6DS3H_XL_ODR_416HZ = 6,
305 LSM6DS3H_XL_ODR_833HZ = 7,
306 LSM6DS3H_XL_ODR_1_66KHZ = 8,
307 LSM6DS3H_XL_ODR_3_33KHZ = 9,
308 LSM6DS3H_XL_ODR_6_66KHZ = 10,
317 LSM6DS3H_CTRL2_G_FS_125 = 0x02,
319 LSM6DS3H_CTRL2_G_FS0 = 0x04,
320 LSM6DS3H_CTRL2_G_FS1 = 0x08,
321 _LSM6DS3H_CTRL2_G_FS_MASK = 3,
322 _LSM6DS3H_CTRL2_G_FS_SHIFT = 2,
324 LSM6DS3H_CTRL2_G_ODR0 = 0x10,
325 LSM6DS3H_CTRL2_G_ODR1 = 0x20,
326 LSM6DS3H_CTRL2_G_ODR2 = 0x40,
327 LSM6DS3H_CTRL2_G_ODR3 = 0x80,
328 _LSM6DS3H_CTRL2_G_ODR_MASK = 0x15,
329 _LSM6DS3H_CTRL2_G_ODR_SHIFT = 0x4,
330 } LSM6DS3H_CTRL2_G_BITS_T;
336 LSM6DS3H_G_FS_245DPS = 0,
337 LSM6DS3H_G_FS_500DPS = 1,
338 LSM6DS3H_G_FS_1000DPS = 2,
339 LSM6DS3H_G_FS_2000DPS = 3,
345 LSM6DS3H_G_FS_125DPS = (4 + 0),
352 LSM6DS3H_G_ODR_POWER_DOWN = 0,
353 LSM6DS3H_G_ODR_12_5HZ = 1,
354 LSM6DS3H_G_ODR_26HZ = 2,
355 LSM6DS3H_G_ODR_52HZ = 3,
356 LSM6DS3H_G_ODR_104HZ = 4,
357 LSM6DS3H_G_ODR_208HZ = 5,
358 LSM6DS3H_G_ODR_416HZ = 6,
359 LSM6DS3H_G_ODR_833HZ = 7,
360 LSM6DS3H_G_ODR_1_66KHZ = 8,
367 LSM6DS3H_CTRL3_SW_RESET = 0x01,
368 LSM6DS3H_CTRL3_BLE = 0x02,
369 LSM6DS3H_CTRL3_IF_INC = 0x04,
370 LSM6DS3H_CTRL3_SIM = 0x08,
371 LSM6DS3H_CTRL3_PP_OD = 0x10,
372 LSM6DS3H_CTRL3_H_LACTIVE = 0x20,
373 LSM6DS3H_CTRL3_BDU = 0x40,
374 LSM6DS3H_CTRL3_BOOT = 0x80,
375 } LSM6DS3H_CTRL3_BITS_T;
381 LSM6DS3H_CTRL4_STOP_ON_FTH = 0x01,
382 LSM6DS3H_CTRL4_3_3KHZ_ODR = 0x02,
383 LSM6DS3H_CTRL4_I2C_DISABLE = 0x04,
384 LSM6DS3H_CTRL4_DRDY_MASK = 0x08,
385 LSM6DS3H_CTRL4_FIFO_TEMP_EN = 0x10,
386 LSM6DS3H_CTRL4_INT2_ON_INT1 = 0x20,
387 LSM6DS3H_CTRL4_SLEEP_G = 0x40,
388 LSM6DS3H_CTRL4_XL_BW_SCAL_ODR = 0x80,
389 } LSM6DS3H_CTRL4_BITS_T;
395 LSM6DS3H_CTRL5_ST_XL0 = 0x01,
396 LSM6DS3H_CTRL5_ST_XL1 = 0x02,
397 _LSM6DS3H_CTRL5_ST_XL_MASK = 3,
398 _LSM6DS3H_CTRL5_ST_XL_SHIFT = 0,
400 LSM6DS3H_CTRL5_ST_G0 = 0x04,
401 LSM6DS3H_CTRL5_ST_G1 = 0x08,
402 _LSM6DS3H_CTRL5_ST_G_MASK = 3,
403 _LSM6DS3H_CTRL5_ST_G_SHIFT = 2,
407 LSM6DS3H_CTRL5_ROUNDING0 = 0x20,
408 LSM6DS3H_CTRL5_ROUNDING1 = 0x40,
409 LSM6DS3H_CTRL5_ROUNDING2 = 0x80,
410 _LSM6DS3H_CTRL5_ROUNDING_MASK = 7,
411 _LSM6DS3H_CTRL5_ROUNDING_SHIFT = 5,
412 } LSM6DS3H_CTRL5_BITS_T;
418 LSM6DS3H_ST_XL_NORMAL = 0,
419 LSM6DS3H_ST_XL_POSITIVE = 1,
420 LSM6DS3H_ST_XL_NEGATIVE = 2,
427 LSM6DS3H_ST_G_NORMAL = 0,
428 LSM6DS3H_ST_G_POSITIVE = 1,
429 LSM6DS3H_ST_G_NEGATIVE = 3,
437 LSM6DS3H_CTRL6_XL_HM_MODE = 0x10,
438 LSM6DS3H_CTRL6_LVL2_EN = 0x20,
439 LSM6DS3H_CTRL6_LVLEN = 0x40,
440 LSM6DS3H_CTRL6_TRIG_EN = 0x80,
441 } LSM6DS3H_CTRL6_BITS_T;
448 LSM6DS3H_CTRL7_G_ROUNDING_STATUS = 0x04,
449 LSM6DS3H_CTRL7_G_HP_RST = 0x08,
451 LSM6DS3H_CTRL7_G_HPCF0 = 0x10,
452 LSM6DS3H_CTRL7_G_HPCF1 = 0x20,
453 _LSM6DS3H_CTRL7_G_HPCF_MASK = 3,
454 _LSM6DS3H_CTRL7_G_HPCF_SHIFT = 4,
456 LSM6DS3H_CTRL7_G_HP_EN = 0x40,
457 LSM6DS3H_CTRL7_G_HM_MODE = 0x80,
458 } LSM6DS3H_CTRL7_G_BITS_T;
464 LSM6DS3H_G_HPCF_0_0081HZ = 0,
465 LSM6DS3H_G_HPCF_0_0324HZ = 1,
466 LSM6DS3H_G_HPCF_2_07HZ = 2,
467 LSM6DS3H_G_HPCF_16_32HZ = 3,
474 LSM6DS3H_CTRL8_XL_LOW_PASS_ON_6D = 0x01,
478 LSM6DS3H_CTRL8_XL_HP_SLOPE_EN = 0x04,
482 LSM6DS3H_CTRL8_XL_HPCF0 = 0x20,
483 LSM6DS3H_CTRL8_XL_HPCF1 = 0x40,
484 _LSM6DS3H_CTRL8_XL_HPCF_MASK = 3,
485 _LSM6DS3H_CTRL8_XL_HPCF_SHIFT = 5,
487 LSM6DS3H_CTRL8_XL_LPF2_EN = 0x80,
488 } LSM6DS3H_CTRL8_XL_BITS_T;
496 LSM6DS3H_CTRL9_XL_SOFT_EN = 0x04,
497 LSM6DS3H_CTRL9_XL_XEN = 0x08,
498 LSM6DS3H_CTRL9_XL_YEN = 0x10,
499 LSM6DS3H_CTRL9_XL_ZEN = 0x20,
502 } LSM6DS3H_CTRL9_XL_BITS_T;
508 LSM6DS3H_CTRL10_C_SIGN_MOT_EN = 0x01,
509 LSM6DS3H_CTRL10_C_PEDO_RST_STEP = 0x02,
510 LSM6DS3H_CTRL10_C_FUNC_EN = 0x04,
511 LSM6DS3H_CTRL10_C_XEN = 0x08,
512 LSM6DS3H_CTRL10_C_YEN = 0x10,
513 LSM6DS3H_CTRL10_C_ZEN = 0x20,
516 } LSM6DS3H_CTRL10_C_BITS_T;
522 LSM6DS3H_MASTER_CONFIG_MASTER_ON = 0x01,
523 LSM6DS3H_MASTER_CONFIG_IRON_EN = 0x02,
524 LSM6DS3H_MASTER_CONFIG_PASS_THROUGH_MODE = 0x04,
525 LSM6DS3H_MASTER_CONFIG_PULL_UP_EN = 0x08,
526 LSM6DS3H_MASTER_CONFIG_START_CONFIG = 0x10,
530 LSM6DS3H_MASTER_CONFIG_DATA_VALID_SEL_FIFO = 0x40,
531 LSM6DS3H_MASTER_CONFIG_DRDY_ON_INT1 = 0x80,
532 } LSM6DS3H_MASTER_CONFIG_BITS_T;
538 LSM6DS3H_WAKE_UP_SRC_Z_WU = 0x01,
539 LSM6DS3H_WAKE_UP_SRC_Y_WU = 0x02,
540 LSM6DS3H_WAKE_UP_SRC_X_WU = 0x04,
541 LSM6DS3H_WAKE_UP_SRC_WU_IA = 0x08,
542 LSM6DS3H_WAKE_UP_SRC_SLEEP_STATE_IA = 0x10,
543 LSM6DS3H_WAKE_UP_SRC_FF_AA = 0x20,
546 } LSM6DS3H_WAKE_UP_SRC_BITS_T;
552 LSM6DS3H_TAP_SRC_Z_TAP = 0x01,
553 LSM6DS3H_TAP_SRC_Y_TAP = 0x02,
554 LSM6DS3H_TAP_SRC_X_TAP = 0x04,
555 LSM6DS3H_TAP_SRC_TAP_SIGN = 0x08,
556 LSM6DS3H_TAP_SRC_DOUBLE_TAP = 0x10,
557 LSM6DS3H_TAP_SRC_SINGLE_TAP = 0x20,
558 LSM6DS3H_TAP_SRC_TAP_IA = 0x40,
561 } LSM6DS3H_TAP_SRC_BITS_T;
567 LSM6DS3H_D6D_SRC_XL = 0x01,
568 LSM6DS3H_D6D_SRC_XH = 0x02,
569 LSM6DS3H_D6D_SRC_YL = 0x04,
570 LSM6DS3H_D6D_SRC_YH = 0x08,
571 LSM6DS3H_D6D_SRC_ZL = 0x10,
572 LSM6DS3H_D6D_SRC_ZH = 0x20,
573 LSM6DS3H_D6D_SRC_D6D_IA = 0x40,
576 } LSM6DS3H_D6D_SRC_BITS_T;
582 LSM6DS3H_STATUS_XLDA = 0x01,
583 LSM6DS3H_STATUS_GDA = 0x02,
584 LSM6DS3H_STATUS_TDA = 0x04,
587 } LSM6DS3H_STATUS_BITS_T;
593 LSM6DS3H_FUNC_SRC_SENSORHUB_END_OP = 0x01,
594 LSM6DS3H_FUNC_SRC_SI_END_OP = 0x02,
598 LSM6DS3H_FUNC_SRC_STEP_OVERFLOW = 0x08,
599 LSM6DS3H_FUNC_SRC_STEP_DETECTED = 0x10,
600 LSM6DS3H_FUNC_SRC_TILT_IA = 0x20,
601 LSM6DS3H_FUNC_SRC_SIGN_MOTION_IA = 0x40,
602 LSM6DS3H_FUNC_SRC_STEP_COUNT_DELTA_IA = 0x80,
603 } LSM6DS3H_FUNC_SRC_BITS_T;
610 LSM6DS3H_MD1_CFG_TIMER = 0x01,
611 LSM6DS3H_MD1_CFG_TILT = 0x02,
612 LSM6DS3H_MD1_CFG_6D = 0x04,
613 LSM6DS3H_MD1_CFG_DOUBLE_TAP = 0x08,
614 LSM6DS3H_MD1_CFG_FF = 0x10,
615 LSM6DS3H_MD1_CFG_WU = 0x20,
616 LSM6DS3H_MD1_CFG_SINGLE_TAP = 0x40,
617 LSM6DS3H_MD1_CFG_INACT_STATE = 0x80,
618 } LSM6DS3H_MD1_CFG_BITS_T;
625 LSM6DS3H_MD2_CFG_IRON = 0x01,
626 LSM6DS3H_MD2_CFG_TILT = 0x02,
627 LSM6DS3H_MD2_CFG_6D = 0x04,
628 LSM6DS3H_MD2_CFG_DOUBLE_TAP = 0x08,
629 LSM6DS3H_MD2_CFG_FF = 0x10,
630 LSM6DS3H_MD2_CFG_WU = 0x20,
631 LSM6DS3H_MD2_CFG_SINGLE_TAP = 0x40,
632 LSM6DS3H_MD2_CFG_INACT_STATE = 0x80,
633 } LSM6DS3H_MD2_CFG_BITS_T;
637 LSM6DS3H_INTERRUPT_INT1,
638 LSM6DS3H_INTERRUPT_INT2
639 } LSM6DS3H_INTERRUPT_PINS_T;