27 #include <mraa/common.hpp>
28 #include <mraa/i2c.hpp>
30 #include <mraa/gpio.hpp>
32 #define LSM9DS0_I2C_BUS 1
33 #define LSM9DS0_DEFAULT_XM_ADDR 0x1d
34 #define LSM9DS0_DEFAULT_GYRO_ADDR 0x6b
96 REG_WHO_AM_I_G = 0x0f,
100 REG_CTRL_REG1_G = 0x20,
101 REG_CTRL_REG2_G = 0x21,
102 REG_CTRL_REG3_G = 0x22,
103 REG_CTRL_REG4_G = 0x23,
104 REG_CTRL_REG5_G = 0x24,
106 REG_REFERENCE_G = 0x25,
110 REG_STATUS_REG_G = 0x27,
112 REG_OUT_X_L_G = 0x28,
113 REG_OUT_X_H_G = 0x29,
114 REG_OUT_Y_L_G = 0x2a,
115 REG_OUT_Y_H_G = 0x2b,
116 REG_OUT_Z_L_G = 0x2c,
117 REG_OUT_Z_H_G = 0x2d,
119 REG_FIFO_CTRL_REG_G = 0x2e,
120 REG_FIFO_SRC_REG_G = 0x2f,
122 REG_INT1_CFG_G = 0x30,
123 REG_INT1_SRC_G = 0x31,
125 REG_INT1_TSH_XH_G = 0x32,
126 REG_INT1_TSH_XL_G = 0x33,
127 REG_INT1_TSH_YH_G = 0x34,
128 REG_INT1_TSH_YL_G = 0x35,
129 REG_INT1_TSH_ZH_G = 0x36,
130 REG_INT1_TSH_ZL_G = 0x37,
134 REG_INT1_DURATION_G = 0x38
141 CTRL_REG1_G_YEN = 0x01,
142 CTRL_REG1_G_XEN = 0x02,
143 CTRL_REG1_G_ZEN = 0x04,
144 CTRL_REG1_G_PD = 0x08,
146 CTRL_REG1_G_BW0 = 0x10,
147 CTRL_REG1_G_BW1 = 0x20,
148 _CTRL_REG1_G_BW_MASK = 3,
149 _CTRL_REG1_G_BW_SHIFT = 4,
151 CTRL_REG1_G_DR0 = 0x40,
152 CTRL_REG1_G_DR1 = 0x80,
153 _CTRL_REG1_G_DR_MASK = 3,
154 _CTRL_REG1_G_DR_SHIFT = 6,
165 CTRL_REG1_G_ODR0 = 0x10,
166 CTRL_REG1_G_ODR1 = 0x20,
167 CTRL_REG1_G_ODR2 = 0x40,
168 CTRL_REG1_G_ODR3 = 0x80,
169 _CTRL_REG1_G_ODR_MASK = 15,
170 _CTRL_REG1_G_ODR_SHIFT = 4
201 CTRL_REG2_G_HPCF0 = 0x01,
202 CTRL_REG2_G_HPCF1 = 0x02,
203 CTRL_REG2_G_HPCF2 = 0x04,
204 CTRL_REG2_G_HPCF3 = 0x08,
205 _CTRL_REG2_G_HPCF_MASK = 15,
206 _CTRL_REG2_G_HPCF_SHIFT = 0,
208 CTRL_REG2_G_HPM0 = 0x10,
209 CTRL_REG2_G_HPM1 = 0x20,
210 _CTRL_REG2_G_HPM_MASK = 3,
211 _CTRL_REG2_G_HPM_SHIFT = 4,
243 G_HPM_NORMAL_RESET_HPF = 0,
246 G_HPM_AUTORESET_ON_INTR = 3
253 CTRL_REG3_G_I2_EMPTY = 0x01,
254 CTRL_REG3_G_I2_ORUN = 0x02,
255 CTRL_REG3_G_I2_WTM = 0x04,
256 CTRL_REG3_G_I2_DRDY = 0x08,
257 CTRL_REG3_G_PP_OD = 0x10,
258 CTRL_REG3_G_H_LACTIVE = 0x20,
259 CTRL_REG3_G_I1_BOOT = 0x40,
260 CTRL_REG3_G_I1_INT1 = 0x80,
267 CTRL_REG4_G_SIM = 0x01,
269 CTRL_REG4_G_ST0 = 0x02,
270 CTRL_REG4_G_ST1 = 0x04,
271 _CTRL_REG4_G_ST_MASK = 3,
272 _CTRL_REG4_G_ST_SHIFT = 1,
276 CTRL_REG4_G_FS0 = 0x10,
277 CTRL_REG4_G_FS1 = 0x20,
278 _CTRL_REG4_G_FS_MASK = 3,
279 _CTRL_REG4_G_FS_SHIFT = 4,
281 CTRL_REG4_G_BLE = 0x40,
282 CTRL_REG4_G_BDU = 0x80
313 CTRL_REG5_G_OUTSEL0 = 0x01,
314 CTRL_REG5_G_OUTSEL1 = 0x02,
315 _CTRL_REG5_G_OUTSEL_MASK = 3,
316 _CTRL_REG5_G_OUTSEL_SHIFT = 0,
318 CTRL_REG5_G_INT1SEL0 = 0x04,
319 CTRL_REG5_G_INT1SEL1 = 0x08,
320 _CTRL_REG5_G_INT1SEL_MASK = 3,
321 _CTRL_REG5_G_INT1SEL_SHIFT = 2,
323 CTRL_REG5_G_HPEN = 0x10,
327 CTRL_REG5_G_FIFO_EN = 0x40,
328 CTRL_REG5_G_BOOT = 0x80
347 STATUS_REG_G_XDA = 0x01,
348 STATUS_REG_G_YDA = 0x02,
349 STATUS_REG_G_ZDA = 0x04,
350 STATUS_REG_G_ZYXDA = 0x08,
352 STATUS_REG_G_XOR = 0x10,
353 STATUS_REG_G_YOR = 0x20,
354 STATUS_REG_G_ZOR = 0x40,
355 STATUS_REG_G_ZYXOR = 0x80
362 FIFO_CTRL_REG_G_WTM0 = 0x01,
363 FIFO_CTRL_REG_G_WTM1 = 0x02,
364 FIFO_CTRL_REG_G_WTM2 = 0x04,
365 FIFO_CTRL_REG_G_WTM3 = 0x08,
366 FIFO_CTRL_REG_G_WTM4 = 0x10,
367 _FIFO_CTRL_REG_G_WTM_MASK = 31,
368 _FIFO_CTRL_REG_G_WTM_SHIFT = 0,
370 FIFO_CTRL_REG_G_FM0 = 0x20,
371 FIFO_CTRL_REG_G_FM1 = 0x40,
372 FIFO_CTRL_REG_G_FM2 = 0x80,
373 _FIFO_CTRL_REG_G_FM_MASK = 7,
374 _FIFO_CTRL_REG_G_FM_SHIFT = 5,
388 G_FM_STREAM2FIFO = 3,
389 G_FM_BYPASS2STREAM = 4
399 FIFO_CTRL_REG_G_FSS0 = 0x01,
400 FIFO_CTRL_REG_G_FSS1 = 0x02,
401 FIFO_CTRL_REG_G_FSS2 = 0x04,
402 FIFO_CTRL_REG_G_FSS3 = 0x08,
403 FIFO_CTRL_REG_G_FSS4 = 0x10,
404 _FIFO_CTRL_REG_G_FSS_MASK = 31,
405 _FIFO_CTRL_REG_G_FSS_SHIFT = 0,
407 FIFO_CTRL_REG_G_EMPTY = 0x20,
408 FIFO_CTRL_REG_G_OVRN = 0x40,
409 FIFO_CTRL_REG_G_WTM = 0x80
417 INT1_CFG_G_XLIE = 0x01,
418 INT1_CFG_G_XHIE = 0x02,
419 INT1_CFG_G_YLIE = 0x04,
420 INT1_CFG_G_YHIE = 0x08,
421 INT1_CFG_G_ZLIE = 0x10,
422 INT1_CFG_G_ZHIE = 0x20,
424 INT1_CFG_G_LIR = 0x40,
425 INT1_CFG_G_ANDOR = 0x80
433 INT1_SRC_G_XL = 0x01,
434 INT1_SRC_G_XH = 0x02,
435 INT1_SRC_G_YL = 0x04,
436 INT1_SRC_G_YH = 0x08,
437 INT1_SRC_G_ZL = 0x10,
438 INT1_SRC_G_ZH = 0x20,
454 REG_OUT_TEMP_L_XM = 0x05,
455 REG_OUT_TEMP_H_XM = 0x06,
457 REG_STATUS_REG_M = 0x07,
459 REG_OUT_X_L_M = 0x08,
460 REG_OUT_X_H_M = 0x09,
461 REG_OUT_Y_L_M = 0x0a,
462 REG_OUT_Y_H_M = 0x0b,
463 REG_OUT_Z_L_M = 0x0c,
464 REG_OUT_Z_H_M = 0x0d,
468 REG_WHO_AM_I_XM = 0x0f,
472 REG_INT_CTRL_REG_M = 0x12,
473 REG_INT_SRC_REG_M = 0x13,
475 REG_INT_THS_L_M = 0x14,
476 REG_INT_THS_H_M = 0x15,
478 REG_OFFSET_X_L_M = 0x16,
479 REG_OFFSET_X_H_M = 0x17,
480 REG_OFFSET_Y_L_M = 0x18,
481 REG_OFFSET_Y_H_M = 0x19,
482 REG_OFFSET_Z_L_M = 0x1a,
483 REG_OFFSET_Z_H_M = 0x1b,
485 REG_REFERENCE_X = 0x1c,
486 REG_REFERENCE_Y = 0x1d,
487 REG_REFERENCE_Z = 0x1e,
489 REG_CTRL_REG0_XM = 0x1f,
490 REG_CTRL_REG1_XM = 0x20,
491 REG_CTRL_REG2_XM = 0x21,
492 REG_CTRL_REG3_XM = 0x22,
493 REG_CTRL_REG4_XM = 0x23,
494 REG_CTRL_REG5_XM = 0x24,
495 REG_CTRL_REG6_XM = 0x25,
496 REG_CTRL_REG7_XM = 0x26,
498 REG_STATUS_REG_A = 0x27,
500 REG_OUT_X_L_A = 0x28,
501 REG_OUT_X_H_A = 0x29,
502 REG_OUT_Y_L_A = 0x2a,
503 REG_OUT_Y_H_A = 0x2b,
504 REG_OUT_Z_L_A = 0x2c,
505 REG_OUT_Z_H_A = 0x2d,
507 REG_FIFO_CTRL_REG = 0x2e,
508 REG_FIFO_SRC_REG = 0x2f,
510 REG_INT_GEN_1_REG = 0x30,
511 REG_INT_GEN_1_SRC = 0x31,
512 REG_INT_GEN_1_THS = 0x32,
513 REG_INT_GEN_1_DURATION = 0x33,
515 REG_INT_GEN_2_REG = 0x34,
516 REG_INT_GEN_2_SRC = 0x35,
517 REG_INT_GEN_2_THS = 0x36,
518 REG_INT_GEN_2_DURATION = 0x37,
520 REG_CLICK_CFG = 0x38,
521 REG_CLICK_SRC = 0x39,
522 REG_CLICK_THS = 0x3a,
524 REG_TIME_LIMIT = 0x3b,
525 REG_TIME_LATENCY = 0x3c,
526 REG_TIME_WINDOW = 0x3d,
536 STATUS_REG_M_XMDA = 0x01,
537 STATUS_REG_M_YMDA = 0x02,
538 STATUS_REG_M_ZMDA = 0x04,
539 STATUS_REG_M_ZYXMDA = 0x08,
541 STATUS_REG_M_XMOR = 0x10,
542 STATUS_REG_M_YMOR = 0x20,
543 STATUS_REG_M_ZMOR = 0x40,
544 STATUS_REG_M_ZYXMOR = 0x80
551 INT_CTRL_REG_M_MIEN = 0x01,
552 INT_CTRL_REG_M_4D = 0x02,
553 INT_CTRL_REG_M_IEL = 0x04,
554 INT_CTRL_REG_M_IEA = 0x08,
555 INT_CTRL_REG_M_PP_OD = 0x10,
556 INT_CTRL_REG_M_ZMIEN = 0x20,
557 INT_CTRL_REG_M_YMIEN = 0x40,
558 INT_CTRL_REG_M_XMIEN = 0x80
565 INT_SRC_REG_M_MINT = 0x01,
566 INT_SRC_REG_M_MROI = 0x02,
567 INT_SRC_REG_M_NTH_Z = 0x04,
568 INT_SRC_REG_M_NTH_Y = 0x08,
569 INT_SRC_REG_M_NTH_X = 0x10,
570 INT_SRC_REG_M_PTH_Z = 0x20,
571 INT_SRC_REG_M_PTH_Y = 0x40,
572 INT_SRC_REG_M_PTH_X = 0x80
580 CTRL_REG0_XM_HPIS2 = 0x01,
581 CTRL_REG0_XM_HPIS1 = 0x02,
583 CTRL_REG0_XM_HP_CLICK = 0x04,
587 CTRL_REG0_XM_WTM_LEN = 0x20,
588 CTRL_REG0_XM_FIFO_EN = 0x40,
589 CTRL_REG0_XM_BOOT = 0x80
596 CTRL_REG1_XM_AXEN = 0x01,
597 CTRL_REG1_XM_AYEN = 0x02,
598 CTRL_REG1_XM_AZEN = 0x03,
600 CTRL_REG1_XM_BDU = 0x04,
602 CTRL_REG1_XM_AODR0 = 0x10,
603 CTRL_REG1_XM_AODR1 = 0x20,
604 CTRL_REG1_XM_AODR2 = 0x40,
605 CTRL_REG1_XM_AODR3 = 0x80,
606 _CTRL_REG1_XM_AODR_MASK = 15,
607 _CTRL_REG1_XM_AODR_SHIFT = 4
632 CTRL_REG2_XM_SIM = 0x01,
634 CTRL_REG2_XM_AST0 = 0x02,
635 CTRL_REG2_XM_AST1 = 0x04,
636 _CTRL_REG2_XM_AST_MASK = 3,
637 _CTRL_REG2_XM_AST_SHIFT = 1,
639 CTRL_REG2_XM_AFS0 = 0x08,
640 CTRL_REG2_XM_AFS1 = 0x10,
641 CTRL_REG2_XM_AFS2 = 0x20,
642 _CTRL_REG2_XM_AFS_MASK = 7,
643 _CTRL_REG2_XM_AFS_SHIFT = 3,
645 CTRL_REG2_XM_ABW0 = 0x40,
646 CTRL_REG2_XM_ABW1 = 0x80,
647 _CTRL_REG2_XM_ABW_MASK = 3,
648 _CTRL_REG2_XM_ABW_SHIFT = 6
688 CTRL_REG3_XM_P1_EMPTY = 0x01,
689 CTRL_REG3_XM_P1_DRDYM = 0x02,
690 CTRL_REG3_XM_P1_DRDYA = 0x04,
691 CTRL_REG3_XM_P1_INTM = 0x08,
692 CTRL_REG3_XM_P1_INT2 = 0x10,
693 CTRL_REG3_XM_P1_INT1 = 0x20,
694 CTRL_REG3_XM_P1_TAP = 0x40,
695 CTRL_REG3_XM_P1_BOOT = 0x80
702 CTRL_REG4_XM_P2_WTM = 0x01,
703 CTRL_REG4_XM_P2_OVERRUN = 0x02,
704 CTRL_REG4_XM_P2_DRDYM = 0x04,
705 CTRL_REG4_XM_P2_DRDYA = 0x08,
706 CTRL_REG4_XM_P2_INTM = 0x10,
707 CTRL_REG4_XM_P2_INT2 = 0x20,
708 CTRL_REG4_XM_P2_INT1 = 0x40,
709 CTRL_REG4_XM_P2_TAP = 0x80
716 CTRL_REG5_XM_LIR1 = 0x01,
717 CTRL_REG5_XM_LIR2 = 0x02,
719 CTRL_REG5_XM_ODR0 = 0x04,
720 CTRL_REG5_XM_ODR1 = 0x08,
721 CTRL_REG5_XM_ODR2 = 0x10,
722 _CTRL_REG5_XM_ODR_MASK = 7,
723 _CTRL_REG5_XM_ODR_SHIFT = 2,
725 CTRL_REG5_XM_RES0 = 0x20,
726 CTRL_REG5_XM_RES1 = 0x40,
727 _CTRL_REG5_XM_RES_MASK = 3,
728 _CTRL_REG5_XM_RES_SHIFT = 5,
730 CTRL_REG5_XM_TEMP_EN = 0x80
764 CTRL_REG6_XM_MFS0 = 0x20,
765 CTRL_REG6_XM_MFS1 = 0x40,
766 _CTRL_REG6_XM_MFS_MASK = 3,
767 _CTRL_REG6_XM_MFS_SHIFT = 5
786 CTRL_REG7_XM_MD0 = 0x01,
787 CTRL_REG7_XM_MD1 = 0x02,
788 _CTRL_REG7_XM_MD_MASK = 3,
789 _CTRL_REG7_XM_MD_SHIFT = 0,
791 CTRL_REG7_XM_MLP = 0x04,
795 CTRL_REG7_XM_AFDS = 0x20,
797 CTRL_REG7_XM_AHPM0 = 0x40,
798 CTRL_REG7_XM_AHPM1 = 0x80,
799 _CTRL_REG7_XM_AHPM_MASK = 3,
800 _CTRL_REG7_XM_AHPM_SHIFT = 6
807 XM_MD_CONTINUOUS = 0,
821 XM_AHPM_NORMAL_REF = 0,
822 XM_AHPM_REFERENCE = 1,
824 XM_AHPM_AUTORESET = 3
831 STATUS_REG_A_XADA = 0x01,
832 STATUS_REG_A_YADA = 0x02,
833 STATUS_REG_A_ZADA = 0x04,
834 STATUS_REG_A_ZYXADA = 0x08,
836 STATUS_REG_A_XAOR = 0x10,
837 STATUS_REG_A_YAOR = 0x20,
838 STATUS_REG_A_ZAOR = 0x40,
839 STATUS_REG_A_ZYXAOR = 0x80
846 FIFO_CTRL_REG_FTH0 = 0x01,
847 FIFO_CTRL_REG_FTH1 = 0x02,
848 FIFO_CTRL_REG_FTH2 = 0x04,
849 FIFO_CTRL_REG_FTH3 = 0x08,
850 FIFO_CTRL_REG_FTH4 = 0x10,
851 _FIFO_CTRL_REG_FTH_MASK = 31,
852 _FIFO_CTRL_REG_FTH_SHIFT = 0,
854 FIFO_CTRL_REG_FM0 = 0x20,
855 FIFO_CTRL_REG_FM1 = 0x40,
856 FIFO_CTRL_REG_FM2 = 0x80,
857 _FIFO_CTRL_REG_FM_MASK = 7,
858 _FIFO_CTRL_REG_FM_SHIFT = 5,
883 FIFO_CTRL_REG_FSS0 = 0x01,
884 FIFO_CTRL_REG_FSS1 = 0x02,
885 FIFO_CTRL_REG_FSS2 = 0x04,
886 FIFO_CTRL_REG_FSS3 = 0x08,
887 FIFO_CTRL_REG_FSS4 = 0x10,
888 _FIFO_CTRL_REG_FSS_MASK = 31,
889 _FIFO_CTRL_REG_FSS_SHIFT = 0,
891 FIFO_CTRL_REG_EMPTY = 0x20,
892 FIFO_CTRL_REG_OVRN = 0x40,
893 FIFO_CTRL_REG_WTM = 0x80
901 INT_GEN_X_REG_XLIE_XDOWNE = 0x01,
902 INT_GEN_X_REG_XHIE_XUPE = 0x02,
903 INT_GEN_X_REG_YLIE_YDOWNE = 0x04,
904 INT_GEN_X_REG_YHIE_YUPE = 0x08,
905 INT_GEN_X_REG_ZLIE_ZDOWNE = 0x10,
906 INT_GEN_X_REG_ZHIE_ZUPE = 0x20,
907 INT_GEN_X_REG_6D = 0x40,
908 INT_GEN_X_REG_AOI = 0x80
916 INT_GEN_X_SRC_XL = 0x01,
917 INT_GEN_X_SRC_XH = 0x02,
918 INT_GEN_X_SRC_YL = 0x04,
919 INT_GEN_X_SRC_YH = 0x08,
920 INT_GEN_X_SRC_ZL = 0x10,
921 INT_GEN_X_SRC_ZH = 0x20,
922 INT_GEN_X_SRC_IA = 0x40
931 INT_GEN_X_THS0 = 0x01,
932 INT_GEN_X_THS1 = 0x02,
933 INT_GEN_X_THS2 = 0x04,
934 INT_GEN_X_THS3 = 0x08,
935 INT_GEN_X_THS4 = 0x10,
936 INT_GEN_X_THS5 = 0x20,
937 INT_GEN_X_THS6 = 0x40,
938 _INT_GEN_X_THS_MASK = 127,
939 _INT_GEN_X_THS_SHIFT = 0
948 INT_GEN_X_DUR0 = 0x01,
949 INT_GEN_X_DUR1 = 0x02,
950 INT_GEN_X_DUR2 = 0x04,
951 INT_GEN_X_DUR3 = 0x08,
952 INT_GEN_X_DUR4 = 0x10,
953 INT_GEN_X_DUR5 = 0x20,
954 INT_GEN_X_DUR6 = 0x40,
955 _INT_GEN_X_DUR_MASK = 127,
956 _INT_GEN_X_DUR_SHIFT = 0
965 CLICK_CONFIG_XS = 0x01,
966 CLICK_CONFIG_XD = 0x02,
967 CLICK_CONFIG_YS = 0x04,
968 CLICK_CONFIG_YD = 0x08,
969 CLICK_CONFIG_ZS = 0x10,
970 CLICK_CONFIG_ZD = 0x20
982 CLICK_SRC_SIGN = 0x08,
983 CLICK_SRC_SCLICK = 0x10,
984 CLICK_SRC_DCLICK = 0x20,
994 CLICK_THS_THS0 = 0x01,
995 CLICK_THS_THS1 = 0x02,
996 CLICK_THS_THS2 = 0x04,
997 CLICK_THS_THS3 = 0x08,
998 CLICK_THS_THS4 = 0x10,
999 CLICK_THS_THS5 = 0x20,
1000 CLICK_THS_THS6 = 0x40,
1001 _CLICK_THS_THS_MASK = 127,
1002 _CLICK_THS_THS_SHIFT = 0
1011 CLICK_TIME_LIMIT_TLI0 = 0x01,
1012 CLICK_TIME_LIMIT_TLI1 = 0x02,
1013 CLICK_TIME_LIMIT_TLI2 = 0x04,
1014 CLICK_TIME_LIMIT_TLI3 = 0x08,
1015 CLICK_TIME_LIMIT_TLI4 = 0x10,
1016 CLICK_TIME_LIMIT_TLI5 = 0x20,
1017 CLICK_TIME_LIMIT_TLI6 = 0x40,
1018 _CLICK_TIME_LIMIT_TLI_MASK = 127,
1019 _CLICK_TIME_LIMIT_TLI_SHIFT = 0
1028 ACT_THS_ACTH0 = 0x01,
1029 ACT_THS_ACTH1 = 0x02,
1030 ACT_THS_ACTH2 = 0x04,
1031 ACT_THS_ACTH3 = 0x08,
1032 ACT_THS_ACTH4 = 0x10,
1033 ACT_THS_ACTH5 = 0x20,
1034 ACT_THS_ACTH6 = 0x40,
1035 _ACT_THS_ACTH_MASK = 127,
1036 _ACT_THS_ACTH_SHIFT = 0
1063 LSM9DS0(
int bus=LSM9DS0_I2C_BUS,
1064 uint8_t gAddress=LSM9DS0_DEFAULT_GYRO_ADDR,
1065 uint8_t xmAddress=LSM9DS0_DEFAULT_XM_ADDR);
1112 uint8_t
readReg(DEVICE_T dev, uint8_t reg);
1123 void readRegs(DEVICE_T dev, uint8_t reg, uint8_t *buffer,
int len);
1133 bool writeReg(DEVICE_T dev, uint8_t reg, uint8_t val);
1265 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
1415 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
1416 void installISR(INTERRUPT_PINS_T intr,
int gpio, mraa::Edge level,
1431 void installISR(INTERRUPT_PINS_T intr,
int gpio, mraa::Edge level,
1432 void (*isr)(
void *),
void *arg);
1468 static const uint8_t m_autoIncrementMode = 0x80;
1476 mraa::Gpio*& getPin(INTERRUPT_PINS_T intr);
1479 mraa::Gpio *m_gpioG_INT;
1480 mraa::Gpio *m_gpioG_DRDY;
1481 mraa::Gpio *m_gpioXM_GEN1;
1482 mraa::Gpio *m_gpioXM_GEN2;
XM_MD_T
Definition: lsm9ds0.h:806
bool setMagnetometerMode(XM_MD_T mode)
Definition: lsm9ds0.cxx:522
INT_CTRL_REG_M_BITS_T
Definition: lsm9ds0.h:550
float getTemperature()
Definition: lsm9ds0.cxx:647
void updateTemperature()
Definition: lsm9ds0.cxx:267
INT1_CFG_G_BITS_T
Definition: lsm9ds0.h:416
bool setInterruptGen1(uint8_t enables)
Definition: lsm9ds0.cxx:719
CTRL_REG0_XM_BITS_T
Definition: lsm9ds0.h:579
FIFO_SRC_REG_G_BITS_T
Definition: lsm9ds0.h:398
uint8_t getAccelerometerStatus()
Definition: lsm9ds0.cxx:679
bool setMagnetometerInterruptControl(uint8_t enables)
Definition: lsm9ds0.cxx:704
uint8_t readReg(DEVICE_T dev, uint8_t reg)
Definition: lsm9ds0.cxx:287
INT_SRC_REG_M_BITS_T
Definition: lsm9ds0.h:564
CLICK_THS_BITS_T
Definition: lsm9ds0.h:993
CLICK_CONFIG_BITS_T
Definition: lsm9ds0.h:964
G_HPM_T
Definition: lsm9ds0.h:242
bool setMagnetometerODR(XM_ODR_T odr)
Definition: lsm9ds0.cxx:511
ACT_THS_BITS_T
Definition: lsm9ds0.h:1027
REG_G_T
Definition: lsm9ds0.h:93
XM_AODR_T
Definition: lsm9ds0.h:613
XM_ABW_T
Definition: lsm9ds0.h:677
CTRL_REG2_G_BITS_T
Definition: lsm9ds0.h:200
CTRL_REG4_XM_BITS_T
Definition: lsm9ds0.h:701
FM_T
Definition: lsm9ds0.h:868
FIFO_SRC_REG_BITS_T
Definition: lsm9ds0.h:882
LSM9DS0(int bus=LSM9DS0_I2C_BUS, uint8_t gAddress=LSM9DS0_DEFAULT_GYRO_ADDR, uint8_t xmAddress=LSM9DS0_DEFAULT_XM_ADDR)
Definition: lsm9ds0.cxx:36
uint8_t getMagnetometerStatus()
Definition: lsm9ds0.cxx:674
void update()
Definition: lsm9ds0.cxx:205
FIFO_CTRL_REG_G_T
Definition: lsm9ds0.h:361
uint8_t getInterruptGen2Src()
Definition: lsm9ds0.cxx:739
CTRL_REG3_G_BITS_T
Definition: lsm9ds0.h:252
bool setAccelerometerScale(XM_AFS_T scale)
Definition: lsm9ds0.cxx:453
CLICK_SRC_BITS_T
Definition: lsm9ds0.h:978
void updateMagnetometer()
Definition: lsm9ds0.cxx:249
bool setGyroscopeODR(G_ODR_T odr)
Definition: lsm9ds0.cxx:376
INT_GEN_X_THS_BITS_T
Definition: lsm9ds0.h:930
uint8_t getMagnetometerInterruptControl()
Definition: lsm9ds0.cxx:699
INT_GEN_X_SRC_BITS_T
Definition: lsm9ds0.h:915
bool setGyroscopeInterruptConfig(uint8_t enables)
Definition: lsm9ds0.cxx:689
STATUS_REG_G_BITS_T
Definition: lsm9ds0.h:346
XM_MFS_T
Definition: lsm9ds0.h:775
bool setGyroscopeScale(G_FS_T scale)
Definition: lsm9ds0.cxx:387
bool setMagnetometerResolution(XM_RES_T res)
Definition: lsm9ds0.cxx:500
CLICK_TIME_LIMIT_BITS_T
Definition: lsm9ds0.h:1010
G_HPCF_T
Definition: lsm9ds0.h:223
API for the LSM9DS0 3-axis Gyroscope, Accelerometer, and Magnetometer.
Definition: lsm9ds0.h:79
uint8_t getGyroscopeInterruptConfig()
Definition: lsm9ds0.cxx:684
bool setGyroscopeEnableAxes(uint8_t axes)
Definition: lsm9ds0.cxx:360
G_ST_T
Definition: lsm9ds0.h:289
uint8_t getInterruptGen1Src()
Definition: lsm9ds0.cxx:724
void updateAccelerometer()
Definition: lsm9ds0.cxx:231
uint8_t getGyroscopeStatus()
Definition: lsm9ds0.cxx:669
CTRL_REG4_G_BITS_T
Definition: lsm9ds0.h:266
bool setMagnetometerScale(XM_MFS_T scale)
Definition: lsm9ds0.cxx:545
uint8_t getMagnetometerInterruptSrc()
Definition: lsm9ds0.cxx:709
CTRL_REG5_XM_BITS_T
Definition: lsm9ds0.h:715
void updateGyroscope()
Definition: lsm9ds0.cxx:213
uint8_t getInterruptGen1()
Definition: lsm9ds0.cxx:714
G_FM_T
Definition: lsm9ds0.h:384
CTRL_REG1_XM_BITS_T
Definition: lsm9ds0.h:595
bool setMagnetometerLPM(bool enable)
Definition: lsm9ds0.cxx:533
G_INT1OUTSEL_T
Definition: lsm9ds0.h:336
void getMagnetometer(float *x, float *y, float *z)
Definition: lsm9ds0.cxx:612
uint8_t getInterruptGen2()
Definition: lsm9ds0.cxx:729
STATUS_REG_M_BITS_T
Definition: lsm9ds0.h:535
CTRL_REG2_XM_BITS_T
Definition: lsm9ds0.h:631
INT_GEN_X_REG_BITS_T
Definition: lsm9ds0.h:900
void getGyroscope(float *x, float *y, float *z)
Definition: lsm9ds0.cxx:600
void readRegs(DEVICE_T dev, uint8_t reg, uint8_t *buffer, int len)
Definition: lsm9ds0.cxx:304
XM_ODR_T
Definition: lsm9ds0.h:736
XM_AHPM_T
Definition: lsm9ds0.h:816
bool setGyroscopePowerDown(bool enable)
Definition: lsm9ds0.cxx:348
CTRL_REG1_G_BITS_T
Definition: lsm9ds0.h:140
bool writeReg(DEVICE_T dev, uint8_t reg, uint8_t val)
Definition: lsm9ds0.cxx:323
CTRL_REG3_XM_BITS_T
Definition: lsm9ds0.h:687
INT_GEN_X_DUR_BITS_T
Definition: lsm9ds0.h:947
bool setInterruptGen2(uint8_t enables)
Definition: lsm9ds0.cxx:734
REG_XM_T
Definition: lsm9ds0.h:451
void getAccelerometer(float *x, float *y, float *z)
Definition: lsm9ds0.cxx:588
void installISR(INTERRUPT_PINS_T intr, int gpio, mraa::Edge level, void(*isr)(void *), void *arg)
Definition: lsm9ds0.cxx:759
XM_AST_T
Definition: lsm9ds0.h:654
bool setAccelerometerEnableAxes(uint8_t axes)
Definition: lsm9ds0.cxx:426
bool enableTemperatureSensor(bool enable)
Definition: lsm9ds0.cxx:657
XM_RES_T
Definition: lsm9ds0.h:750
G_FS_T
Definition: lsm9ds0.h:302
G_ODR_T
Definition: lsm9ds0.h:176
INT1_SRC_G_BITS_T
Definition: lsm9ds0.h:432
bool setAccelerometerODR(XM_AODR_T odr)
Definition: lsm9ds0.cxx:442
CTRL_REG7_XM_BITS_T
Definition: lsm9ds0.h:785
CTRL_REG5_G_BITS_T
Definition: lsm9ds0.h:312
XM_AFS_T
Definition: lsm9ds0.h:664
FIFO_CTRL_REG_T
Definition: lsm9ds0.h:845
CTRL_REG6_XM_BITS_T
Definition: lsm9ds0.h:761
bool init()
Definition: lsm9ds0.cxx:85
~LSM9DS0()
Definition: lsm9ds0.cxx:77
uint8_t getGyroscopeInterruptSrc()
Definition: lsm9ds0.cxx:694
STATUS_REG_A_BITS_T
Definition: lsm9ds0.h:830
void uninstallISR(INTERRUPT_PINS_T intr)
Definition: lsm9ds0.cxx:773