upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
lsm9ds0.h
1 /*
2  * Author: Jon Trulson <jtrulson@ics.com>
3  * Copyright (c) 2015 Intel Corporation.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 #pragma once
25 
26 #include <string>
27 #include <mraa/common.hpp>
28 #include <mraa/i2c.hpp>
29 
30 #include <mraa/gpio.hpp>
31 
32 #define LSM9DS0_I2C_BUS 1
33 #define LSM9DS0_DEFAULT_XM_ADDR 0x1d
34 #define LSM9DS0_DEFAULT_GYRO_ADDR 0x6b
35 
36 namespace upm {
37 
79  class LSM9DS0 {
80  public:
81 
82  // NOTE: reserved registers must not be written into or permanent
83  // damage to the device can result. Reserved bitfields must
84  // always be 0.
85 
86  // There are two sub-devices within this device - the
87  // Accelerometer and Magnetometer (XM) and the Gyroscope (G), each
88  // with their own I2C address.
89 
93  typedef enum {
94  // 0x00-0x0e reserved
95 
96  REG_WHO_AM_I_G = 0x0f, // should be 0xd4
97 
98  // 0x10-0x1f reserved
99 
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,
105 
106  REG_REFERENCE_G = 0x25,
107 
108  // 0x26 reserved
109 
110  REG_STATUS_REG_G = 0x27,
111 
112  REG_OUT_X_L_G = 0x28, // gyro output, X axis, LSB
113  REG_OUT_X_H_G = 0x29, // gyro output, X axis, MSB
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,
118 
119  REG_FIFO_CTRL_REG_G = 0x2e,
120  REG_FIFO_SRC_REG_G = 0x2f,
121 
122  REG_INT1_CFG_G = 0x30,
123  REG_INT1_SRC_G = 0x31,
124 
125  REG_INT1_TSH_XH_G = 0x32, // interrupt threshold registers
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,
131 
132  // See fig 19 & 20 and preceeding description in the datasheet
133  // on how to use this register
134  REG_INT1_DURATION_G = 0x38
135  } REG_G_T;
136 
140  typedef enum {
141  CTRL_REG1_G_YEN = 0x01, // Y enable, odd ordering...
142  CTRL_REG1_G_XEN = 0x02,
143  CTRL_REG1_G_ZEN = 0x04,
144  CTRL_REG1_G_PD = 0x08, // power down (0)
145 
146  CTRL_REG1_G_BW0 = 0x10, // bandwidth
147  CTRL_REG1_G_BW1 = 0x20,
148  _CTRL_REG1_G_BW_MASK = 3,
149  _CTRL_REG1_G_BW_SHIFT = 4,
150 
151  CTRL_REG1_G_DR0 = 0x40, // data rate
152  CTRL_REG1_G_DR1 = 0x80,
153  _CTRL_REG1_G_DR_MASK = 3,
154  _CTRL_REG1_G_DR_SHIFT = 6,
155 
156  // The following are synthetic register and shift/mask
157  // definitions. Together both BW and DR setup the device for a
158  // specific output data rate (ODR) and cutoff frequency. These
159  // definitions allow us to use a more informative configuration
160  // for these 4 bits, rather than having the user go to the
161  // datasheet to figure out what to put for those values in order
162  // to get the desired ODR/cutoff. These are the values we will
163  // use in this driver.
164 
165  CTRL_REG1_G_ODR0 = 0x10, // BW0
166  CTRL_REG1_G_ODR1 = 0x20, // BW1
167  CTRL_REG1_G_ODR2 = 0x40, // DR0
168  CTRL_REG1_G_ODR3 = 0x80, // DR1
169  _CTRL_REG1_G_ODR_MASK = 15,
170  _CTRL_REG1_G_ODR_SHIFT = 4
172 
176  typedef enum {
177  G_ODR_95_12_5 = 0, // ODR = 95Hz, cutoff = 12.5
178  G_ODR_95_25 = 1, // ODR = 95Hz, cutoff = 25
179  // Other two (2 and 3) are the same (95_25)
180 
181  G_ODR_190_12_5 = 4,
182  G_ODR_190_25 = 5,
183  G_ODR_190_50 = 6,
184  G_ODR_190_70 = 7,
185 
186  G_ODR_380_20 = 8,
187  G_ODR_380_25 = 9,
188  G_ODR_380_50 = 10,
189  G_ODR_380_100 = 11,
190 
191  G_ODR_760_30 = 12,
192  G_ODR_760_35 = 13,
193  G_ODR_760_50 = 14,
194  G_ODR_760_100 = 15
195  } G_ODR_T;
196 
200  typedef enum {
201  CTRL_REG2_G_HPCF0 = 0x01, // high-pass cutoff freq
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,
207 
208  CTRL_REG2_G_HPM0 = 0x10, // high-pass filter mode
209  CTRL_REG2_G_HPM1 = 0x20,
210  _CTRL_REG2_G_HPM_MASK = 3,
211  _CTRL_REG2_G_HPM_SHIFT = 4,
212 
213  // 0x40, 0x80 reserved
215 
223  typedef enum {
224  G_HPCF_7_2 = 0, // 7.2 Hz (if ODR is 95Hz)
225  G_HPCF_3_5 = 1,
226  G_HPCF_1_8 = 2,
227  G_HPCF_0_9 = 3, // 0.9Hz
228  G_HPCF_0_45 = 4,
229  G_HPCF_0_18 = 5,
230  G_HPCF_0_09 = 6,
231  G_HPCF_0_045 = 7,
232  G_HPCF_0_018 = 8,
233  G_HPCF_0_009 = 9
234 
235  // 10-15 unused
236  } G_HPCF_T;
237 
242  typedef enum {
243  G_HPM_NORMAL_RESET_HPF = 0, // reset reading (HP_RESET_FILTER)
244  G_HPM_REFERENCE = 1, // REF signal for filtering
245  G_HPM_NORMAL = 2, // normal mode
246  G_HPM_AUTORESET_ON_INTR = 3 // autoreset in interrupt event
247  } G_HPM_T;
248 
252  typedef enum {
253  CTRL_REG3_G_I2_EMPTY = 0x01, // FIFO empty on DRDY_G
254  CTRL_REG3_G_I2_ORUN = 0x02, // FIFO Overrun intr
255  CTRL_REG3_G_I2_WTM = 0x04, // FIFO watermark intr
256  CTRL_REG3_G_I2_DRDY = 0x08, // data ready on DRDY_G
257  CTRL_REG3_G_PP_OD = 0x10, // push-pull/open drain
258  CTRL_REG3_G_H_LACTIVE = 0x20,
259  CTRL_REG3_G_I1_BOOT = 0x40,
260  CTRL_REG3_G_I1_INT1 = 0x80, // intr enable on INT_G pin
262 
266  typedef enum {
267  CTRL_REG4_G_SIM = 0x01, // SPI mode selection
268 
269  CTRL_REG4_G_ST0 = 0x02, // self test enables
270  CTRL_REG4_G_ST1 = 0x04,
271  _CTRL_REG4_G_ST_MASK = 3,
272  _CTRL_REG4_G_ST_SHIFT = 1,
273 
274  // 0x08 reserved
275 
276  CTRL_REG4_G_FS0 = 0x10, // full scale selection
277  CTRL_REG4_G_FS1 = 0x20,
278  _CTRL_REG4_G_FS_MASK = 3,
279  _CTRL_REG4_G_FS_SHIFT = 4,
280 
281  CTRL_REG4_G_BLE = 0x40, // big/little endian data selection
282  CTRL_REG4_G_BDU = 0x80 // block data updates
284 
289  typedef enum {
290  G_ST_NORMAL = 0, // normal mode
291  G_ST_SELFTEST0 = 1, // x+, y-, z-
292 
293  // 2, reserved
294 
295  G_ST_SELFTEST1 = 3 // x-, y+, z+
296  } G_ST_T;
297 
302  typedef enum {
303  G_FS_245 = 0, // 245 deg/sec
304  G_FS_500 = 1,
305  G_FS_2000 = 2
306  // 3 is also 2000
307  } G_FS_T;
308 
312  typedef enum {
313  CTRL_REG5_G_OUTSEL0 = 0x01, // see fig. 18 in the datasheet
314  CTRL_REG5_G_OUTSEL1 = 0x02,
315  _CTRL_REG5_G_OUTSEL_MASK = 3,
316  _CTRL_REG5_G_OUTSEL_SHIFT = 0,
317 
318  CTRL_REG5_G_INT1SEL0 = 0x04, // see fig. 18 in the datasheet
319  CTRL_REG5_G_INT1SEL1 = 0x08,
320  _CTRL_REG5_G_INT1SEL_MASK = 3,
321  _CTRL_REG5_G_INT1SEL_SHIFT = 2,
322 
323  CTRL_REG5_G_HPEN = 0x10, // HPF enable
324 
325  // 0x20 reserved
326 
327  CTRL_REG5_G_FIFO_EN = 0x40,
328  CTRL_REG5_G_BOOT = 0x80 // reboot memory content
330 
331 
336  typedef enum {
337  G_INT1OUTSEL_0 = 0,
338  G_INT1OUTSEL_1 = 1,
339  G_INT1OUTSEL_2 = 2,
340  G_INT1OUTSEL_3 = 3
341  } G_INT1OUTSEL_T;
342 
346  typedef enum {
347  STATUS_REG_G_XDA = 0x01, // X axis data available
348  STATUS_REG_G_YDA = 0x02,
349  STATUS_REG_G_ZDA = 0x04,
350  STATUS_REG_G_ZYXDA = 0x08, // X, Y, and Z data available
351 
352  STATUS_REG_G_XOR = 0x10, // X data overrun
353  STATUS_REG_G_YOR = 0x20,
354  STATUS_REG_G_ZOR = 0x40,
355  STATUS_REG_G_ZYXOR = 0x80
357 
361  typedef enum {
362  FIFO_CTRL_REG_G_WTM0 = 0x01, // FIFO watermark
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,
369 
370  FIFO_CTRL_REG_G_FM0 = 0x20, // FIFO mode config
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,
376 
377  // FIFO_CTRL_REG_G_WTM (FIFO watermark) is just a numeric value
378  // between 0-31, so we won't enumerate those values.
379 
384  typedef enum {
385  G_FM_BYPASS = 0,
386  G_FM_FIFO = 1,
387  G_FM_STREAM = 2,
388  G_FM_STREAM2FIFO = 3,
389  G_FM_BYPASS2STREAM = 4
390 
391  // 5-7 unused
392  } G_FM_T;
393 
398  typedef enum {
399  FIFO_CTRL_REG_G_FSS0 = 0x01, // FIFO stored data level
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,
406 
407  FIFO_CTRL_REG_G_EMPTY = 0x20, // FIFO empty
408  FIFO_CTRL_REG_G_OVRN = 0x40, // FIFO overrun
409  FIFO_CTRL_REG_G_WTM = 0x80 // watermark status
411 
416  typedef enum {
417  INT1_CFG_G_XLIE = 0x01, // X Low event interrupt enable
418  INT1_CFG_G_XHIE = 0x02, // X High event interrupt enable
419  INT1_CFG_G_YLIE = 0x04,
420  INT1_CFG_G_YHIE = 0x08,
421  INT1_CFG_G_ZLIE = 0x10,
422  INT1_CFG_G_ZHIE = 0x20,
423 
424  INT1_CFG_G_LIR = 0x40, // latch interrupt request
425  INT1_CFG_G_ANDOR = 0x80 // OR or AND interrupt events
427 
432  typedef enum {
433  INT1_SRC_G_XL = 0x01, // X low interrupt
434  INT1_SRC_G_XH = 0x02, // X high interrupt
435  INT1_SRC_G_YL = 0x04,
436  INT1_SRC_G_YH = 0x08,
437  INT1_SRC_G_ZL = 0x10,
438  INT1_SRC_G_ZH = 0x20,
439 
440  INT1_SRC_G_IA = 0x40 // interrupt active
441 
442  // 0x80 reserved
444 
445  // The following registers are for the Accelerometer (A/X),
446  // Magnetometer (M), and Temperature device.
447 
451  typedef enum {
452  // 0x00-0x04 reserved
453 
454  REG_OUT_TEMP_L_XM = 0x05, // temperature
455  REG_OUT_TEMP_H_XM = 0x06,
456 
457  REG_STATUS_REG_M = 0x07,
458 
459  REG_OUT_X_L_M = 0x08, // magnetometer outputs
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,
465 
466  // 0x0e reserved
467 
468  REG_WHO_AM_I_XM = 0x0f,
469 
470  // 0x10, 0x11 reserved
471 
472  REG_INT_CTRL_REG_M = 0x12,
473  REG_INT_SRC_REG_M = 0x13,
474 
475  REG_INT_THS_L_M = 0x14, // magnetometer threshold
476  REG_INT_THS_H_M = 0x15,
477 
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,
484 
485  REG_REFERENCE_X = 0x1c,
486  REG_REFERENCE_Y = 0x1d,
487  REG_REFERENCE_Z = 0x1e,
488 
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,
497 
498  REG_STATUS_REG_A = 0x27,
499 
500  REG_OUT_X_L_A = 0x28, // accelerometer outputs
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,
506 
507  REG_FIFO_CTRL_REG = 0x2e,
508  REG_FIFO_SRC_REG = 0x2f,
509 
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,
514 
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,
519 
520  REG_CLICK_CFG = 0x38,
521  REG_CLICK_SRC = 0x39,
522  REG_CLICK_THS = 0x3a,
523 
524  REG_TIME_LIMIT = 0x3b,
525  REG_TIME_LATENCY = 0x3c,
526  REG_TIME_WINDOW = 0x3d,
527 
528  REG_ACT_THS = 0x3e,
529  REG_ACT_DUR = 0x3f
530  } REG_XM_T;
531 
535  typedef enum {
536  STATUS_REG_M_XMDA = 0x01, // X mag axis data available
537  STATUS_REG_M_YMDA = 0x02,
538  STATUS_REG_M_ZMDA = 0x04,
539  STATUS_REG_M_ZYXMDA = 0x08, // X, Y, and Z mag data available
540 
541  STATUS_REG_M_XMOR = 0x10, // X mag data overrun
542  STATUS_REG_M_YMOR = 0x20,
543  STATUS_REG_M_ZMOR = 0x40,
544  STATUS_REG_M_ZYXMOR = 0x80
546 
550  typedef enum {
551  INT_CTRL_REG_M_MIEN = 0x01, // mag interrupt enable
552  INT_CTRL_REG_M_4D = 0x02,
553  INT_CTRL_REG_M_IEL = 0x04, // latch intr request
554  INT_CTRL_REG_M_IEA = 0x08,
555  INT_CTRL_REG_M_PP_OD = 0x10, // push-pull/open drian
556  INT_CTRL_REG_M_ZMIEN = 0x20, // Z mag axis interrupt recognition
557  INT_CTRL_REG_M_YMIEN = 0x40,
558  INT_CTRL_REG_M_XMIEN = 0x80
560 
564  typedef enum {
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
574 
575 
579  typedef enum {
580  CTRL_REG0_XM_HPIS2 = 0x01, // HPF enable for int generator 2
581  CTRL_REG0_XM_HPIS1 = 0x02,
582 
583  CTRL_REG0_XM_HP_CLICK = 0x04, // HPF enable for click
584 
585  // 0x08,0x10 reserved
586 
587  CTRL_REG0_XM_WTM_LEN = 0x20, // watermark enable
588  CTRL_REG0_XM_FIFO_EN = 0x40, // FIFO enable
589  CTRL_REG0_XM_BOOT = 0x80 // reboot memory content
591 
595  typedef enum {
596  CTRL_REG1_XM_AXEN = 0x01, // accelerometer x axis enable
597  CTRL_REG1_XM_AYEN = 0x02,
598  CTRL_REG1_XM_AZEN = 0x03,
599 
600  CTRL_REG1_XM_BDU = 0x04, // block data update
601 
602  CTRL_REG1_XM_AODR0 = 0x10, // accelerometer output data rate
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
609 
613  typedef enum {
614  XM_AODR_PWRDWN = 0, // power down mode
615  XM_AODR_3_125 = 1, // 3.125 Hz
616  XM_AODR_6_25 = 2,
617  XM_AODR_12_5 = 3,
618  XM_AODR_25 = 4, // 25Hz
619  XM_AODR_50 = 5,
620  XM_AODR_100 = 6,
621  XM_AODR_200 = 7,
622  XM_AODR_400 = 8,
623  XM_AODR_800 = 9,
624  XM_AODR_1000 = 10
625  // 11-15 unused
626  } XM_AODR_T;
627 
631  typedef enum {
632  CTRL_REG2_XM_SIM = 0x01,
633 
634  CTRL_REG2_XM_AST0 = 0x02, // accel self-test enable
635  CTRL_REG2_XM_AST1 = 0x04,
636  _CTRL_REG2_XM_AST_MASK = 3,
637  _CTRL_REG2_XM_AST_SHIFT = 1,
638 
639  CTRL_REG2_XM_AFS0 = 0x08, // accel full scale
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,
644 
645  CTRL_REG2_XM_ABW0 = 0x40, // accel anti-alias filter bandwidth
646  CTRL_REG2_XM_ABW1 = 0x80,
647  _CTRL_REG2_XM_ABW_MASK = 3,
648  _CTRL_REG2_XM_ABW_SHIFT = 6
650 
654  typedef enum {
655  XM_AST_NORMAL = 0,
656  XM_AST_POS_SIGN = 1,
657  XM_AST_NEG_SIGN = 2
658  // 3 not allowed
659  } XM_AST_T;
660 
664  typedef enum {
665  XM_AFS_2 = 0, // 2g
666  XM_AFS_4 = 1,
667  XM_AFS_6 = 2,
668  XM_AFS_8 = 3,
669  XM_AFS_16 = 4
670 
671  // 5-7 not used
672  } XM_AFS_T;
673 
677  typedef enum {
678  XM_ABW_773 = 0, // 773Hz
679  XM_ABW_194 = 1, // these two might be inverted (typo in ds)
680  XM_ABW_362 = 2,
681  XM_ABW_50 = 3
682  } XM_ABW_T;
683 
687  typedef enum {
688  CTRL_REG3_XM_P1_EMPTY = 0x01, // INT1_XM pin enables
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
697 
701  typedef enum {
702  CTRL_REG4_XM_P2_WTM = 0x01, // INT2_XM pin enables
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
711 
715  typedef enum {
716  CTRL_REG5_XM_LIR1 = 0x01, // latch intr 1
717  CTRL_REG5_XM_LIR2 = 0x02, // latch intr 2
718 
719  CTRL_REG5_XM_ODR0 = 0x04, // mag output data rate
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,
724 
725  CTRL_REG5_XM_RES0 = 0x20, // mag resolution
726  CTRL_REG5_XM_RES1 = 0x40,
727  _CTRL_REG5_XM_RES_MASK = 3,
728  _CTRL_REG5_XM_RES_SHIFT = 5,
729 
730  CTRL_REG5_XM_TEMP_EN = 0x80 // temp sensor enable
732 
736  typedef enum {
737  XM_ODR_3_125 = 0, // 3.125Hz
738  XM_ODR_6_25 = 1,
739  XM_ODR_12_5 = 2,
740  XM_ODR_25 = 3,
741  XM_ODR_50 = 4,
742  XM_ODR_100 = 5
743 
744  // 6, 7 reserved
745  } XM_ODR_T;
746 
750  typedef enum {
751  XM_RES_LOW = 0, // low resolution
752 
753  // 1, 2 reserved
754 
755  XM_RES_HIGH = 3,
756  } XM_RES_T;
757 
761  typedef enum {
762  // 0x01-0x10 reserved
763 
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
768 
769  // 0x80 reserved
771 
775  typedef enum {
776  XM_MFS_2 = 0, // +/- 2 gauss
777  XM_MFS_4 = 1,
778  XM_MFS_8 = 2,
779  XM_MFS_12 = 3
780  } XM_MFS_T;
781 
785  typedef enum {
786  CTRL_REG7_XM_MD0 = 0x01, // mag sensor mode
787  CTRL_REG7_XM_MD1 = 0x02,
788  _CTRL_REG7_XM_MD_MASK = 3,
789  _CTRL_REG7_XM_MD_SHIFT = 0,
790 
791  CTRL_REG7_XM_MLP = 0x04, // mag low power mode
792 
793  // 0x08, 0x10 reserved
794 
795  CTRL_REG7_XM_AFDS = 0x20, // filtered acceleration data
796 
797  CTRL_REG7_XM_AHPM0 = 0x40, // accel HPF selection
798  CTRL_REG7_XM_AHPM1 = 0x80,
799  _CTRL_REG7_XM_AHPM_MASK = 3,
800  _CTRL_REG7_XM_AHPM_SHIFT = 6
802 
806  typedef enum {
807  XM_MD_CONTINUOUS = 0, // continuous conversion
808  XM_MD_SINGLE = 1, // single conversion
809  XM_MD_POWERDOWN = 2 // power down mode
810  // 3 is also power down mode, for some odd reason
811  } XM_MD_T;
812 
816  typedef enum {
817  // XM_AHPM_NORMAL_REF: Normal mode (resets x, y and z-axis
818  // reading REFERENCE_X (1Ch), REFERENCE_Y (1Dh) and REFERENCE_Y
819  // (1Dh) registers respectively)
820 
821  XM_AHPM_NORMAL_REF = 0,
822  XM_AHPM_REFERENCE = 1,
823  XM_AHPM_NORMAL = 2,
824  XM_AHPM_AUTORESET = 3 // autoreset on interrupt
825  } XM_AHPM_T;
826 
830  typedef enum {
831  STATUS_REG_A_XADA = 0x01, // X accel axis data available
832  STATUS_REG_A_YADA = 0x02,
833  STATUS_REG_A_ZADA = 0x04,
834  STATUS_REG_A_ZYXADA = 0x08, // X, Y, and Z accel data available
835 
836  STATUS_REG_A_XAOR = 0x10, // X accel data overrun
837  STATUS_REG_A_YAOR = 0x20,
838  STATUS_REG_A_ZAOR = 0x40,
839  STATUS_REG_A_ZYXAOR = 0x80
841 
845  typedef enum {
846  FIFO_CTRL_REG_FTH0 = 0x01, // FIFO watermark/threshold
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,
853 
854  FIFO_CTRL_REG_FM0 = 0x20, // FIFO mode config
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,
859  } FIFO_CTRL_REG_T;
860 
861  // FIFO_CTRL_REG_FTH (FIFO watermark/threshold) is just a numeric
862  // value between 0-31, so we won't enumerate those values.
863 
868  typedef enum {
869  FM_BYPASS = 0,
870  FM_FIFO = 1,
871  FM_STREAM = 2,
872  FM_STREAM2FIFO = 3,
873  FM_BYPASS2STREAM = 4
874 
875  // 5-7 unused
876  } FM_T;
877 
882  typedef enum {
883  FIFO_CTRL_REG_FSS0 = 0x01, // FIFO stored data level
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,
890 
891  FIFO_CTRL_REG_EMPTY = 0x20, // FIFO empty
892  FIFO_CTRL_REG_OVRN = 0x40, // FIFO overrun
893  FIFO_CTRL_REG_WTM = 0x80 // watermark status
895 
900  typedef enum {
901  INT_GEN_X_REG_XLIE_XDOWNE = 0x01, // enable intr on X low or dir recog
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, // enable 6D direction function
908  INT_GEN_X_REG_AOI = 0x80 // AND/OR combination of intrs
910 
915  typedef enum {
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
923  // 0x80 reserved
925 
930  typedef enum {
931  INT_GEN_X_THS0 = 0x01, // interrupt threshold
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
940  // 0x80 reserved
942 
947  typedef enum {
948  INT_GEN_X_DUR0 = 0x01, // interrupt duration
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
957  // 0x80 reserved
959 
964  typedef enum {
965  CLICK_CONFIG_XS = 0x01, // enable intr single click x
966  CLICK_CONFIG_XD = 0x02, // enable intr double click x
967  CLICK_CONFIG_YS = 0x04,
968  CLICK_CONFIG_YD = 0x08,
969  CLICK_CONFIG_ZS = 0x10,
970  CLICK_CONFIG_ZD = 0x20
971  // 0x40, 0x80 reserved
973 
978  typedef enum {
979  CLICK_SRC_X = 0x01,
980  CLICK_SRC_Y = 0x02,
981  CLICK_SRC_Z = 0x04,
982  CLICK_SRC_SIGN = 0x08,
983  CLICK_SRC_SCLICK = 0x10,
984  CLICK_SRC_DCLICK = 0x20,
985  CLICK_SRC_IA = 0x40
986  // 0x80 reserved
988 
993  typedef enum {
994  CLICK_THS_THS0 = 0x01, // click threshold
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
1003  // 0x80 reserved
1004  } CLICK_THS_BITS_T;
1005 
1010  typedef enum {
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
1020  // 0x80 reserved
1022 
1027  typedef enum {
1028  ACT_THS_ACTH0 = 0x01, // 1 LSb = 16mg (?)
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
1037  // 0x80 reserved
1038  } ACT_THS_BITS_T;
1039 
1040  // Driver specific enumerations
1041 
1042  // device enums for read/write regs
1043  typedef enum {
1044  DEV_GYRO,
1045  DEV_XM
1046  } DEVICE_T;
1047 
1048  // interrupt selection for installISR() and uninstallISR()
1049  typedef enum {
1050  INTERRUPT_G_INT, // gyroscope interrupt
1051  INTERRUPT_G_DRDY, // gyroscope data ready interrupt
1052  INTERRUPT_XM_GEN1, // XM interrupt generator 1
1053  INTERRUPT_XM_GEN2 // XM interrupt generator 2
1054  } INTERRUPT_PINS_T;
1055 
1056 
1063  LSM9DS0(int bus=LSM9DS0_I2C_BUS,
1064  uint8_t gAddress=LSM9DS0_DEFAULT_GYRO_ADDR,
1065  uint8_t xmAddress=LSM9DS0_DEFAULT_XM_ADDR);
1066 
1070  ~LSM9DS0();
1071 
1077  bool init();
1078 
1083  void update();
1084 
1088  void updateGyroscope();
1089 
1093  void updateAccelerometer();
1094 
1098  void updateMagnetometer();
1099 
1103  void updateTemperature();
1104 
1112  uint8_t readReg(DEVICE_T dev, uint8_t reg);
1113 
1123  void readRegs(DEVICE_T dev, uint8_t reg, uint8_t *buffer, int len);
1124 
1133  bool writeReg(DEVICE_T dev, uint8_t reg, uint8_t val);
1134 
1141  bool setGyroscopePowerDown(bool enable);
1142 
1151  bool setGyroscopeEnableAxes(uint8_t axes);
1152 
1159  bool setGyroscopeODR(G_ODR_T odr);
1160 
1167  bool setGyroscopeScale(G_FS_T scale);
1168 
1175  bool setAccelerometerEnableAxes(uint8_t axes);
1176 
1183  bool setAccelerometerODR(XM_AODR_T odr);
1184 
1191  bool setAccelerometerScale(XM_AFS_T scale);
1192 
1200 
1207  bool setMagnetometerODR(XM_ODR_T odr);
1208 
1215  bool setMagnetometerMode(XM_MD_T mode);
1216 
1225  bool setMagnetometerLPM(bool enable);
1226 
1233  bool setMagnetometerScale(XM_MFS_T scale);
1234 
1243  void getAccelerometer(float *x, float *y, float *z);
1244 
1253  void getGyroscope(float *x, float *y, float *z);
1254 
1263  void getMagnetometer(float *x, float *y, float *z);
1264 
1265 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
1266 
1271  float *getAccelerometer();
1272 
1278  float *getGyroscope();
1279 
1285  float *getMagnetometer();
1286 #endif
1287 
1296  float getTemperature();
1297 
1304  bool enableTemperatureSensor(bool enable);
1305 
1311  uint8_t getGyroscopeStatus();
1312 
1318  uint8_t getMagnetometerStatus();
1319 
1325  uint8_t getAccelerometerStatus();
1326 
1332  uint8_t getGyroscopeInterruptConfig();
1333 
1340  bool setGyroscopeInterruptConfig(uint8_t enables);
1341 
1347  uint8_t getGyroscopeInterruptSrc();
1348 
1355 
1362  bool setMagnetometerInterruptControl(uint8_t enables);
1363 
1369  uint8_t getMagnetometerInterruptSrc();
1370 
1376  uint8_t getInterruptGen1();
1377 
1384  bool setInterruptGen1(uint8_t enables);
1385 
1391  uint8_t getInterruptGen1Src();
1392 
1398  uint8_t getInterruptGen2();
1399 
1406  bool setInterruptGen2(uint8_t enables);
1407 
1413  uint8_t getInterruptGen2Src();
1414 
1415 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
1416  void installISR(INTERRUPT_PINS_T intr, int gpio, mraa::Edge level,
1417  jobject runnable);
1418 #else
1419 
1431  void installISR(INTERRUPT_PINS_T intr, int gpio, mraa::Edge level,
1432  void (*isr)(void *), void *arg);
1433 #endif
1434 
1440  void uninstallISR(INTERRUPT_PINS_T intr);
1441 
1442  protected:
1443  // uncompensated accelerometer and gyroscope values
1444  float m_accelX;
1445  float m_accelY;
1446  float m_accelZ;
1447 
1448  float m_gyroX;
1449  float m_gyroY;
1450  float m_gyroZ;
1451 
1452  float m_magX;
1453  float m_magY;
1454  float m_magZ;
1455 
1456  // uncompensated temperature value
1457  float m_temp;
1458 
1459  // accelerometer and gyro scaling factors, depending on their Full
1460  // Scale settings.
1461  float m_accelScale;
1462  float m_gyroScale;
1463  float m_magScale;
1464 
1465  private:
1466  // OR'd with a register, this enables register autoincrement mode,
1467  // which we need.
1468  static const uint8_t m_autoIncrementMode = 0x80;
1469 
1470  mraa::I2c m_i2cG;
1471  mraa::I2c m_i2cXM;
1472  uint8_t m_gAddr;
1473  uint8_t m_xmAddr;
1474 
1475  // return a reference to a gpio pin pointer depending on intr
1476  mraa::Gpio*& getPin(INTERRUPT_PINS_T intr);
1477 
1478  // possible interrupt pins
1479  mraa::Gpio *m_gpioG_INT;
1480  mraa::Gpio *m_gpioG_DRDY;
1481  mraa::Gpio *m_gpioXM_GEN1;
1482  mraa::Gpio *m_gpioXM_GEN2;
1483  };
1484 }
1485 
1486 
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