upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
mpu60x0.hpp
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 MPU60X0_I2C_BUS 0
33 #define MPU60X0_DEFAULT_I2C_ADDR 0x68
34 
35 namespace upm {
36 
62  class MPU60X0 {
63  public:
64 
65  // NOTE: These enums were composed from both the mpu6050 and
66  // mpu9150 register maps, since this driver was written using an
67  // mpu9150, but we'd like this module to be usable with a
68  // standalone mpu60x0.
69  //
70  // Registers and bitfields marked with an '*' in their
71  // comment indicate registers or bit fields present in the mpu9150
72  // register map, but not in the original mpu6050 register map. If
73  // using this module on a standalone mpu6050, you should avoid
74  // using those registers or bitfields marked with an *.
75 
79  typedef enum {
80  REG_SELF_TEST_X = 0x0d,
81  REG_SELF_TEST_Y = 0x0e,
82  REG_SELF_TEST_Z = 0x0f,
83  REG_SELF_TEST_A = 0x10,
84 
85  REG_SMPLRT_DIV = 0x19, // sample rate divider
86 
87  REG_CONFIG = 0x1a,
88  REG_GYRO_CONFIG = 0x1b,
89  REG_ACCEL_CONFIG = 0x1c,
90 
91  REG_FF_THR = 0x1d, // *freefall threshold
92  REG_FF_DUR = 0x1e, // *freefall duration
93 
94  REG_MOT_THR = 0x1f, // motion threshold
95  REG_MOT_DUR = 0x20, // *motion duration
96 
97  REG_ZRMOT_THR = 0x21, // *zero motion threshhold
98  REG_ZRMOT_DUR = 0x22, // *zero motion duration
99 
100  REG_FIFO_EN = 0x23,
101 
102  REG_I2C_MST_CTRL = 0x24, // I2C master control
103 
104  REG_I2C_SLV0_ADDR = 0x25, // I2C slave 0
105  REG_I2C_SLV0_REG = 0x26,
106  REG_I2C_SLV0_CTRL = 0x27,
107 
108  REG_I2C_SLV1_ADDR = 0x28, // I2C slave 1
109  REG_I2C_SLV1_REG = 0x29,
110  REG_I2C_SLV1_CTRL = 0x2a,
111 
112  REG_I2C_SLV2_ADDR = 0x2b, // I2C slave 2
113  REG_I2C_SLV2_REG = 0x2c,
114  REG_I2C_SLV2_CTRL = 0x2d,
115 
116  REG_I2C_SLV3_ADDR = 0x2e, // I2C slave 3
117  REG_I2C_SLV3_REG = 0x2f,
118  REG_I2C_SLV3_CTRL = 0x30,
119 
120  REG_I2C_SLV4_ADDR = 0x31, // I2C slave 4
121  REG_I2C_SLV4_REG = 0x32,
122  REG_I2C_SLV4_DO = 0x33,
123  REG_I2C_SLV4_CTRL = 0x34,
124  REG_I2C_SLV4_DI = 0x35,
125 
126  REG_I2C_MST_STATUS = 0x36, // I2C master status
127 
128  REG_INT_PIN_CFG = 0x37, // interrupt pin config/i2c bypass
129  REG_INT_ENABLE = 0x38,
130 
131  // 0x39 reserved
132 
133  REG_INT_STATUS = 0x3a, // interrupt status
134 
135  REG_ACCEL_XOUT_H = 0x3b, // accelerometer outputs
136  REG_ACCEL_XOUT_L = 0x3c,
137 
138  REG_ACCEL_YOUT_H = 0x3d,
139  REG_ACCEL_YOUT_L = 0x3e,
140 
141  REG_ACCEL_ZOUT_H = 0x3f,
142  REG_ACCEL_ZOUT_L = 0x40,
143 
144  REG_TEMP_OUT_H = 0x41, // temperature output
145  REG_TEMP_OUT_L = 0x42,
146 
147  REG_GYRO_XOUT_H = 0x43, // gyro outputs
148  REG_GYRO_XOUT_L = 0x44,
149 
150  REG_GYRO_YOUT_H = 0x45,
151  REG_GYRO_YOUT_L = 0x46,
152 
153  REG_GYRO_ZOUT_H = 0x47,
154  REG_GYRO_ZOUT_L = 0x48,
155 
156  REG_EXT_SENS_DATA_00 = 0x49, // external sensor data
157  REG_EXT_SENS_DATA_01 = 0x4a,
158  REG_EXT_SENS_DATA_02 = 0x4b,
159  REG_EXT_SENS_DATA_03 = 0x4c,
160  REG_EXT_SENS_DATA_04 = 0x4d,
161  REG_EXT_SENS_DATA_05 = 0x4e,
162  REG_EXT_SENS_DATA_06 = 0x4f,
163  REG_EXT_SENS_DATA_07 = 0x50,
164  REG_EXT_SENS_DATA_08 = 0x51,
165  REG_EXT_SENS_DATA_09 = 0x52,
166  REG_EXT_SENS_DATA_10 = 0x53,
167  REG_EXT_SENS_DATA_11 = 0x54,
168  REG_EXT_SENS_DATA_12 = 0x55,
169  REG_EXT_SENS_DATA_13 = 0x56,
170  REG_EXT_SENS_DATA_14 = 0x57,
171  REG_EXT_SENS_DATA_15 = 0x58,
172  REG_EXT_SENS_DATA_16 = 0x59,
173  REG_EXT_SENS_DATA_17 = 0x5a,
174  REG_EXT_SENS_DATA_18 = 0x5b,
175  REG_EXT_SENS_DATA_19 = 0x5c,
176  REG_EXT_SENS_DATA_20 = 0x5d,
177  REG_EXT_SENS_DATA_21 = 0x5e,
178  REG_EXT_SENS_DATA_22 = 0x5f,
179  REG_EXT_SENS_DATA_23 = 0x60,
180 
181  REG_MOT_DETECT_STATUS = 0x61, // *
182 
183  // 0x62 reserved
184 
185  REG_I2C_SLV0_DO = 0x63, // I2C slave data outs
186  REG_I2C_SLV1_DO = 0x64,
187  REG_I2C_SLV2_DO = 0x65,
188  REG_I2C_SLV3_DO = 0x66,
189 
190  REG_I2C_MST_DELAY_CTRL = 0x67,
191 
192  REG_SIGNAL_PATH_RESET = 0x68, // signal path resets
193 
194  REG_MOT_DETECT_CTRL = 0x69,
195 
196  REG_USER_CTRL = 0x6a,
197 
198  REG_PWR_MGMT_1 = 0x6b, // power management
199  REG_PWR_MGMT_2 = 0x6c,
200 
201  // 0x6d-0x71 reserved
202 
203  REG_FIFO_COUNTH = 0x72,
204  REG_FIFO_COUNTL = 0x73,
205 
206  REG_FIFO_R_W = 0x74,
207 
208  REG_WHO_AM_I = 0x75
209  } MPU60X0_REG_T;
210 
214  typedef enum {
215  CONFIG_DLPF_CFG0 = 0x01, // digital low-pass filter config
216  CONFIG_DLPF_CFG1 = 0x02,
217  CONFIG_DLPF_CFG2 = 0x04,
218  _CONFIG_DLPF_SHIFT = 0,
219  _CONFIG_DLPF_MASK = 7,
220 
221  CONFIG_EXT_SYNC_SET0 = 0x08, // FSYNC pin config
222  CONFIG_EXT_SYNC_SET1 = 0x10,
223  CONFIG_EXT_SYNC_SET2 = 0x20,
224  _CONFIG_EXT_SYNC_SET_SHIFT = 3,
225  _CONFIG_EXT_SYNC_SET_MASK = 7
226  } CONFIG_BITS_T;
227 
231  typedef enum {
232  DLPF_260_256 = 0, // accel/gyro bandwidth (Hz)
233  DLPF_184_188 = 1,
234  DLPF_94_98 = 2,
235  DLPF_44_42 = 3,
236  DLPF_21_20 = 4,
237  DLPF_10_10 = 5,
238  DLPF_5_5 = 6,
239  DLPF_RESERVED = 7
240  } DLPF_CFG_T;
241 
245  typedef enum {
246  EXT_SYNC_DISABLED = 0,
247  EXT_SYNC_TEMP_OUT = 1,
248  EXT_SYNC_GYRO_XOUT = 2,
249  EXT_SYNC_GYRO_YOUT = 3,
250  EXT_SYNC_GYRO_ZOUT = 4,
251  EXT_SYNC_ACCEL_XOUT = 5,
252  EXT_SYNC_ACCEL_YOUT = 6,
253  EXT_SYNC_ACCEL_ZOUT = 7
254  } EXT_SYNC_SET_T;
255 
259  typedef enum {
260  // 0x01-0x04 reserved
261  FS_SEL0 = 0x08, // gyro full scale range
262  FS_SEL1 = 0x10,
263  _FS_SEL_SHIFT = 3,
264  _FS_SEL_MASK = 3,
265 
266  ZG_ST = 0x20, // gyro self test bits
267  YG_ST = 0x40,
268  XG_ST = 0x80
270 
274  typedef enum {
275  FS_250 = 0, // 250 deg/s, 131 LSB deg/s
276  FS_500 = 1, // 500 deg/s, 65.5 LSB deg/s
277  FS_1000 = 2, // 1000 deg/s, 32.8 LSB deg/s
278  FS_2000 = 3 // 2000 deg/s, 16.4 LSB deg/s
279  } FS_SEL_T;
280 
284  typedef enum {
285  // 0x01-0x04 reserved
286  AFS_SEL0 = 0x08, // accel full scale range
287  AFS_SEL1 = 0x10,
288  _AFS_SEL_SHIFT = 3,
289  _AFS_SEL_MASK = 3,
290 
291  ZA_ST = 0x20, // gyro self test bits
292  YA_ST = 0x40,
293  XA_ST = 0x80
295 
299  typedef enum {
300  AFS_2 = 0, // 2g, 16384 LSB/g
301  AFS_4 = 1, // 4g, 8192 LSB/g
302  AFS_8 = 2, // 8g, 4096 LSB/g
303  AFS_16 = 3 // 16g, 2048 LSB/g
304  } AFS_SEL_T;
305 
309  typedef enum {
310  SLV0_FIFO_EN = 0x01,
311  SLV1_FIFO_EN = 0x02,
312  SLV2_FIFO_EN = 0x04,
313 
314  ACCEL_FIFO_EN = 0x08,
315 
316  ZG_FIFO_EN = 0x10,
317  YG_FIFO_EN = 0x20,
318  XG_FIFO_EN = 0x40,
319 
320  TEMP_FIFO_EN = 0x80
321  } FIFO_EN_BITS_T;
322 
326  typedef enum {
327  I2C_MST_CLK0 = 0x01,
328  I2C_MST_CLK1 = 0x02,
329  I2C_MST_CLK2 = 0x04,
330  I2C_MST_CLK3 = 0x08,
331  _I2C_MST_CLK_SHIFT = 0,
332  _I2C_MST_CLK_MASK = 15,
333 
334  I2C_MST_P_NSR = 0x10,
335 
336  SLV_3_FIFO_EN = 0x20,
337 
338  WAIT_FOR_ES = 0x40,
339 
340  MULT_MST_EN = 0x80
342 
346  typedef enum {
347  MST_CLK_348 = 0, // 348Khz
348  MST_CLK_333 = 1,
349  MST_CLK_320 = 2,
350  MST_CLK_308 = 3,
351  MST_CLK_296 = 4,
352  MST_CLK_286 = 5,
353  MST_CLK_276 = 6,
354  MST_CLK_267 = 7,
355  MST_CLK_258 = 8,
356  MST_CLK_500 = 9,
357  MST_CLK_471 = 10,
358  MST_CLK_444 = 11,
359  MST_CLK_421 = 12,
360  MST_CLK_400 = 13,
361  MST_CLK_381 = 14,
362  MST_CLK_364 = 15
363  } I2C_MST_CLK_T;
364 
368  typedef enum {
369  I2C_SLV_ADDR0 = 0x01,
370  I2C_SLV_ADDR1 = 0x02,
371  I2C_SLV_ADDR2 = 0x04,
372  I2C_SLV_ADDR3 = 0x08,
373  I2C_SLV_ADDR4 = 0x10,
374  I2C_SLV_ADDR5 = 0x20,
375  I2C_SLV_ADDR6 = 0x40,
376  _I2C_SLV_ADDR_SHIFT = 0,
377  _I2C_SLV_ADDR_MASK = 127,
378 
379  I2C_SLV_RW = 0x80
381 
385  typedef enum {
386  I2C_SLV_LEN0 = 0x01,
387  I2C_SLV_LEN1 = 0x02,
388  I2C_SLV_LEN2 = 0x04,
389  I2C_SLV_LEN3 = 0x08,
390  _I2C_SLV_LEN_SHIFT = 0,
391  _I2C_SLV_LEN_MASK = 15,
392 
393  I2C_SLV_GRP = 0x10,
394  I2C_SLV_REG_DIS = 0x20,
395  I2C_SLV_BYTE_SW = 0x40,
396  I2C_SLV_EN = 0x80
398 
409  typedef enum {
410  I2C_MST_DLY0 = 0x01,
411  I2C_MST_DLY1 = 0x02,
412  I2C_MST_DLY2 = 0x04,
413  I2C_MST_DLY3 = 0x08,
414  I2C_MST_DLY4 = 0x10,
415  _I2C_MST_DLY_SHIFT = 0,
416  _I2C_MST_DLY_MASK = 31,
417 
418  I2C_SLV4_REG_DIS = 0x20,
419  I2C_SLV4_INT_EN = 0x40,
420  I2C_SLV4_EN = 0x80
422 
426  typedef enum {
427  I2C_SLV0_NACK = 0x01,
428  I2C_SLV1_NACK = 0x02,
429  I2C_SLV2_NACK = 0x04,
430  I2C_SLV3_NACK = 0x08,
431  I2C_SLV4_NACK = 0x10,
432 
433  I2C_LOST_ARB = 0x20,
434  I2C_SLV4_DONE = 0x40,
435  PASS_THROUGH = 0x80
437 
441  typedef enum {
442  CLKOUT_EN = 0x01, // *
443 
444  I2C_BYPASS_ENABLE = 0x02,
445 
446  FSYNC_INT_EN = 0x04,
447  FSYNC_INT_LEVEL = 0x08,
448 
449  INT_RD_CLEAR = 0x10,
450 
451  LATCH_INT_EN = 0x20,
452 
453  INT_OPEN = 0x40,
454  INT_LEVEL = 0x80
456 
460  typedef enum {
461  DATA_RDY_EN = 0x01, // *
462 
463  // 0x02, 0x04 reserved
464 
465  I2C_MST_INT_EN = 0x08,
466 
467  FIFO_OFLOW_EN = 0x10,
468 
469  ZMOT_EN = 0x20, // *zero motion
470  MOT_EN = 0x40,
471  FF_EN = 0x80 // *freefall
473 
477  typedef enum {
478  DATA_RDY_INT = 0x01,
479 
480  // 0x02, 0x04 reserved
481 
482  I2C_MST_INT = 0x08,
483 
484  FIFO_OFLOW_INT = 0x10,
485 
486  ZMOT_INT = 0x20, // *zero motion
487  MOT_INT = 0x40,
488  FF_INT = 0x80 // *freefall
490 
494  typedef enum {
495  MOT_ZRMOT = 0x01, // *
496 
497  // 0x02 reserved
498 
499  MOT_ZPOS = 0x04, // *
500  MOT_ZNEG = 0x08, // *
501 
502  MOT_YPOS = 0x10, // *
503  MOT_YNEG = 0x20, // *
504 
505  MOT_XPOS = 0x40, // *
506  MOT_XNEG = 0x80, // *
508 
512  typedef enum {
513  I2C_SLV0_DLY_EN = 0x01,
514  I2C_SLV1_DLY_EN = 0x02,
515  I2C_SLV2_DLY_EN = 0x04,
516  I2C_SLV3_DLY_EN = 0x08,
517  I2C_SLV4_DLY_EN = 0x10,
518 
519  // 0x20, 0x40, reserved
520 
521  DELAY_ES_SHADOW = 0x80
523 
527  typedef enum {
528  TEMP_RESET = 0x01,
529  ACCEL_RESET = 0x02,
530  GYRO_RESET = 0x04
531 
532  // 0x08-0x80 reserved
534 
538  typedef enum {
539  MOT_COUNT0 = 0x01, // *
540  MOT_COUNT1 = 0x02, // *
541  _MOT_COUNT_SHIFT = 0,
542  _MOT_COUNT_MASK = 3,
543 
544  FF_COUNT0 = 0x04, // *
545  FF_COUNT1 = 0x08, // *
546  _FF_COUNT_SHIFT = 2,
547  _FF_COUNT_MASK = 3,
548 
549  ACCEL_ON_DELAY0 = 0x10,
550  ACCEL_ON_DELAY1 = 0x20,
551  _ACCEL_ON_DELAY_SHIFT = 4,
552  _ACCEL_ON_DELAY_MASK = 3
553  // 0x40,0x80 reserved
555 
559  typedef enum {
560  COUNT_0 = 0, // Reset
561  COUNT_1 = 1, // counter decrement 1
562  COUNT_2 = 2, // counter decrement 2
563  COUNT_4 = 3 // counter decrement 4
564  } MOT_FF_COUNT_T;
565 
569  typedef enum {
570  ON_DELAY_0 = 0, // no delay
571  ON_DELAY_1 = 1, // add 1ms
572  ON_DELAY_2 = 2, // add 2ms
573  ON_DELAY_3 = 3 // add 3ms
575 
579  typedef enum {
580  SIG_COND_RESET = 0x01,
581  I2C_MST_RESET = 0x02,
582  FIFO_RESET = 0x04,
583 
584  // 0x08 reserved
585 
586  I2C_IF_DIS = 0x10,
587  I2C_MST_EN = 0x20,
588  FIFO_EN = 0x40
589 
592 
596  typedef enum {
597  CLKSEL0 = 0x01,
598  CLKSEL1 = 0x02,
599  CLKSEL2 = 0x04,
600  _CLKSEL_SHIFT = 0,
601  _CLKSEL_MASK = 7,
602 
603  TEMP_DIS = 0x08,
604 
605  // 0x10 reserved
606 
607  PWR_CYCLE = 0x20,
608  PWR_SLEEP = 0x40,
609  DEVICE_RESET = 0x80
611 
615  typedef enum {
616  INT_8MHZ = 0, // internal 8Mhz osc
617  PLL_XG = 1, // PLL X axis gyro
618  PLL_YG = 2, // PLL Y axis gyro
619  PLL_ZG = 3, // PLL Z axis gyro
620  PLL_EXT_32KHZ = 4, // PLL with external 32.768Khz ref
621  PLL_EXT_19MHZ = 5, // PLL with external 19.2Mhz ref
622  // 6 - reserved
623  CLK_STOP = 7 // stops clk
624  } CLKSEL_T;
625 
629  typedef enum {
630  STBY_ZG = 0x01,
631  STBY_YG = 0x02,
632  STBY_XG = 0x04,
633  STBY_ZA = 0x08,
634  STBY_YA = 0x10,
635  STBY_XA = 0x20,
636 
637  LP_WAKE_CTRL0 = 0x40,
638  LP_WAKE_CTRL1 = 0x80,
639  _LP_WAKE_CTRL_SHIFT = 6,
640  _LP_WAKE_CTRL_MASK = 3
642 
646  typedef enum {
647  LP_WAKE_1_25 = 0, // wakeup feq: 1.25hz
648  LP_WAKE_5 = 1, // 5hz
649  LP_WAKE_20 = 2, // 20hz
650  LP_WAKE_40 = 3, // 40hz
651  } LP_WAKE_CRTL_T;
652 
653 
660  MPU60X0(int bus=MPU60X0_I2C_BUS, uint8_t address=MPU60X0_DEFAULT_I2C_ADDR);
661 
665  virtual ~MPU60X0();
666 
672  bool init();
673 
687  void update();
688 
695  uint8_t readReg(uint8_t reg);
696 
705  void readRegs(uint8_t reg, uint8_t *buffer, int len);
706 
714  bool writeReg(uint8_t reg, uint8_t val);
715 
722  bool setSleep(bool enable);
723 
730  bool setClockSource(CLKSEL_T clk);
731 
738  bool setGyroscopeScale(FS_SEL_T scale);
739 
746  bool setAccelerometerScale(AFS_SEL_T scale);
747 
756 
775  bool setSampleRateDivider(uint8_t div);
776 
782  uint8_t getSampleRateDivider();
783 
792  void getAccelerometer(float *x, float *y, float *z);
793 
802  void getGyroscope(float *x, float *y, float *z);
803 
809  virtual float getTemperature();
810 
817  bool enableTemperatureSensor(bool enable);
818 
835 
843  bool enableI2CBypass(bool enable);
844 
854  bool setMotionDetectionThreshold(uint8_t thr);
855 
861  uint8_t getInterruptStatus();
862 
869  bool setInterruptEnables(uint8_t enables);
870 
876  uint8_t getInterruptEnables();
877 
884  bool setInterruptPinConfig(uint8_t cfg);
885 
891  uint8_t getInterruptPinConfig();
892 
905  void installISR(int gpio, mraa::Edge level, void (*isr)(void *), void *arg);
906 
911  void uninstallISR();
912 
913  mraa::Gpio* get_gpioIRQ();
914 
915  protected:
916  // uncompensated accelerometer and gyroscope values
917  float m_accelX;
918  float m_accelY;
919  float m_accelZ;
920 
921  float m_gyroX;
922  float m_gyroY;
923  float m_gyroZ;
924 
925  // uncompensated temperature value
926  float m_temp;
927 
928  // accelerometer and gyro scaling factors, depending on their Full
929  // Scale settings.
930  float m_accelScale;
931  float m_gyroScale;
932 
933  private:
934  /* Disable implicit copy and assignment operators */
935  MPU60X0(const MPU60X0&) = delete;
936  MPU60X0 &operator=(const MPU60X0&) = delete;
937 
938  mraa::I2c m_i2c;
939  uint8_t m_addr;
940 
941  mraa::Gpio *m_gpioIRQ;
942  };
943 }
bool setSampleRateDivider(uint8_t div)
Definition: mpu60x0.cxx:282
bool setMotionDetectionThreshold(uint8_t thr)
Definition: mpu60x0.cxx:357
bool setExternalSync(EXT_SYNC_SET_T val)
Definition: mpu60x0.cxx:334
AFS_SEL_T
Definition: mpu60x0.hpp:299
MOT_DETECT_STATUS_BITS_T
Definition: mpu60x0.hpp:494
bool enableTemperatureSensor(bool enable)
Definition: mpu60x0.cxx:322
MOT_FF_COUNT_T
Definition: mpu60x0.hpp:559
MOT_DETECT_CTRL_BITS_T
Definition: mpu60x0.hpp:538
void getGyroscope(float *x, float *y, float *z)
Definition: mpu60x0.cxx:304
INT_STATUS_BITS_T
Definition: mpu60x0.hpp:477
bool setAccelerometerScale(AFS_SEL_T scale)
Definition: mpu60x0.cxx:228
uint8_t readReg(uint8_t reg)
Definition: mpu60x0.cxx:139
ACCEL_CONFIG_BITS_T
Definition: mpu60x0.hpp:284
bool writeReg(uint8_t reg, uint8_t val)
Definition: mpu60x0.cxx:149
EXT_SYNC_SET_T
Definition: mpu60x0.hpp:245
bool setClockSource(CLKSEL_T clk)
Definition: mpu60x0.cxx:174
uint8_t getSampleRateDivider()
Definition: mpu60x0.cxx:287
PWR_MGMT_2_BITS_T
Definition: mpu60x0.hpp:629
PWR_MGMT_1_BITS_T
Definition: mpu60x0.hpp:596
void update()
Definition: mpu60x0.cxx:105
FS_SEL_T
Definition: mpu60x0.hpp:274
SIGNAL_PATH_RESET_BITS_T
Definition: mpu60x0.hpp:527
DLPF_CFG_T
Definition: mpu60x0.hpp:231
MPU60X0(int bus=MPU60X0_I2C_BUS, uint8_t address=MPU60X0_DEFAULT_I2C_ADDR)
Definition: mpu60x0.cxx:35
MST_DELAY_CTRL_BITS_T
Definition: mpu60x0.hpp:512
I2C_SLV_ADDR_BITS_T
Definition: mpu60x0.hpp:368
INT_PIN_CFG_BITS_T
Definition: mpu60x0.hpp:441
MPU60X0_REG_T
Definition: mpu60x0.hpp:79
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
void uninstallISR()
Definition: mpu60x0.cxx:402
USER_CTRL_BITS_T
Definition: mpu60x0.hpp:579
uint8_t getInterruptEnables()
Definition: mpu60x0.cxx:372
I2C_SLV_CTRL_BITS_T
Definition: mpu60x0.hpp:385
FIFO_EN_BITS_T
Definition: mpu60x0.hpp:309
bool setDigitalLowPassFilter(DLPF_CFG_T dlp)
Definition: mpu60x0.cxx:271
CLKSEL_T
Definition: mpu60x0.hpp:615
LP_WAKE_CRTL_T
Definition: mpu60x0.hpp:646
void installISR(int gpio, mraa::Edge level, void(*isr)(void *), void *arg)
Definition: mpu60x0.cxx:388
void readRegs(uint8_t reg, uint8_t *buffer, int len)
Definition: mpu60x0.cxx:144
virtual float getTemperature()
Definition: mpu60x0.cxx:316
bool setInterruptPinConfig(uint8_t cfg)
Definition: mpu60x0.cxx:377
bool setGyroscopeScale(FS_SEL_T scale)
Definition: mpu60x0.cxx:185
uint8_t getInterruptStatus()
Definition: mpu60x0.cxx:362
I2C_SLV4_CTRL_BITS_T
Definition: mpu60x0.hpp:409
bool init()
Definition: mpu60x0.cxx:67
ACCEL_ON_DELAY_T
Definition: mpu60x0.hpp:569
bool setSleep(bool enable)
Definition: mpu60x0.cxx:162
I2C_MST_STATUS_BITS_T
Definition: mpu60x0.hpp:426
I2C_MST_CTRL_BITS_T
Definition: mpu60x0.hpp:326
bool enableI2CBypass(bool enable)
Definition: mpu60x0.cxx:345
void getAccelerometer(float *x, float *y, float *z)
Definition: mpu60x0.cxx:292
uint8_t getInterruptPinConfig()
Definition: mpu60x0.cxx:382
GRYO_CONFIG_BITS_T
Definition: mpu60x0.hpp:259
bool setInterruptEnables(uint8_t enables)
Definition: mpu60x0.cxx:367
I2C_MST_CLK_T
Definition: mpu60x0.hpp:346
API for the MPU60X0 3-axis Gyroscope and 3-axis Accelerometer.
Definition: mpu60x0.hpp:62
INT_ENABLE_BITS_T
Definition: mpu60x0.hpp:460
virtual ~MPU60X0()
Definition: mpu60x0.cxx:62
CONFIG_BITS_T
Definition: mpu60x0.hpp:214