types.hpp
Go to the documentation of this file.
1 // =========================================================================
2 // This library is placed under the MIT License
3 // Copyright 2017-2018 Natanael Josue Rabello. All rights reserved.
4 // For the license information refer to LICENSE file in root directory.
5 // =========================================================================
6 
12 #ifndef _MPU_TYPES_HPP_
13 #define _MPU_TYPES_HPP_
14 
15 #include <stdint.h>
16 #include "sdkconfig.h"
17 #include "mpu/registers.hpp"
18 
20 namespace mpud {
21 
23 inline namespace types {
24 
26 typedef enum {
31 
32 #ifdef CONFIG_MPU_I2C
33 typedef I2C_t mpu_bus_t;
35 static constexpr mpu_bus_t& MPU_DEFAULT_BUS = i2c0;
37 #elif CONFIG_MPU_SPI
38 typedef SPI_t mpu_bus_t;
39 typedef spi_device_handle_t mpu_addr_handle_t;
40 static constexpr mpu_bus_t& MPU_DEFAULT_BUS = hspi;
41 static constexpr mpu_addr_handle_t MPU_DEFAULT_ADDR_HANDLE = nullptr;
42 #endif
43 
44 #if defined CONFIG_MPU6050
45 static constexpr uint16_t SAMPLE_RATE_MAX = 8000;
46 #elif defined CONFIG_MPU6500
47 static constexpr uint16_t SAMPLE_RATE_MAX = 32000;
48 #endif
49 
51 typedef enum {
56 } gyro_fs_t;
57 
59 typedef enum {
64 } accel_fs_t;
65 
67 typedef enum {
70  DLPF_98HZ = 2,
71  DLPF_42HZ = 3,
72  DLPF_20HZ = 4,
73  DLPF_10HZ = 5,
74  DLPF_5HZ = 6,
75 #ifdef CONFIG_MPU6050
77 #elif CONFIG_MPU6500
78  DLPF_3600HZ_NOLPF = 7
79 #endif
80 } dlpf_t;
81 
83 typedef enum {
85  CLOCK_PLL = 3,
86 #if defined CONFIG_MPU6050
89 #endif
91 } clock_src_t;
92 
93 #ifdef CONFIG_MPU6500
94 
95 typedef enum {
96  FCHOICE_0 = 0,
97  FCHOICE_1 = 1,
98  FCHOICE_2 = 2,
100 } fchoice_t;
101 #endif
102 
104 typedef enum {
105 #if defined CONFIG_MPU6000 || defined CONFIG_MPU6050 || defined CONFIG_MPU9150
110 #elif defined CONFIG_MPU6500 || defined CONFIG_MPU9250
111  LP_ACCEL_RATE_0_24HZ = 0,
123 #endif
125 
127 typedef enum {
136 } accel_dhpf_t;
137 
138 #if defined CONFIG_MPU6000 || defined CONFIG_MPU6050 || defined CONFIG_MPU9150
139 
140 typedef enum {
145 } mot_counter_t;
146 #endif
147 
149 typedef struct {
150  uint8_t threshold;
153 #if defined CONFIG_MPU6000 || defined CONFIG_MPU6050 || defined CONFIG_MPU9150
154  uint8_t time;
156  uint8_t accel_on_delay :2;
161  mot_counter_t counter :2;
162 #endif
163 } mot_config_t;
164 
165 #if defined CONFIG_MPU6000 || defined CONFIG_MPU6050 || defined CONFIG_MPU9150
166 
167 typedef struct {
168  uint8_t threshold;
169  uint8_t time;
172 #endif
173 
174 #if defined CONFIG_MPU6000 || defined CONFIG_MPU6050 || defined CONFIG_MPU9150
175 
176 typedef struct {
177  uint8_t threshold;
178  uint8_t time;
180  uint8_t accel_on_delay :2;
185  mot_counter_t counter :2;
186 } ff_config_t;
187 #endif
188 
189 #if defined CONFIG_MPU6000 || defined CONFIG_MPU6050 || defined CONFIG_MPU9150
190 
191 typedef uint8_t mot_stat_t;
199 #endif
200 
202 typedef uint8_t stby_en_t;
203 static constexpr stby_en_t STBY_EN_NONE{0x0};
212 static constexpr stby_en_t STBY_EN_TEMP{1 << 6};
215 static constexpr stby_en_t STBY_EN_LOWPWR_GYRO_PLL_ON{1 << 7};
216 
218 typedef enum {
236 
238 typedef enum {
242 
248 typedef enum {
253 } auxi2c_slv_t;
254 
256 typedef enum {
259 } auxi2c_rw_t;
260 
268 typedef enum {
273 } auxi2c_eow_t;
274 
276 typedef struct {
277  auxi2c_clock_t clock :4;
278  bool multi_master_en :1;
279  uint8_t sample_delay :5;
285  bool shadow_delay_en :1;
286  bool wait_for_es :1;
288  auxi2c_trans_t transition :1;
291 
307 typedef struct {
309  uint8_t addr :7;
310  auxi2c_rw_t rw :1;
311  uint8_t reg_addr;
312  bool reg_dis :1;
314  bool sample_delay_en :1;
315  union {
316  // when reading
317  struct {
318  bool swap_en :1;
319  auxi2c_eow_t end_of_word :1;
321  uint8_t rxlength :4;
322  };
323  // when writing
324  uint8_t txdata;
325  };
326 } auxi2c_slv_config_t;
327 
328 
330 typedef uint8_t auxi2c_stat_t;
339 
340 #if defined CONFIG_MPU9150 || (defined CONFIG_MPU6050 && !defined CONFIG_MPU6000)
341 
342 typedef enum {
346 #endif
347 
349 typedef enum {
352 } int_lvl_t;
353 
355 typedef enum {
358 } int_drive_t;
359 
361 typedef enum {
364 } int_mode_t;
365 
367 typedef enum {
370 } int_clear_t;
371 
373 typedef struct {
374  int_lvl_t level :1;
375  int_drive_t drive :1;
376  int_mode_t mode :1;
377  int_clear_t clear :1;
378 } int_config_t;
379 
384 typedef uint8_t int_en_t;
385 static constexpr int_en_t INT_EN_NONE{0x0};
388 static constexpr int_en_t INT_EN_I2C_MST_FSYNC{1 << regs::INT_ENABLE_I2C_MST_FSYNC_BIT}; // int from I2C_MST_STATUS
392 #if defined CONFIG_MPU6000 || defined CONFIG_MPU6050 || defined CONFIG_MPU9150
395 #endif
396 
401 typedef uint8_t int_stat_t;
404 static constexpr int_stat_t INT_STAT_I2C_MST_FSYNC{1 << regs::INT_STATUS_I2C_MST_BIT}; // int from I2C_MST_STATUS
408 #if defined CONFIG_MPU6000 || defined CONFIG_MPU6050 || defined CONFIG_MPU9150
411 #endif
412 
413 #ifdef CONFIG_MPU6500
414 
415 typedef enum {
420 } fifo_size_t;
421 #endif
422 
424 typedef enum {
428 
430 typedef enum {
433 } fifo_mode_t;
434 
436 typedef uint16_t fifo_config_t;
437 static constexpr fifo_config_t FIFO_CFG_NONE{0x0};
438 static constexpr fifo_config_t FIFO_CFG_GYRO{
445 static constexpr fifo_config_t FIFO_CFG_SLAVE3{1 << 8};
446 #if defined CONFIG_MPU_AK89xx
447 static constexpr fifo_config_t FIFO_CFG_COMPASS{FIFO_CFG_SLAVE0}; // 8 bytes
448 #endif
449 
450 // Enable DMP features
451 /* @note DMP_FEATURE_LP_QUAT and DMP_FEATURE_6X_LP_QUAT are mutually exclusive.
452  * @note DMP_FEATURE_SEND_RAW_GYRO and DMP_FEATURE_SEND_CAL_GYRO are also
453  * mutually exclusive.
454  * @note DMP_FEATURE_PEDOMETER is always enabled.
455  */
456 
457 /* typedef uint16_t dmp_features_t;
458 static constexpr dmp_features_t DMP_FEATURE_TAP = {0x001};
459 static constexpr dmp_features_t DMP_FEATURE_ANDROID_ORIENT = {0x002};
460 static constexpr dmp_features_t DMP_FEATURE_LP_QUAT = {0x004};
461 static constexpr dmp_features_t DMP_FEATURE_PEDOMETER = {0x008};
462 static constexpr dmp_features_t DMP_FEATURE_6X_LP_QUAT = {0x010};
463 static constexpr dmp_features_t DMP_FEATURE_GYRO_CAL = {0x020};
464 static constexpr dmp_features_t DMP_FEATURE_SEND_RAW_ACCEL = {0x040};
465 static constexpr dmp_features_t DMP_FEATURE_SEND_RAW_GYRO = {0x080};
466 static constexpr dmp_features_t DMP_FEATURE_SEND_CAL_GYRO = {0x100};
467 
468 // DMP Tap axes
469 typedef uint8_t dmp_tap_axis_t;
470 static constexpr dmp_tap_axis_t DMP_TAP_X {0x30};
471 static constexpr dmp_tap_axis_t DMP_TAP_Y {0x0C};
472 static constexpr dmp_tap_axis_t DMP_TAP_Z {0x03};
473 static constexpr dmp_tap_axis_t DMP_TAP_XYZ {0x3F};
474  */
475 
477 template<class type_t>
478 struct axes_t {
479  union {
480  type_t xyz[3] = {0};
481  struct {
482  type_t x;
483  type_t y;
484  type_t z;
485  };
486  };
487  type_t& operator[](int i) {
488  return xyz[i];
489  }
490 };
491 // Ready-to-use axes types
494 
496 typedef struct {
499  int16_t temp;
500  uint8_t* extsens;
501 #if defined CONFIG_MPU_AK89xx
503 #endif
504 } sensors_t;
505 
506 
507 // ============
508 // MAGNETOMETER
509 // ============
510 #ifdef CONFIG_MPU_AK89xx
511 static constexpr uint8_t COMPASS_I2CADDRESS = 0xC;
512 static constexpr uint8_t COMPASS_SAMPLE_RATE_MAX = 100; // 100 Hz
513 
515 typedef enum {
520 #ifdef CONFIG_MPU_AK8963
524 #endif
525 } mag_mode_t;
526 
528 typedef uint8_t mag_stat1_t;
530 #ifdef CONFIG_MPU_AK8963
532 #endif
533 
535 typedef uint8_t mag_stat2_t;
537 #ifdef CONFIG_MPU_AK8963
539 #elif CONFIG_MPU_AK8975
541 #endif
542 
543 #ifdef CONFIG_MPU_AK8963
544 
545 typedef enum {
548 } mag_sensy_t;
549 #endif
550 
551 // Auxiliary I2C slaves that operate the Magnetometer (do not change)
552 static constexpr auxi2c_slv_t MAG_SLAVE_READ_DATA = AUXI2C_SLAVE_0; // read measurement data
553 static constexpr auxi2c_slv_t MAG_SLAVE_CHG_MODE = AUXI2C_SLAVE_1; // change mode to single measure
554 
555 static constexpr uint8_t MAG_DATA_LENGTH = 8; // bytes
556 
557 #endif // end of Magnetometer stuff
558 
560 typedef uint8_t selftest_t;
561 static constexpr selftest_t SELF_TEST_PASS{0x0};
562 static constexpr selftest_t SELF_TEST_GYRO_FAIL{1 << 0}; // 0x1
563 static constexpr selftest_t SELF_TEST_ACCEL_FAIL{1 << 1}; // 0x2
564 
565 } // namespace types
566 
567 } // namespace mpud
568 
569 #endif /* end of include guard: _MPU_TYPES_HPP_ */
static constexpr stby_en_t STBY_EN_LOWPWR_GYRO_PLL_ON
This is a low power mode that allows quick enabling of the gyros.
Definition: types.hpp:215
static constexpr mot_stat_t MOT_STAT_XPOS
Definition: types.hpp:193
Definition: types.hpp:27
gyro_fs_t
Gyroscope full-scale range.
Definition: types.hpp:51
Auxiliary I2C Master configuration struct.
Definition: types.hpp:276
uint8_t time
Duration in milliseconds that the accel data must exceed the threshold before motion is reported...
Definition: types.hpp:154
constexpr uint8_t I2CMST_STAT_SLV4_NACK_BIT
Definition: registers.hpp:126
+/- 2000 º/s -> 16.4 LSB/(º/s)
Definition: types.hpp:55
Definition: types.hpp:220
static constexpr int_en_t INT_EN_FIFO_OVERFLOW
Definition: types.hpp:387
raw_axes_t accel
accelerometer
Definition: types.hpp:497
mag_mode_t
Magnetometer operation modes.
Definition: types.hpp:515
+/- 2 g -> 16.384 LSB/g
Definition: types.hpp:60
Definition: types.hpp:119
Definition: types.hpp:257
uint8_t auxi2c_stat_t
Auxiliary I2C master status register data.
Definition: types.hpp:330
Definition: types.hpp:109
Indicates slave register addresses 0 and 1 are grouped together (odd numbered register ends the word)...
Definition: types.hpp:269
constexpr uint8_t I2CMST_STAT_SLV2_NACK_BIT
Definition: registers.hpp:128
constexpr uint8_t I2CMST_STAT_LOST_ARB_BIT
Definition: registers.hpp:125
uint8_t mag_stat1_t
Magnetometer sensor status 1.
Definition: types.hpp:528
mpu_i2caddr_t mpu_addr_handle_t
MPU Address/Handle type, mpu_i2caddr_t or spi_device_handle_t
Definition: types.hpp:34
constexpr uint8_t INT_STATUS_RAW_DATA_RDY_BIT
Definition: registers.hpp:168
static constexpr uint8_t MAG_DATA_LENGTH
Definition: types.hpp:555
fifo_size_t
MPU6500 Fifo size.
Definition: types.hpp:415
int_mode_t
Interrupt mode.
Definition: types.hpp:361
ON state, the high pass filter will pass signals above the cut off frequency.
Definition: types.hpp:130
Definition: types.hpp:69
Definition: types.hpp:249
auxi2c_slv_t slave
Slave slot.
Definition: types.hpp:308
static constexpr mot_stat_t MOT_STAT_ZEROMOTION
Definition: types.hpp:198
This effectively disables the high pass filter.
Definition: types.hpp:128
static constexpr auxi2c_stat_t AUXI2C_STAT_SLV2_NACK
Definition: types.hpp:336
ON state, the high pass filter will pass signals above the cut off frequency.
Definition: types.hpp:133
static constexpr mag_stat1_t MAG_STAT1_DATA_OVERRUN
Definition: types.hpp:531
Definition: types.hpp:250
static constexpr mot_stat_t MOT_STAT_YPOS
Definition: types.hpp:195
Definition: types.hpp:351
static constexpr uint8_t COMPASS_I2CADDRESS
Definition: types.hpp:511
constexpr uint8_t INT_STATUS_MOTION_BIT
Definition: registers.hpp:162
Selects automatically best pll source (recommended)
Definition: types.hpp:85
constexpr uint8_t FIFO_ACCEL_EN_BIT
Definition: registers.hpp:72
constexpr uint8_t INT_STATUS_ZEROMOT_BIT
Definition: registers.hpp:163
constexpr uint8_t PWR2_STBY_YG_BIT
Definition: registers.hpp:252
static constexpr int_en_t INT_EN_FREE_FALL
Definition: types.hpp:393
int16_t temp
temperature
Definition: types.hpp:499
constexpr uint8_t FIFO_TEMP_EN_BIT
Definition: registers.hpp:68
constexpr uint8_t FIFO_XGYRO_EN_BIT
Definition: registers.hpp:69
constexpr uint8_t INT_STATUS_PLL_RDY_BIT
Definition: registers.hpp:166
constexpr uint8_t FIFO_SLV_2_EN_BIT
Definition: registers.hpp:73
lp_accel_rate_t
Low-Power Accelerometer wake-up rates.
Definition: types.hpp:104
static constexpr stby_en_t STBY_EN_ACCEL
Definition: types.hpp:207
Generic axes struct to store sensors' data.
Definition: types.hpp:478
Definition: types.hpp:426
+/- 1000 º/s -> 32.8 LSB/(º/s)
Definition: types.hpp:54
constexpr uint8_t STATUS1_DATA_OVERRUN_BIT
Definition: registers.hpp:407
fifo_mode_t
FIFO mode.
Definition: types.hpp:430
Definition: types.hpp:356
accel_dhpf_t
Accelerometer Digital High Pass Filter (only for motion detection modules)
Definition: types.hpp:127
Definition: types.hpp:419
static constexpr mpu_i2caddr_t MPU_DEFAULT_I2CADDRESS
Definition: types.hpp:30
static constexpr auxi2c_stat_t AUXI2C_STAT_SLV4_DONE
Definition: types.hpp:333
mag_sensy_t
Magnetometer sensitivity.
Definition: types.hpp:545
Definition: types.hpp:240
Definition: types.hpp:521
When set, any non-qualifying sample will reset the corresponding counter to 0.
Definition: types.hpp:141
static constexpr fifo_config_t FIFO_CFG_SLAVE0
Definition: types.hpp:442
Interrupt configuration struct.
Definition: types.hpp:373
Definition: types.hpp:517
Definition: types.hpp:222
+/- 250 º/s -> 131 LSB/(º/s)
Definition: types.hpp:52
constexpr uint8_t INT_STATUS_FIFO_OFLOW_BIT
Definition: registers.hpp:164
Definition: types.hpp:516
dlpf_t
Digital low-pass filter (based on gyro bandwidth)
Definition: types.hpp:67
static constexpr stby_en_t STBY_EN_GYRO_Y
Definition: types.hpp:209
constexpr uint8_t MOT_STATUS_X_POS_BIT
Definition: registers.hpp:301
PLL with external 32.768kHz reference.
Definition: types.hpp:87
static constexpr stby_en_t STBY_EN_NONE
Definition: types.hpp:203
static constexpr uint16_t SAMPLE_RATE_MAX
Definition: types.hpp:45
Definition: types.hpp:417
type_t z
Definition: types.hpp:484
type_t & operator[](int i)
Definition: types.hpp:487
uint8_t mag_stat2_t
Magnetometer sensor status 2.
Definition: types.hpp:535
Definition: types.hpp:118
raw_axes_t mag
magnetometer
Definition: types.hpp:502
fchoice_t
Fchoice (Frequency choice maybe ?) [MPU6500 and MPU9250 only].
Definition: types.hpp:95
static constexpr int_stat_t INT_STAT_DMP_READY
Definition: types.hpp:406
Definition: types.hpp:73
static constexpr int_stat_t INT_STAT_FREE_FALL
Definition: types.hpp:409
static constexpr stby_en_t STBY_EN_GYRO_X
Definition: types.hpp:208
Definition: types.hpp:97
constexpr uint8_t STATUS1_DATA_RDY_BIT
Definition: registers.hpp:367
ON state, the high pass filter will pass signals above the cut off frequency.
Definition: types.hpp:132
uint8_t int_stat_t
Interrupt Status.
Definition: types.hpp:401
uint8_t * extsens
external sensor buffer
Definition: types.hpp:500
static constexpr mot_stat_t MOT_STAT_YNEG
Definition: types.hpp:194
Definition: types.hpp:223
static constexpr stby_en_t STBY_EN_ACCEL_Y
Definition: types.hpp:205
Zero-motion configuration.
Definition: types.hpp:167
type_t y
Definition: types.hpp:483
dmp_int_mode_t
DMP Interrupt mode.
Definition: types.hpp:424
constexpr uint8_t STATUS2_BIT_OUTPUT_M_BIT
Definition: registers.hpp:408
Definition: types.hpp:219
constexpr uint8_t PWR2_STBY_XA_BIT
Definition: registers.hpp:248
constexpr uint8_t FIFO_SLV_0_EN_BIT
Definition: registers.hpp:75
static constexpr int_en_t INT_EN_I2C_MST_FSYNC
Definition: types.hpp:388
constexpr uint8_t INT_STATUS_FREEFALL_BIT
Definition: registers.hpp:161
constexpr uint8_t PWR2_STBY_ZG_BIT
Definition: registers.hpp:253
Definition: types.hpp:350
accel_fs_t
Accel full-scale range.
Definition: types.hpp:59
+/- 4 g -> 8.192 LSB/g
Definition: types.hpp:61
constexpr uint8_t MOT_STATUS_ZRMOT_BIT
Definition: registers.hpp:306
type_t x
Definition: types.hpp:482
uint8_t selftest_t
Self-Test results.
Definition: types.hpp:560
Definition: types.hpp:28
Decrement counter in 4.
Definition: types.hpp:144
uint8_t int_en_t
Enable features to generate signal at Interrupt pin.
Definition: types.hpp:384
Definition: types.hpp:233
static constexpr selftest_t SELF_TEST_PASS
Definition: types.hpp:561
Definition: types.hpp:368
static constexpr int_en_t INT_EN_MOTION_DETECT
Definition: types.hpp:386
static constexpr int_en_t INT_EN_NONE
Definition: types.hpp:385
static constexpr int_stat_t INT_STAT_ZERO_MOTION
Definition: types.hpp:410
uint8_t time
Duration in milliseconds that the accel data must exceed the threshold before motion is reported...
Definition: types.hpp:178
Definition: types.hpp:363
static constexpr int_stat_t INT_STAT_PLL_READY
Definition: types.hpp:405
Definition: types.hpp:227
static constexpr auxi2c_stat_t AUXI2C_STAT_LOST_ARB
Definition: types.hpp:332
Sensors struct for fast reading all sensors at once.
Definition: types.hpp:496
static constexpr fifo_config_t FIFO_CFG_TEMPERATURE
Definition: types.hpp:441
Definition: types.hpp:344
static constexpr uint8_t COMPASS_SAMPLE_RATE_MAX
Definition: types.hpp:512
axes_t< float > float_axes_t
Axes type to hold converted sensor data.
Definition: types.hpp:493
Definition: types.hpp:224
constexpr uint8_t I2CMST_STAT_PASS_THROUGH_BIT
Definition: registers.hpp:123
static constexpr fifo_config_t FIFO_CFG_NONE
Definition: types.hpp:437
uint8_t threshold
Motion threshold in LSB.
Definition: types.hpp:168
constexpr uint8_t INT_ENABLE_DMP_RDY_BIT
Definition: registers.hpp:149
static constexpr int_stat_t INT_STAT_RAWDATA_READY
Definition: types.hpp:407
constexpr uint8_t INT_STATUS_DMP_RDY_BIT
Definition: registers.hpp:167
constexpr uint8_t MOT_STATUS_Y_POS_BIT
Definition: registers.hpp:303
static constexpr mpu_addr_handle_t MPU_DEFAULT_ADDR_HANDLE
Definition: types.hpp:36
Definition: types.hpp:221
constexpr uint8_t PWR2_STBY_XG_BIT
Definition: registers.hpp:251
0.6 uT/LSB = 14-bit output
Definition: types.hpp:546
uint8_t threshold
Motion threshold in LSB.
Definition: types.hpp:177
clock_src_t
Clock Source.
Definition: types.hpp:83
static constexpr fifo_config_t FIFO_CFG_SLAVE3
Definition: types.hpp:445
type_t xyz[3]
Definition: types.hpp:480
constexpr uint8_t INT_ENABLE_RAW_DATA_RDY_BIT
Definition: registers.hpp:150
Definition: types.hpp:230
static constexpr mot_stat_t MOT_STAT_ZPOS
Definition: types.hpp:197
Definition: types.hpp:108
Internal oscillator: 20MHz for MPU6500 and 8MHz for MPU6050.
Definition: types.hpp:84
+/- 16 g -> 2.048 LSB/g
Definition: types.hpp:63
static constexpr auxi2c_slv_t MAG_SLAVE_READ_DATA
Definition: types.hpp:552
static constexpr auxi2c_stat_t AUXI2C_STAT_SLV3_NACK
Definition: types.hpp:335
constexpr uint8_t INT_STATUS_I2C_MST_BIT
Definition: registers.hpp:165
static constexpr mpu_bus_t & MPU_DEFAULT_BUS
Definition: types.hpp:35
int_drive_t
Interrupt drive state.
Definition: types.hpp:355
Definition: types.hpp:226
constexpr uint8_t I2CMST_STAT_SLV3_NACK_BIT
Definition: registers.hpp:127
PLL with external 19.2MHz reference.
Definition: types.hpp:88
constexpr uint8_t I2CMST_STAT_SLV4_DONE_BIT
Definition: registers.hpp:124
constexpr uint8_t INT_ENABLE_FIFO_OFLOW_BIT
Definition: registers.hpp:146
constexpr uint8_t MOT_STATUS_Y_NEG_BIT
Definition: registers.hpp:302
Definition: types.hpp:229
static constexpr int_stat_t INT_STAT_MOTION_DETECT
Definition: types.hpp:402
Definition: types.hpp:96
static constexpr mot_stat_t MOT_STAT_ZNEG
Definition: types.hpp:196
axes_t< int16_t > raw_axes_t
Axes type to hold gyroscope, accelerometer, magnetometer raw data.
Definition: types.hpp:492
uint8_t mot_stat_t
Motion Detection Status (MPU6000, MPU6050, MPU9150)
Definition: types.hpp:191
constexpr uint8_t MOT_STATUS_Z_NEG_BIT
Definition: registers.hpp:304
Definition: types.hpp:115
static constexpr int_en_t INT_EN_RAWDATA_READY
Definition: types.hpp:391
ON state, the high pass filter will pass signals above the cut off frequency.
Definition: types.hpp:131
constexpr uint8_t MOT_STATUS_Z_POS_BIT
Definition: registers.hpp:305
Definition: types.hpp:369
Definition: types.hpp:231
Decrement counter in 1.
Definition: types.hpp:142
static constexpr auxi2c_stat_t AUXI2C_STAT_SLV4_NACK
Definition: types.hpp:334
static constexpr stby_en_t STBY_EN_GYRO
Definition: types.hpp:211
Definition: types.hpp:228
auxi2c_rw_t
Auxiliary I2C operation.
Definition: types.hpp:256
Definition: types.hpp:70
static constexpr auxi2c_slv_t MAG_SLAVE_CHG_MODE
Definition: types.hpp:553
Definition: types.hpp:116
static constexpr int_stat_t INT_STAT_FIFO_OVERFLOW
Definition: types.hpp:403
static constexpr selftest_t SELF_TEST_ACCEL_FAIL
Definition: types.hpp:563
mot_counter_t
Motion Detection counter decrement rate (Motion and FreeFall)
Definition: types.hpp:140
Definition: types.hpp:99
auxi2c_slv_t
Auxiliary I2C Slaves slots.
Definition: types.hpp:248
Definition: types.hpp:71
Stops the clock and keeps timing generator in reset.
Definition: types.hpp:90
+/- 8 g -> 4.096 LSB/g
Definition: types.hpp:62
Definition: types.hpp:112
Definition: types.hpp:107
Definition: types.hpp:106
static constexpr fifo_config_t FIFO_CFG_SLAVE1
Definition: types.hpp:443
I2C_t mpu_bus_t
Communication bus type, I2Cbus or SPIbus.
Definition: types.hpp:33
constexpr uint8_t INT_ENABLE_ZEROMOT_BIT
Definition: registers.hpp:145
static constexpr fifo_config_t FIFO_CFG_COMPASS
Definition: types.hpp:447
uint8_t stby_en_t
Standby Mode.
Definition: types.hpp:202
0.15 uT/LSB = 16-bit output
Definition: types.hpp:547
Definition: types.hpp:518
Motion Detection configuration.
Definition: types.hpp:149
Define registers' for all MPU models.
uint8_t txdata
Data to transfer when slave is set to write.
Definition: types.hpp:324
constexpr uint8_t STATUS2_DATA_ERROR_BIT
Definition: registers.hpp:400
int_lvl_t
Interrupt active level.
Definition: types.hpp:349
static constexpr stby_en_t STBY_EN_TEMP
Definition: types.hpp:212
constexpr uint8_t FIFO_YGYRO_EN_BIT
Definition: registers.hpp:70
auxvddio_lvl_t
Auxiliary I2C bus VDDIO level [MPU6050 / MPU9150 only].
Definition: types.hpp:342
constexpr uint8_t PWR2_STBY_ZA_BIT
Definition: registers.hpp:250
Definition: types.hpp:343
Definition: types.hpp:113
Definition: types.hpp:362
Indicates slave register addresses 1 and 2 are grouped together (even numbered register ends the word...
Definition: types.hpp:271
static constexpr mag_stat2_t MAG_STAT2_DATA_ERROR
Definition: types.hpp:540
constexpr uint8_t INT_ENABLE_PLL_RDY_BIT
Definition: registers.hpp:148
static constexpr fifo_config_t FIFO_CFG_ACCEL
Definition: types.hpp:440
Definition: types.hpp:425
constexpr uint8_t INT_ENABLE_I2C_MST_FSYNC_BIT
Definition: registers.hpp:147
Definition: types.hpp:239
constexpr uint8_t FIFO_ZGYRO_EN_BIT
Definition: registers.hpp:71
when fifo full, additional writes will not be written to fifo.
Definition: types.hpp:432
static constexpr fifo_config_t FIFO_CFG_SLAVE2
Definition: types.hpp:444
Definition: types.hpp:98
static constexpr mag_stat2_t MAG_STAT2_SENSOR_OVERFLOW
Definition: types.hpp:536
Definition: types.hpp:519
auxi2c_eow_t
Auxiliary I2C, EOW = end of word, use for swap.
Definition: types.hpp:268
Definition: types.hpp:234
static constexpr selftest_t SELF_TEST_GYRO_FAIL
Definition: types.hpp:562
Decrement counter in 2.
Definition: types.hpp:143
Definition: types.hpp:76
Definition: types.hpp:120
static constexpr stby_en_t STBY_EN_ACCEL_X
Definition: types.hpp:204
Definition: types.hpp:122
Definition: types.hpp:117
constexpr uint8_t STATUS2_OVERFLOW_BIT
Definition: registers.hpp:377
Definition: types.hpp:72
static constexpr mag_stat2_t MAG_STAT2_BIT_OUTPUT_SETTING
Definition: types.hpp:538
static constexpr auxi2c_stat_t AUXI2C_STAT_FSYNC
Definition: types.hpp:331
+/- 500 º/s -> 65.5 LSB/(º/s)
Definition: types.hpp:53
static constexpr stby_en_t STBY_EN_ACCEL_Z
Definition: types.hpp:206
auxi2c_clock_t
Auxiliary I2C Master clock speed.
Definition: types.hpp:218
mpu_i2caddr_t
MPU's possible I2C slave addresses.
Definition: types.hpp:26
Definition: types.hpp:258
Definition: types.hpp:74
static constexpr auxi2c_stat_t AUXI2C_STAT_SLV0_NACK
Definition: types.hpp:338
The filter holds the present sample.
Definition: types.hpp:134
Definition: types.hpp:232
Definition: types.hpp:418
Definition: types.hpp:225
raw_axes_t gyro
gyroscope
Definition: types.hpp:498
static constexpr int_en_t INT_EN_PLL_READY
Definition: types.hpp:389
Definition: types.hpp:121
uint16_t fifo_config_t
FIFO configuration, enable sensors to be written to FIFO.
Definition: types.hpp:436
static constexpr int_en_t INT_EN_DMP_READY
Definition: types.hpp:390
constexpr uint8_t PWR2_STBY_YA_BIT
Definition: registers.hpp:249
constexpr uint8_t INT_ENABLE_MOTION_BIT
Definition: registers.hpp:144
Definition: types.hpp:357
constexpr uint8_t I2CMST_STAT_SLV0_NACK_BIT
Definition: registers.hpp:130
Free-fall configuration.
Definition: types.hpp:176
static constexpr stby_en_t STBY_EN_GYRO_Z
Definition: types.hpp:210
static constexpr auxi2c_stat_t AUXI2C_STAT_SLV1_NACK
Definition: types.hpp:337
static constexpr mot_stat_t MOT_STAT_XNEG
Definition: types.hpp:192
constexpr uint8_t I2CMST_STAT_SLV1_NACK_BIT
Definition: registers.hpp:129
constexpr uint8_t MOT_STATUS_X_NEG_BIT
Definition: registers.hpp:300
static constexpr mag_stat1_t MAG_STAT1_DATA_RDY
Definition: types.hpp:529
uint8_t threshold
Motion threshold in LSB.
Definition: types.hpp:150
Definition: types.hpp:416
Definition: types.hpp:252
Definition: types.hpp:251
constexpr uint8_t FIFO_SLV_1_EN_BIT
Definition: registers.hpp:74
static constexpr int_en_t INT_EN_ZERO_MOTION
Definition: types.hpp:394
when fifo full, additional writes will be written to fifo, replacing the oldest data.
Definition: types.hpp:431
Definition: types.hpp:68
int_clear_t
Interrupt clear mode.
Definition: types.hpp:367
static constexpr fifo_config_t FIFO_CFG_GYRO
Definition: types.hpp:438
static constexpr int_stat_t INT_STAT_I2C_MST_FSYNC
Definition: types.hpp:404
uint8_t time
Duration in milliseconds that the accel data must exceed the threshold before motion is reported...
Definition: types.hpp:169
Definition: types.hpp:114
auxi2c_trans_t
Auxiliary I2C Master’s transition from one slave read to the next slave read.
Definition: types.hpp:238
uint8_t reg_addr
Register address to read/write to.
Definition: types.hpp:311
constexpr uint8_t INT_ENABLE_FREEFALL_BIT
Definition: registers.hpp:143