Initial Commit

Dependencies:   mbed HC05 QEI MODSERIAL SWSPI mbed-rtos

Committer:
harshb
Date:
Tue Oct 21 21:59:15 2014 +0000
Revision:
6:5ab1735265a9
Parent:
1:1da89c13dfa1
Initial Commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Throwbot 1:1da89c13dfa1 1 //ported from arduino library: https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050
Throwbot 1:1da89c13dfa1 2 //written by szymon gaertig (email: szymon@gaertig.com.pl)
Throwbot 1:1da89c13dfa1 3 //
Throwbot 1:1da89c13dfa1 4 //Changelog:
Throwbot 1:1da89c13dfa1 5 //2013-01-08 - first beta release
Throwbot 1:1da89c13dfa1 6
Throwbot 1:1da89c13dfa1 7 // I2Cdev library collection - MPU6050 I2C device class
Throwbot 1:1da89c13dfa1 8 // Based on InvenSense MPU-6050 register map document rev. 2.0, 5/19/2011 (RM-MPU-6000A-00)
Throwbot 1:1da89c13dfa1 9 // 10/3/2011 by Jeff Rowberg <jeff@rowberg.net>
Throwbot 1:1da89c13dfa1 10 // Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
Throwbot 1:1da89c13dfa1 11 //
Throwbot 1:1da89c13dfa1 12 // Changelog:
Throwbot 1:1da89c13dfa1 13 // ... - ongoing debug release
Throwbot 1:1da89c13dfa1 14
Throwbot 1:1da89c13dfa1 15 // NOTE: THIS IS ONLY A PARIAL RELEASE. THIS DEVICE CLASS IS CURRENTLY UNDERGOING ACTIVE
Throwbot 1:1da89c13dfa1 16 // DEVELOPMENT AND IS STILL MISSING SOME IMPORTANT FEATURES. PLEASE KEEP THIS IN MIND IF
Throwbot 1:1da89c13dfa1 17 // YOU DECIDE TO USE THIS PARTICULAR CODE FOR ANYTHING.
Throwbot 1:1da89c13dfa1 18
Throwbot 1:1da89c13dfa1 19 /* ============================================
Throwbot 1:1da89c13dfa1 20 I2Cdev device library code is placed under the MIT license
Throwbot 1:1da89c13dfa1 21 Copyright (c) 2012 Jeff Rowberg
Throwbot 1:1da89c13dfa1 22
Throwbot 1:1da89c13dfa1 23 Permission is hereby granted, free of charge, to any person obtaining a copy
Throwbot 1:1da89c13dfa1 24 of this software and associated documentation files (the "Software"), to deal
Throwbot 1:1da89c13dfa1 25 in the Software without restriction, including without limitation the rights
Throwbot 1:1da89c13dfa1 26 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Throwbot 1:1da89c13dfa1 27 copies of the Software, and to permit persons to whom the Software is
Throwbot 1:1da89c13dfa1 28 furnished to do so, subject to the following conditions:
Throwbot 1:1da89c13dfa1 29
Throwbot 1:1da89c13dfa1 30 The above copyright notice and this permission notice shall be included in
Throwbot 1:1da89c13dfa1 31 all copies or substantial portions of the Software.
Throwbot 1:1da89c13dfa1 32
Throwbot 1:1da89c13dfa1 33 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Throwbot 1:1da89c13dfa1 34 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Throwbot 1:1da89c13dfa1 35 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Throwbot 1:1da89c13dfa1 36 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Throwbot 1:1da89c13dfa1 37 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Throwbot 1:1da89c13dfa1 38 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Throwbot 1:1da89c13dfa1 39 THE SOFTWARE.
Throwbot 1:1da89c13dfa1 40 ===============================================
Throwbot 1:1da89c13dfa1 41 */
Throwbot 1:1da89c13dfa1 42
Throwbot 1:1da89c13dfa1 43 #ifndef _MPU6050_H_
Throwbot 1:1da89c13dfa1 44 #define _MPU6050_H_
Throwbot 1:1da89c13dfa1 45
Throwbot 1:1da89c13dfa1 46 #include "I2Cdev.h"
Throwbot 1:1da89c13dfa1 47 #include "helper_3dmath.h"
Throwbot 1:1da89c13dfa1 48
Throwbot 1:1da89c13dfa1 49 #define MPU6050_ADDRESS_AD0_LOW 0x68 // address pin low (GND), default for InvenSense evaluation board
Throwbot 1:1da89c13dfa1 50 #define MPU6050_ADDRESS_AD0_HIGH 0x69 // address pin high (VCC)
Throwbot 1:1da89c13dfa1 51 #define MPU6050_DEFAULT_ADDRESS MPU6050_ADDRESS_AD0_LOW
Throwbot 1:1da89c13dfa1 52
Throwbot 1:1da89c13dfa1 53 #define MPU6050_RA_XG_OFFS_TC 0x00 //[7] PWR_MODE, [6:1] XG_OFFS_TC, [0] OTP_BNK_VLD
Throwbot 1:1da89c13dfa1 54 #define MPU6050_RA_YG_OFFS_TC 0x01 //[7] PWR_MODE, [6:1] YG_OFFS_TC, [0] OTP_BNK_VLD
Throwbot 1:1da89c13dfa1 55 #define MPU6050_RA_ZG_OFFS_TC 0x02 //[7] PWR_MODE, [6:1] ZG_OFFS_TC, [0] OTP_BNK_VLD
Throwbot 1:1da89c13dfa1 56 #define MPU6050_RA_X_FINE_GAIN 0x03 //[7:0] X_FINE_GAIN
Throwbot 1:1da89c13dfa1 57 #define MPU6050_RA_Y_FINE_GAIN 0x04 //[7:0] Y_FINE_GAIN
Throwbot 1:1da89c13dfa1 58 #define MPU6050_RA_Z_FINE_GAIN 0x05 //[7:0] Z_FINE_GAIN
Throwbot 1:1da89c13dfa1 59 #define MPU6050_RA_XA_OFFS_H 0x06 //[15:0] XA_OFFS
Throwbot 1:1da89c13dfa1 60 #define MPU6050_RA_XA_OFFS_L_TC 0x07
Throwbot 1:1da89c13dfa1 61 #define MPU6050_RA_YA_OFFS_H 0x08 //[15:0] YA_OFFS
Throwbot 1:1da89c13dfa1 62 #define MPU6050_RA_YA_OFFS_L_TC 0x09
Throwbot 1:1da89c13dfa1 63 #define MPU6050_RA_ZA_OFFS_H 0x0A //[15:0] ZA_OFFS
Throwbot 1:1da89c13dfa1 64 #define MPU6050_RA_ZA_OFFS_L_TC 0x0B
Throwbot 1:1da89c13dfa1 65 #define MPU6050_RA_XG_OFFS_USRH 0x13 //[15:0] XG_OFFS_USR
Throwbot 1:1da89c13dfa1 66 #define MPU6050_RA_XG_OFFS_USRL 0x14
Throwbot 1:1da89c13dfa1 67 #define MPU6050_RA_YG_OFFS_USRH 0x15 //[15:0] YG_OFFS_USR
Throwbot 1:1da89c13dfa1 68 #define MPU6050_RA_YG_OFFS_USRL 0x16
Throwbot 1:1da89c13dfa1 69 #define MPU6050_RA_ZG_OFFS_USRH 0x17 //[15:0] ZG_OFFS_USR
Throwbot 1:1da89c13dfa1 70 #define MPU6050_RA_ZG_OFFS_USRL 0x18
Throwbot 1:1da89c13dfa1 71 #define MPU6050_RA_SMPLRT_DIV 0x19
Throwbot 1:1da89c13dfa1 72 #define MPU6050_RA_CONFIG 0x1A
Throwbot 1:1da89c13dfa1 73 #define MPU6050_RA_GYRO_CONFIG 0x1B
Throwbot 1:1da89c13dfa1 74 #define MPU6050_RA_ACCEL_CONFIG 0x1C
Throwbot 1:1da89c13dfa1 75 #define MPU6050_RA_FF_THR 0x1D
Throwbot 1:1da89c13dfa1 76 #define MPU6050_RA_FF_DUR 0x1E
Throwbot 1:1da89c13dfa1 77 #define MPU6050_RA_MOT_THR 0x1F
Throwbot 1:1da89c13dfa1 78 #define MPU6050_RA_MOT_DUR 0x20
Throwbot 1:1da89c13dfa1 79 #define MPU6050_RA_ZRMOT_THR 0x21
Throwbot 1:1da89c13dfa1 80 #define MPU6050_RA_ZRMOT_DUR 0x22
Throwbot 1:1da89c13dfa1 81 #define MPU6050_RA_FIFO_EN 0x23
Throwbot 1:1da89c13dfa1 82 #define MPU6050_RA_I2C_MST_CTRL 0x24
Throwbot 1:1da89c13dfa1 83 #define MPU6050_RA_I2C_SLV0_ADDR 0x25
Throwbot 1:1da89c13dfa1 84 #define MPU6050_RA_I2C_SLV0_REG 0x26
Throwbot 1:1da89c13dfa1 85 #define MPU6050_RA_I2C_SLV0_CTRL 0x27
Throwbot 1:1da89c13dfa1 86 #define MPU6050_RA_I2C_SLV1_ADDR 0x28
Throwbot 1:1da89c13dfa1 87 #define MPU6050_RA_I2C_SLV1_REG 0x29
Throwbot 1:1da89c13dfa1 88 #define MPU6050_RA_I2C_SLV1_CTRL 0x2A
Throwbot 1:1da89c13dfa1 89 #define MPU6050_RA_I2C_SLV2_ADDR 0x2B
Throwbot 1:1da89c13dfa1 90 #define MPU6050_RA_I2C_SLV2_REG 0x2C
Throwbot 1:1da89c13dfa1 91 #define MPU6050_RA_I2C_SLV2_CTRL 0x2D
Throwbot 1:1da89c13dfa1 92 #define MPU6050_RA_I2C_SLV3_ADDR 0x2E
Throwbot 1:1da89c13dfa1 93 #define MPU6050_RA_I2C_SLV3_REG 0x2F
Throwbot 1:1da89c13dfa1 94 #define MPU6050_RA_I2C_SLV3_CTRL 0x30
Throwbot 1:1da89c13dfa1 95 #define MPU6050_RA_I2C_SLV4_ADDR 0x31
Throwbot 1:1da89c13dfa1 96 #define MPU6050_RA_I2C_SLV4_REG 0x32
Throwbot 1:1da89c13dfa1 97 #define MPU6050_RA_I2C_SLV4_DO 0x33
Throwbot 1:1da89c13dfa1 98 #define MPU6050_RA_I2C_SLV4_CTRL 0x34
Throwbot 1:1da89c13dfa1 99 #define MPU6050_RA_I2C_SLV4_DI 0x35
Throwbot 1:1da89c13dfa1 100 #define MPU6050_RA_I2C_MST_STATUS 0x36
Throwbot 1:1da89c13dfa1 101 #define MPU6050_RA_INT_PIN_CFG 0x37
Throwbot 1:1da89c13dfa1 102 #define MPU6050_RA_INT_ENABLE 0x38
Throwbot 1:1da89c13dfa1 103 #define MPU6050_RA_DMP_INT_STATUS 0x39
Throwbot 1:1da89c13dfa1 104 #define MPU6050_RA_INT_STATUS 0x3A
Throwbot 1:1da89c13dfa1 105 #define MPU6050_RA_ACCEL_XOUT_H 0x3B
Throwbot 1:1da89c13dfa1 106 #define MPU6050_RA_ACCEL_XOUT_L 0x3C
Throwbot 1:1da89c13dfa1 107 #define MPU6050_RA_ACCEL_YOUT_H 0x3D
Throwbot 1:1da89c13dfa1 108 #define MPU6050_RA_ACCEL_YOUT_L 0x3E
Throwbot 1:1da89c13dfa1 109 #define MPU6050_RA_ACCEL_ZOUT_H 0x3F
Throwbot 1:1da89c13dfa1 110 #define MPU6050_RA_ACCEL_ZOUT_L 0x40
Throwbot 1:1da89c13dfa1 111 #define MPU6050_RA_TEMP_OUT_H 0x41
Throwbot 1:1da89c13dfa1 112 #define MPU6050_RA_TEMP_OUT_L 0x42
Throwbot 1:1da89c13dfa1 113 #define MPU6050_RA_GYRO_XOUT_H 0x43
Throwbot 1:1da89c13dfa1 114 #define MPU6050_RA_GYRO_XOUT_L 0x44
Throwbot 1:1da89c13dfa1 115 #define MPU6050_RA_GYRO_YOUT_H 0x45
Throwbot 1:1da89c13dfa1 116 #define MPU6050_RA_GYRO_YOUT_L 0x46
Throwbot 1:1da89c13dfa1 117 #define MPU6050_RA_GYRO_ZOUT_H 0x47
Throwbot 1:1da89c13dfa1 118 #define MPU6050_RA_GYRO_ZOUT_L 0x48
Throwbot 1:1da89c13dfa1 119 #define MPU6050_RA_EXT_SENS_DATA_00 0x49
Throwbot 1:1da89c13dfa1 120 #define MPU6050_RA_EXT_SENS_DATA_01 0x4A
Throwbot 1:1da89c13dfa1 121 #define MPU6050_RA_EXT_SENS_DATA_02 0x4B
Throwbot 1:1da89c13dfa1 122 #define MPU6050_RA_EXT_SENS_DATA_03 0x4C
Throwbot 1:1da89c13dfa1 123 #define MPU6050_RA_EXT_SENS_DATA_04 0x4D
Throwbot 1:1da89c13dfa1 124 #define MPU6050_RA_EXT_SENS_DATA_05 0x4E
Throwbot 1:1da89c13dfa1 125 #define MPU6050_RA_EXT_SENS_DATA_06 0x4F
Throwbot 1:1da89c13dfa1 126 #define MPU6050_RA_EXT_SENS_DATA_07 0x50
Throwbot 1:1da89c13dfa1 127 #define MPU6050_RA_EXT_SENS_DATA_08 0x51
Throwbot 1:1da89c13dfa1 128 #define MPU6050_RA_EXT_SENS_DATA_09 0x52
Throwbot 1:1da89c13dfa1 129 #define MPU6050_RA_EXT_SENS_DATA_10 0x53
Throwbot 1:1da89c13dfa1 130 #define MPU6050_RA_EXT_SENS_DATA_11 0x54
Throwbot 1:1da89c13dfa1 131 #define MPU6050_RA_EXT_SENS_DATA_12 0x55
Throwbot 1:1da89c13dfa1 132 #define MPU6050_RA_EXT_SENS_DATA_13 0x56
Throwbot 1:1da89c13dfa1 133 #define MPU6050_RA_EXT_SENS_DATA_14 0x57
Throwbot 1:1da89c13dfa1 134 #define MPU6050_RA_EXT_SENS_DATA_15 0x58
Throwbot 1:1da89c13dfa1 135 #define MPU6050_RA_EXT_SENS_DATA_16 0x59
Throwbot 1:1da89c13dfa1 136 #define MPU6050_RA_EXT_SENS_DATA_17 0x5A
Throwbot 1:1da89c13dfa1 137 #define MPU6050_RA_EXT_SENS_DATA_18 0x5B
Throwbot 1:1da89c13dfa1 138 #define MPU6050_RA_EXT_SENS_DATA_19 0x5C
Throwbot 1:1da89c13dfa1 139 #define MPU6050_RA_EXT_SENS_DATA_20 0x5D
Throwbot 1:1da89c13dfa1 140 #define MPU6050_RA_EXT_SENS_DATA_21 0x5E
Throwbot 1:1da89c13dfa1 141 #define MPU6050_RA_EXT_SENS_DATA_22 0x5F
Throwbot 1:1da89c13dfa1 142 #define MPU6050_RA_EXT_SENS_DATA_23 0x60
Throwbot 1:1da89c13dfa1 143 #define MPU6050_RA_MOT_DETECT_STATUS 0x61
Throwbot 1:1da89c13dfa1 144 #define MPU6050_RA_I2C_SLV0_DO 0x63
Throwbot 1:1da89c13dfa1 145 #define MPU6050_RA_I2C_SLV1_DO 0x64
Throwbot 1:1da89c13dfa1 146 #define MPU6050_RA_I2C_SLV2_DO 0x65
Throwbot 1:1da89c13dfa1 147 #define MPU6050_RA_I2C_SLV3_DO 0x66
Throwbot 1:1da89c13dfa1 148 #define MPU6050_RA_I2C_MST_DELAY_CTRL 0x67
Throwbot 1:1da89c13dfa1 149 #define MPU6050_RA_SIGNAL_PATH_RESET 0x68
Throwbot 1:1da89c13dfa1 150 #define MPU6050_RA_MOT_DETECT_CTRL 0x69
Throwbot 1:1da89c13dfa1 151 #define MPU6050_RA_USER_CTRL 0x6A
Throwbot 1:1da89c13dfa1 152 #define MPU6050_RA_PWR_MGMT_1 0x6B
Throwbot 1:1da89c13dfa1 153 #define MPU6050_RA_PWR_MGMT_2 0x6C
Throwbot 1:1da89c13dfa1 154 #define MPU6050_RA_BANK_SEL 0x6D
Throwbot 1:1da89c13dfa1 155 #define MPU6050_RA_MEM_START_ADDR 0x6E
Throwbot 1:1da89c13dfa1 156 #define MPU6050_RA_MEM_R_W 0x6F
Throwbot 1:1da89c13dfa1 157 #define MPU6050_RA_DMP_CFG_1 0x70
Throwbot 1:1da89c13dfa1 158 #define MPU6050_RA_DMP_CFG_2 0x71
Throwbot 1:1da89c13dfa1 159 #define MPU6050_RA_FIFO_COUNTH 0x72
Throwbot 1:1da89c13dfa1 160 #define MPU6050_RA_FIFO_COUNTL 0x73
Throwbot 1:1da89c13dfa1 161 #define MPU6050_RA_FIFO_R_W 0x74
Throwbot 1:1da89c13dfa1 162 #define MPU6050_RA_WHO_AM_I 0x75
Throwbot 1:1da89c13dfa1 163
Throwbot 1:1da89c13dfa1 164 #define MPU6050_TC_PWR_MODE_BIT 7
Throwbot 1:1da89c13dfa1 165 #define MPU6050_TC_OFFSET_BIT 6
Throwbot 1:1da89c13dfa1 166 #define MPU6050_TC_OFFSET_LENGTH 6
Throwbot 1:1da89c13dfa1 167 #define MPU6050_TC_OTP_BNK_VLD_BIT 0
Throwbot 1:1da89c13dfa1 168
Throwbot 1:1da89c13dfa1 169 #define MPU6050_VDDIO_LEVEL_VLOGIC 0
Throwbot 1:1da89c13dfa1 170 #define MPU6050_VDDIO_LEVEL_VDD 1
Throwbot 1:1da89c13dfa1 171
Throwbot 1:1da89c13dfa1 172 #define MPU6050_CFG_EXT_SYNC_SET_BIT 5
Throwbot 1:1da89c13dfa1 173 #define MPU6050_CFG_EXT_SYNC_SET_LENGTH 3
Throwbot 1:1da89c13dfa1 174 #define MPU6050_CFG_DLPF_CFG_BIT 2
Throwbot 1:1da89c13dfa1 175 #define MPU6050_CFG_DLPF_CFG_LENGTH 3
Throwbot 1:1da89c13dfa1 176
Throwbot 1:1da89c13dfa1 177 #define MPU6050_EXT_SYNC_DISABLED 0x0
Throwbot 1:1da89c13dfa1 178 #define MPU6050_EXT_SYNC_TEMP_OUT_L 0x1
Throwbot 1:1da89c13dfa1 179 #define MPU6050_EXT_SYNC_GYRO_XOUT_L 0x2
Throwbot 1:1da89c13dfa1 180 #define MPU6050_EXT_SYNC_GYRO_YOUT_L 0x3
Throwbot 1:1da89c13dfa1 181 #define MPU6050_EXT_SYNC_GYRO_ZOUT_L 0x4
Throwbot 1:1da89c13dfa1 182 #define MPU6050_EXT_SYNC_ACCEL_XOUT_L 0x5
Throwbot 1:1da89c13dfa1 183 #define MPU6050_EXT_SYNC_ACCEL_YOUT_L 0x6
Throwbot 1:1da89c13dfa1 184 #define MPU6050_EXT_SYNC_ACCEL_ZOUT_L 0x7
Throwbot 1:1da89c13dfa1 185
Throwbot 1:1da89c13dfa1 186 #define MPU6050_DLPF_BW_256 0x00
Throwbot 1:1da89c13dfa1 187 #define MPU6050_DLPF_BW_188 0x01
Throwbot 1:1da89c13dfa1 188 #define MPU6050_DLPF_BW_98 0x02
Throwbot 1:1da89c13dfa1 189 #define MPU6050_DLPF_BW_42 0x03
Throwbot 1:1da89c13dfa1 190 #define MPU6050_DLPF_BW_20 0x04
Throwbot 1:1da89c13dfa1 191 #define MPU6050_DLPF_BW_10 0x05
Throwbot 1:1da89c13dfa1 192 #define MPU6050_DLPF_BW_5 0x06
Throwbot 1:1da89c13dfa1 193
Throwbot 1:1da89c13dfa1 194 #define MPU6050_GCONFIG_FS_SEL_BIT 4
Throwbot 1:1da89c13dfa1 195 #define MPU6050_GCONFIG_FS_SEL_LENGTH 2
Throwbot 1:1da89c13dfa1 196
Throwbot 1:1da89c13dfa1 197 #define MPU6050_GYRO_FS_250 0x00
Throwbot 1:1da89c13dfa1 198 #define MPU6050_GYRO_FS_500 0x01
Throwbot 1:1da89c13dfa1 199 #define MPU6050_GYRO_FS_1000 0x02
Throwbot 1:1da89c13dfa1 200 #define MPU6050_GYRO_FS_2000 0x03
Throwbot 1:1da89c13dfa1 201
Throwbot 1:1da89c13dfa1 202 #define MPU6050_ACONFIG_XA_ST_BIT 7
Throwbot 1:1da89c13dfa1 203 #define MPU6050_ACONFIG_YA_ST_BIT 6
Throwbot 1:1da89c13dfa1 204 #define MPU6050_ACONFIG_ZA_ST_BIT 5
Throwbot 1:1da89c13dfa1 205 #define MPU6050_ACONFIG_AFS_SEL_BIT 4
Throwbot 1:1da89c13dfa1 206 #define MPU6050_ACONFIG_AFS_SEL_LENGTH 2
Throwbot 1:1da89c13dfa1 207 #define MPU6050_ACONFIG_ACCEL_HPF_BIT 2
Throwbot 1:1da89c13dfa1 208 #define MPU6050_ACONFIG_ACCEL_HPF_LENGTH 3
Throwbot 1:1da89c13dfa1 209
Throwbot 1:1da89c13dfa1 210 #define MPU6050_ACCEL_FS_2 0x00
Throwbot 1:1da89c13dfa1 211 #define MPU6050_ACCEL_FS_4 0x01
Throwbot 1:1da89c13dfa1 212 #define MPU6050_ACCEL_FS_8 0x02
Throwbot 1:1da89c13dfa1 213 #define MPU6050_ACCEL_FS_16 0x03
Throwbot 1:1da89c13dfa1 214
Throwbot 1:1da89c13dfa1 215 #define MPU6050_DHPF_RESET 0x00
Throwbot 1:1da89c13dfa1 216 #define MPU6050_DHPF_5 0x01
Throwbot 1:1da89c13dfa1 217 #define MPU6050_DHPF_2P5 0x02
Throwbot 1:1da89c13dfa1 218 #define MPU6050_DHPF_1P25 0x03
Throwbot 1:1da89c13dfa1 219 #define MPU6050_DHPF_0P63 0x04
Throwbot 1:1da89c13dfa1 220 #define MPU6050_DHPF_HOLD 0x07
Throwbot 1:1da89c13dfa1 221
Throwbot 1:1da89c13dfa1 222 #define MPU6050_TEMP_FIFO_EN_BIT 7
Throwbot 1:1da89c13dfa1 223 #define MPU6050_XG_FIFO_EN_BIT 6
Throwbot 1:1da89c13dfa1 224 #define MPU6050_YG_FIFO_EN_BIT 5
Throwbot 1:1da89c13dfa1 225 #define MPU6050_ZG_FIFO_EN_BIT 4
Throwbot 1:1da89c13dfa1 226 #define MPU6050_ACCEL_FIFO_EN_BIT 3
Throwbot 1:1da89c13dfa1 227 #define MPU6050_SLV2_FIFO_EN_BIT 2
Throwbot 1:1da89c13dfa1 228 #define MPU6050_SLV1_FIFO_EN_BIT 1
Throwbot 1:1da89c13dfa1 229 #define MPU6050_SLV0_FIFO_EN_BIT 0
Throwbot 1:1da89c13dfa1 230
Throwbot 1:1da89c13dfa1 231 #define MPU6050_MULT_MST_EN_BIT 7
Throwbot 1:1da89c13dfa1 232 #define MPU6050_WAIT_FOR_ES_BIT 6
Throwbot 1:1da89c13dfa1 233 #define MPU6050_SLV_3_FIFO_EN_BIT 5
Throwbot 1:1da89c13dfa1 234 #define MPU6050_I2C_MST_P_NSR_BIT 4
Throwbot 1:1da89c13dfa1 235 #define MPU6050_I2C_MST_CLK_BIT 3
Throwbot 1:1da89c13dfa1 236 #define MPU6050_I2C_MST_CLK_LENGTH 4
Throwbot 1:1da89c13dfa1 237
Throwbot 1:1da89c13dfa1 238 #define MPU6050_CLOCK_DIV_348 0x0
Throwbot 1:1da89c13dfa1 239 #define MPU6050_CLOCK_DIV_333 0x1
Throwbot 1:1da89c13dfa1 240 #define MPU6050_CLOCK_DIV_320 0x2
Throwbot 1:1da89c13dfa1 241 #define MPU6050_CLOCK_DIV_308 0x3
Throwbot 1:1da89c13dfa1 242 #define MPU6050_CLOCK_DIV_296 0x4
Throwbot 1:1da89c13dfa1 243 #define MPU6050_CLOCK_DIV_286 0x5
Throwbot 1:1da89c13dfa1 244 #define MPU6050_CLOCK_DIV_276 0x6
Throwbot 1:1da89c13dfa1 245 #define MPU6050_CLOCK_DIV_267 0x7
Throwbot 1:1da89c13dfa1 246 #define MPU6050_CLOCK_DIV_258 0x8
Throwbot 1:1da89c13dfa1 247 #define MPU6050_CLOCK_DIV_500 0x9
Throwbot 1:1da89c13dfa1 248 #define MPU6050_CLOCK_DIV_471 0xA
Throwbot 1:1da89c13dfa1 249 #define MPU6050_CLOCK_DIV_444 0xB
Throwbot 1:1da89c13dfa1 250 #define MPU6050_CLOCK_DIV_421 0xC
Throwbot 1:1da89c13dfa1 251 #define MPU6050_CLOCK_DIV_400 0xD
Throwbot 1:1da89c13dfa1 252 #define MPU6050_CLOCK_DIV_381 0xE
Throwbot 1:1da89c13dfa1 253 #define MPU6050_CLOCK_DIV_364 0xF
Throwbot 1:1da89c13dfa1 254
Throwbot 1:1da89c13dfa1 255 #define MPU6050_I2C_SLV_RW_BIT 7
Throwbot 1:1da89c13dfa1 256 #define MPU6050_I2C_SLV_ADDR_BIT 6
Throwbot 1:1da89c13dfa1 257 #define MPU6050_I2C_SLV_ADDR_LENGTH 7
Throwbot 1:1da89c13dfa1 258 #define MPU6050_I2C_SLV_EN_BIT 7
Throwbot 1:1da89c13dfa1 259 #define MPU6050_I2C_SLV_BYTE_SW_BIT 6
Throwbot 1:1da89c13dfa1 260 #define MPU6050_I2C_SLV_REG_DIS_BIT 5
Throwbot 1:1da89c13dfa1 261 #define MPU6050_I2C_SLV_GRP_BIT 4
Throwbot 1:1da89c13dfa1 262 #define MPU6050_I2C_SLV_LEN_BIT 3
Throwbot 1:1da89c13dfa1 263 #define MPU6050_I2C_SLV_LEN_LENGTH 4
Throwbot 1:1da89c13dfa1 264
Throwbot 1:1da89c13dfa1 265 #define MPU6050_I2C_SLV4_RW_BIT 7
Throwbot 1:1da89c13dfa1 266 #define MPU6050_I2C_SLV4_ADDR_BIT 6
Throwbot 1:1da89c13dfa1 267 #define MPU6050_I2C_SLV4_ADDR_LENGTH 7
Throwbot 1:1da89c13dfa1 268 #define MPU6050_I2C_SLV4_EN_BIT 7
Throwbot 1:1da89c13dfa1 269 #define MPU6050_I2C_SLV4_INT_EN_BIT 6
Throwbot 1:1da89c13dfa1 270 #define MPU6050_I2C_SLV4_REG_DIS_BIT 5
Throwbot 1:1da89c13dfa1 271 #define MPU6050_I2C_SLV4_MST_DLY_BIT 4
Throwbot 1:1da89c13dfa1 272 #define MPU6050_I2C_SLV4_MST_DLY_LENGTH 5
Throwbot 1:1da89c13dfa1 273
Throwbot 1:1da89c13dfa1 274 #define MPU6050_MST_PASS_THROUGH_BIT 7
Throwbot 1:1da89c13dfa1 275 #define MPU6050_MST_I2C_SLV4_DONE_BIT 6
Throwbot 1:1da89c13dfa1 276 #define MPU6050_MST_I2C_LOST_ARB_BIT 5
Throwbot 1:1da89c13dfa1 277 #define MPU6050_MST_I2C_SLV4_NACK_BIT 4
Throwbot 1:1da89c13dfa1 278 #define MPU6050_MST_I2C_SLV3_NACK_BIT 3
Throwbot 1:1da89c13dfa1 279 #define MPU6050_MST_I2C_SLV2_NACK_BIT 2
Throwbot 1:1da89c13dfa1 280 #define MPU6050_MST_I2C_SLV1_NACK_BIT 1
Throwbot 1:1da89c13dfa1 281 #define MPU6050_MST_I2C_SLV0_NACK_BIT 0
Throwbot 1:1da89c13dfa1 282
Throwbot 1:1da89c13dfa1 283 #define MPU6050_INTCFG_INT_LEVEL_BIT 7
Throwbot 1:1da89c13dfa1 284 #define MPU6050_INTCFG_INT_OPEN_BIT 6
Throwbot 1:1da89c13dfa1 285 #define MPU6050_INTCFG_LATCH_INT_EN_BIT 5
Throwbot 1:1da89c13dfa1 286 #define MPU6050_INTCFG_INT_RD_CLEAR_BIT 4
Throwbot 1:1da89c13dfa1 287 #define MPU6050_INTCFG_FSYNC_INT_LEVEL_BIT 3
Throwbot 1:1da89c13dfa1 288 #define MPU6050_INTCFG_FSYNC_INT_EN_BIT 2
Throwbot 1:1da89c13dfa1 289 #define MPU6050_INTCFG_I2C_BYPASS_EN_BIT 1
Throwbot 1:1da89c13dfa1 290 #define MPU6050_INTCFG_CLKOUT_EN_BIT 0
Throwbot 1:1da89c13dfa1 291
Throwbot 1:1da89c13dfa1 292 #define MPU6050_INTMODE_ACTIVEHIGH 0x00
Throwbot 1:1da89c13dfa1 293 #define MPU6050_INTMODE_ACTIVELOW 0x01
Throwbot 1:1da89c13dfa1 294
Throwbot 1:1da89c13dfa1 295 #define MPU6050_INTDRV_PUSHPULL 0x00
Throwbot 1:1da89c13dfa1 296 #define MPU6050_INTDRV_OPENDRAIN 0x01
Throwbot 1:1da89c13dfa1 297
Throwbot 1:1da89c13dfa1 298 #define MPU6050_INTLATCH_50USPULSE 0x00
Throwbot 1:1da89c13dfa1 299 #define MPU6050_INTLATCH_WAITCLEAR 0x01
Throwbot 1:1da89c13dfa1 300
Throwbot 1:1da89c13dfa1 301 #define MPU6050_INTCLEAR_STATUSREAD 0x00
Throwbot 1:1da89c13dfa1 302 #define MPU6050_INTCLEAR_ANYREAD 0x01
Throwbot 1:1da89c13dfa1 303
Throwbot 1:1da89c13dfa1 304 #define MPU6050_INTERRUPT_FF_BIT 7
Throwbot 1:1da89c13dfa1 305 #define MPU6050_INTERRUPT_MOT_BIT 6
Throwbot 1:1da89c13dfa1 306 #define MPU6050_INTERRUPT_ZMOT_BIT 5
Throwbot 1:1da89c13dfa1 307 #define MPU6050_INTERRUPT_FIFO_OFLOW_BIT 4
Throwbot 1:1da89c13dfa1 308 #define MPU6050_INTERRUPT_I2C_MST_INT_BIT 3
Throwbot 1:1da89c13dfa1 309 #define MPU6050_INTERRUPT_PLL_RDY_INT_BIT 2
Throwbot 1:1da89c13dfa1 310 #define MPU6050_INTERRUPT_DMP_INT_BIT 1
Throwbot 1:1da89c13dfa1 311 #define MPU6050_INTERRUPT_DATA_RDY_BIT 0
Throwbot 1:1da89c13dfa1 312
Throwbot 1:1da89c13dfa1 313 // TODO: figure out what these actually do
Throwbot 1:1da89c13dfa1 314 // UMPL source code is not very obivous
Throwbot 1:1da89c13dfa1 315 #define MPU6050_DMPINT_5_BIT 5
Throwbot 1:1da89c13dfa1 316 #define MPU6050_DMPINT_4_BIT 4
Throwbot 1:1da89c13dfa1 317 #define MPU6050_DMPINT_3_BIT 3
Throwbot 1:1da89c13dfa1 318 #define MPU6050_DMPINT_2_BIT 2
Throwbot 1:1da89c13dfa1 319 #define MPU6050_DMPINT_1_BIT 1
Throwbot 1:1da89c13dfa1 320 #define MPU6050_DMPINT_0_BIT 0
Throwbot 1:1da89c13dfa1 321
Throwbot 1:1da89c13dfa1 322 #define MPU6050_MOTION_MOT_XNEG_BIT 7
Throwbot 1:1da89c13dfa1 323 #define MPU6050_MOTION_MOT_XPOS_BIT 6
Throwbot 1:1da89c13dfa1 324 #define MPU6050_MOTION_MOT_YNEG_BIT 5
Throwbot 1:1da89c13dfa1 325 #define MPU6050_MOTION_MOT_YPOS_BIT 4
Throwbot 1:1da89c13dfa1 326 #define MPU6050_MOTION_MOT_ZNEG_BIT 3
Throwbot 1:1da89c13dfa1 327 #define MPU6050_MOTION_MOT_ZPOS_BIT 2
Throwbot 1:1da89c13dfa1 328 #define MPU6050_MOTION_MOT_ZRMOT_BIT 0
Throwbot 1:1da89c13dfa1 329
Throwbot 1:1da89c13dfa1 330 #define MPU6050_DELAYCTRL_DELAY_ES_SHADOW_BIT 7
Throwbot 1:1da89c13dfa1 331 #define MPU6050_DELAYCTRL_I2C_SLV4_DLY_EN_BIT 4
Throwbot 1:1da89c13dfa1 332 #define MPU6050_DELAYCTRL_I2C_SLV3_DLY_EN_BIT 3
Throwbot 1:1da89c13dfa1 333 #define MPU6050_DELAYCTRL_I2C_SLV2_DLY_EN_BIT 2
Throwbot 1:1da89c13dfa1 334 #define MPU6050_DELAYCTRL_I2C_SLV1_DLY_EN_BIT 1
Throwbot 1:1da89c13dfa1 335 #define MPU6050_DELAYCTRL_I2C_SLV0_DLY_EN_BIT 0
Throwbot 1:1da89c13dfa1 336
Throwbot 1:1da89c13dfa1 337 #define MPU6050_PATHRESET_GYRO_RESET_BIT 2
Throwbot 1:1da89c13dfa1 338 #define MPU6050_PATHRESET_ACCEL_RESET_BIT 1
Throwbot 1:1da89c13dfa1 339 #define MPU6050_PATHRESET_TEMP_RESET_BIT 0
Throwbot 1:1da89c13dfa1 340
Throwbot 1:1da89c13dfa1 341 #define MPU6050_DETECT_ACCEL_ON_DELAY_BIT 5
Throwbot 1:1da89c13dfa1 342 #define MPU6050_DETECT_ACCEL_ON_DELAY_LENGTH 2
Throwbot 1:1da89c13dfa1 343 #define MPU6050_DETECT_FF_COUNT_BIT 3
Throwbot 1:1da89c13dfa1 344 #define MPU6050_DETECT_FF_COUNT_LENGTH 2
Throwbot 1:1da89c13dfa1 345 #define MPU6050_DETECT_MOT_COUNT_BIT 1
Throwbot 1:1da89c13dfa1 346 #define MPU6050_DETECT_MOT_COUNT_LENGTH 2
Throwbot 1:1da89c13dfa1 347
Throwbot 1:1da89c13dfa1 348 #define MPU6050_DETECT_DECREMENT_RESET 0x0
Throwbot 1:1da89c13dfa1 349 #define MPU6050_DETECT_DECREMENT_1 0x1
Throwbot 1:1da89c13dfa1 350 #define MPU6050_DETECT_DECREMENT_2 0x2
Throwbot 1:1da89c13dfa1 351 #define MPU6050_DETECT_DECREMENT_4 0x3
Throwbot 1:1da89c13dfa1 352
Throwbot 1:1da89c13dfa1 353 #define MPU6050_USERCTRL_DMP_EN_BIT 7
Throwbot 1:1da89c13dfa1 354 #define MPU6050_USERCTRL_FIFO_EN_BIT 6
Throwbot 1:1da89c13dfa1 355 #define MPU6050_USERCTRL_I2C_MST_EN_BIT 5
Throwbot 1:1da89c13dfa1 356 #define MPU6050_USERCTRL_I2C_IF_DIS_BIT 4
Throwbot 1:1da89c13dfa1 357 #define MPU6050_USERCTRL_DMP_RESET_BIT 3
Throwbot 1:1da89c13dfa1 358 #define MPU6050_USERCTRL_FIFO_RESET_BIT 2
Throwbot 1:1da89c13dfa1 359 #define MPU6050_USERCTRL_I2C_MST_RESET_BIT 1
Throwbot 1:1da89c13dfa1 360 #define MPU6050_USERCTRL_SIG_COND_RESET_BIT 0
Throwbot 1:1da89c13dfa1 361
Throwbot 1:1da89c13dfa1 362 #define MPU6050_PWR1_DEVICE_RESET_BIT 7
Throwbot 1:1da89c13dfa1 363 #define MPU6050_PWR1_SLEEP_BIT 6
Throwbot 1:1da89c13dfa1 364 #define MPU6050_PWR1_CYCLE_BIT 5
Throwbot 1:1da89c13dfa1 365 #define MPU6050_PWR1_TEMP_DIS_BIT 3
Throwbot 1:1da89c13dfa1 366 #define MPU6050_PWR1_CLKSEL_BIT 2
Throwbot 1:1da89c13dfa1 367 #define MPU6050_PWR1_CLKSEL_LENGTH 3
Throwbot 1:1da89c13dfa1 368
Throwbot 1:1da89c13dfa1 369 #define MPU6050_CLOCK_INTERNAL 0x00
Throwbot 1:1da89c13dfa1 370 #define MPU6050_CLOCK_PLL_XGYRO 0x01
Throwbot 1:1da89c13dfa1 371 #define MPU6050_CLOCK_PLL_YGYRO 0x02
Throwbot 1:1da89c13dfa1 372 #define MPU6050_CLOCK_PLL_ZGYRO 0x03
Throwbot 1:1da89c13dfa1 373 #define MPU6050_CLOCK_PLL_EXT32K 0x04
Throwbot 1:1da89c13dfa1 374 #define MPU6050_CLOCK_PLL_EXT19M 0x05
Throwbot 1:1da89c13dfa1 375 #define MPU6050_CLOCK_KEEP_RESET 0x07
Throwbot 1:1da89c13dfa1 376
Throwbot 1:1da89c13dfa1 377 #define MPU6050_PWR2_LP_WAKE_CTRL_BIT 7
Throwbot 1:1da89c13dfa1 378 #define MPU6050_PWR2_LP_WAKE_CTRL_LENGTH 2
Throwbot 1:1da89c13dfa1 379 #define MPU6050_PWR2_STBY_XA_BIT 5
Throwbot 1:1da89c13dfa1 380 #define MPU6050_PWR2_STBY_YA_BIT 4
Throwbot 1:1da89c13dfa1 381 #define MPU6050_PWR2_STBY_ZA_BIT 3
Throwbot 1:1da89c13dfa1 382 #define MPU6050_PWR2_STBY_XG_BIT 2
Throwbot 1:1da89c13dfa1 383 #define MPU6050_PWR2_STBY_YG_BIT 1
Throwbot 1:1da89c13dfa1 384 #define MPU6050_PWR2_STBY_ZG_BIT 0
Throwbot 1:1da89c13dfa1 385
Throwbot 1:1da89c13dfa1 386 #define MPU6050_WAKE_FREQ_1P25 0x0
Throwbot 1:1da89c13dfa1 387 #define MPU6050_WAKE_FREQ_2P5 0x1
Throwbot 1:1da89c13dfa1 388 #define MPU6050_WAKE_FREQ_5 0x2
Throwbot 1:1da89c13dfa1 389 #define MPU6050_WAKE_FREQ_10 0x3
Throwbot 1:1da89c13dfa1 390
Throwbot 1:1da89c13dfa1 391 #define MPU6050_BANKSEL_PRFTCH_EN_BIT 6
Throwbot 1:1da89c13dfa1 392 #define MPU6050_BANKSEL_CFG_USER_BANK_BIT 5
Throwbot 1:1da89c13dfa1 393 #define MPU6050_BANKSEL_MEM_SEL_BIT 4
Throwbot 1:1da89c13dfa1 394 #define MPU6050_BANKSEL_MEM_SEL_LENGTH 5
Throwbot 1:1da89c13dfa1 395
Throwbot 1:1da89c13dfa1 396 #define MPU6050_WHO_AM_I_BIT 6
Throwbot 1:1da89c13dfa1 397 #define MPU6050_WHO_AM_I_LENGTH 6
Throwbot 1:1da89c13dfa1 398
Throwbot 1:1da89c13dfa1 399 #define MPU6050_DMP_MEMORY_BANKS 8
Throwbot 1:1da89c13dfa1 400 #define MPU6050_DMP_MEMORY_BANK_SIZE 256
Throwbot 1:1da89c13dfa1 401 #define MPU6050_DMP_MEMORY_CHUNK_SIZE 16
Throwbot 1:1da89c13dfa1 402
Throwbot 1:1da89c13dfa1 403 // note: DMP code memory blocks defined at end of header file
Throwbot 1:1da89c13dfa1 404
Throwbot 1:1da89c13dfa1 405 class MPU6050 {
Throwbot 1:1da89c13dfa1 406 private:
Throwbot 1:1da89c13dfa1 407 I2Cdev i2Cdev;
Throwbot 1:1da89c13dfa1 408 // Serial debugSerial;
Throwbot 1:1da89c13dfa1 409 public:
Throwbot 1:1da89c13dfa1 410 MPU6050();
Throwbot 1:1da89c13dfa1 411 MPU6050(uint8_t address);
Throwbot 1:1da89c13dfa1 412
Throwbot 1:1da89c13dfa1 413 void initialize();
Throwbot 1:1da89c13dfa1 414 bool testConnection();
Throwbot 1:1da89c13dfa1 415
Throwbot 1:1da89c13dfa1 416 // AUX_VDDIO register
Throwbot 1:1da89c13dfa1 417 uint8_t getAuxVDDIOLevel();
Throwbot 1:1da89c13dfa1 418 void setAuxVDDIOLevel(uint8_t level);
Throwbot 1:1da89c13dfa1 419
Throwbot 1:1da89c13dfa1 420 // SMPLRT_DIV register
Throwbot 1:1da89c13dfa1 421 uint8_t getRate();
Throwbot 1:1da89c13dfa1 422 void setRate(uint8_t rate);
Throwbot 1:1da89c13dfa1 423
Throwbot 1:1da89c13dfa1 424 // CONFIG register
Throwbot 1:1da89c13dfa1 425 uint8_t getExternalFrameSync();
Throwbot 1:1da89c13dfa1 426 void setExternalFrameSync(uint8_t sync);
Throwbot 1:1da89c13dfa1 427 uint8_t getDLPFMode();
Throwbot 1:1da89c13dfa1 428 void setDLPFMode(uint8_t bandwidth);
Throwbot 1:1da89c13dfa1 429
Throwbot 1:1da89c13dfa1 430 // GYRO_CONFIG register
Throwbot 1:1da89c13dfa1 431 uint8_t getFullScaleGyroRange();
Throwbot 1:1da89c13dfa1 432 void setFullScaleGyroRange(uint8_t range);
Throwbot 1:1da89c13dfa1 433
Throwbot 1:1da89c13dfa1 434 // ACCEL_CONFIG register
Throwbot 1:1da89c13dfa1 435 bool getAccelXSelfTest();
Throwbot 1:1da89c13dfa1 436 void setAccelXSelfTest(bool enabled);
Throwbot 1:1da89c13dfa1 437 bool getAccelYSelfTest();
Throwbot 1:1da89c13dfa1 438 void setAccelYSelfTest(bool enabled);
Throwbot 1:1da89c13dfa1 439 bool getAccelZSelfTest();
Throwbot 1:1da89c13dfa1 440 void setAccelZSelfTest(bool enabled);
Throwbot 1:1da89c13dfa1 441 uint8_t getFullScaleAccelRange();
Throwbot 1:1da89c13dfa1 442 void setFullScaleAccelRange(uint8_t range);
Throwbot 1:1da89c13dfa1 443 uint8_t getDHPFMode();
Throwbot 1:1da89c13dfa1 444 void setDHPFMode(uint8_t mode);
Throwbot 1:1da89c13dfa1 445
Throwbot 1:1da89c13dfa1 446 // FF_THR register
Throwbot 1:1da89c13dfa1 447 uint8_t getFreefallDetectionThreshold();
Throwbot 1:1da89c13dfa1 448 void setFreefallDetectionThreshold(uint8_t threshold);
Throwbot 1:1da89c13dfa1 449
Throwbot 1:1da89c13dfa1 450 // FF_DUR register
Throwbot 1:1da89c13dfa1 451 uint8_t getFreefallDetectionDuration();
Throwbot 1:1da89c13dfa1 452 void setFreefallDetectionDuration(uint8_t duration);
Throwbot 1:1da89c13dfa1 453
Throwbot 1:1da89c13dfa1 454 // MOT_THR register
Throwbot 1:1da89c13dfa1 455 uint8_t getMotionDetectionThreshold();
Throwbot 1:1da89c13dfa1 456 void setMotionDetectionThreshold(uint8_t threshold);
Throwbot 1:1da89c13dfa1 457
Throwbot 1:1da89c13dfa1 458 // MOT_DUR register
Throwbot 1:1da89c13dfa1 459 uint8_t getMotionDetectionDuration();
Throwbot 1:1da89c13dfa1 460 void setMotionDetectionDuration(uint8_t duration);
Throwbot 1:1da89c13dfa1 461
Throwbot 1:1da89c13dfa1 462 // ZRMOT_THR register
Throwbot 1:1da89c13dfa1 463 uint8_t getZeroMotionDetectionThreshold();
Throwbot 1:1da89c13dfa1 464 void setZeroMotionDetectionThreshold(uint8_t threshold);
Throwbot 1:1da89c13dfa1 465
Throwbot 1:1da89c13dfa1 466 // ZRMOT_DUR register
Throwbot 1:1da89c13dfa1 467 uint8_t getZeroMotionDetectionDuration();
Throwbot 1:1da89c13dfa1 468 void setZeroMotionDetectionDuration(uint8_t duration);
Throwbot 1:1da89c13dfa1 469
Throwbot 1:1da89c13dfa1 470 // FIFO_EN register
Throwbot 1:1da89c13dfa1 471 bool getTempFIFOEnabled();
Throwbot 1:1da89c13dfa1 472 void setTempFIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 473 bool getXGyroFIFOEnabled();
Throwbot 1:1da89c13dfa1 474 void setXGyroFIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 475 bool getYGyroFIFOEnabled();
Throwbot 1:1da89c13dfa1 476 void setYGyroFIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 477 bool getZGyroFIFOEnabled();
Throwbot 1:1da89c13dfa1 478 void setZGyroFIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 479 bool getAccelFIFOEnabled();
Throwbot 1:1da89c13dfa1 480 void setAccelFIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 481 bool getSlave2FIFOEnabled();
Throwbot 1:1da89c13dfa1 482 void setSlave2FIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 483 bool getSlave1FIFOEnabled();
Throwbot 1:1da89c13dfa1 484 void setSlave1FIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 485 bool getSlave0FIFOEnabled();
Throwbot 1:1da89c13dfa1 486 void setSlave0FIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 487
Throwbot 1:1da89c13dfa1 488 // I2C_MST_CTRL register
Throwbot 1:1da89c13dfa1 489 bool getMultiMasterEnabled();
Throwbot 1:1da89c13dfa1 490 void setMultiMasterEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 491 bool getWaitForExternalSensorEnabled();
Throwbot 1:1da89c13dfa1 492 void setWaitForExternalSensorEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 493 bool getSlave3FIFOEnabled();
Throwbot 1:1da89c13dfa1 494 void setSlave3FIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 495 bool getSlaveReadWriteTransitionEnabled();
Throwbot 1:1da89c13dfa1 496 void setSlaveReadWriteTransitionEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 497 uint8_t getMasterClockSpeed();
Throwbot 1:1da89c13dfa1 498 void setMasterClockSpeed(uint8_t speed);
Throwbot 1:1da89c13dfa1 499
Throwbot 1:1da89c13dfa1 500 // I2C_SLV* registers (Slave 0-3)
Throwbot 1:1da89c13dfa1 501 uint8_t getSlaveAddress(uint8_t num);
Throwbot 1:1da89c13dfa1 502 void setSlaveAddress(uint8_t num, uint8_t address);
Throwbot 1:1da89c13dfa1 503 uint8_t getSlaveRegister(uint8_t num);
Throwbot 1:1da89c13dfa1 504 void setSlaveRegister(uint8_t num, uint8_t reg);
Throwbot 1:1da89c13dfa1 505 bool getSlaveEnabled(uint8_t num);
Throwbot 1:1da89c13dfa1 506 void setSlaveEnabled(uint8_t num, bool enabled);
Throwbot 1:1da89c13dfa1 507 bool getSlaveWordByteSwap(uint8_t num);
Throwbot 1:1da89c13dfa1 508 void setSlaveWordByteSwap(uint8_t num, bool enabled);
Throwbot 1:1da89c13dfa1 509 bool getSlaveWriteMode(uint8_t num);
Throwbot 1:1da89c13dfa1 510 void setSlaveWriteMode(uint8_t num, bool mode);
Throwbot 1:1da89c13dfa1 511 bool getSlaveWordGroupOffset(uint8_t num);
Throwbot 1:1da89c13dfa1 512 void setSlaveWordGroupOffset(uint8_t num, bool enabled);
Throwbot 1:1da89c13dfa1 513 uint8_t getSlaveDataLength(uint8_t num);
Throwbot 1:1da89c13dfa1 514 void setSlaveDataLength(uint8_t num, uint8_t length);
Throwbot 1:1da89c13dfa1 515
Throwbot 1:1da89c13dfa1 516 // I2C_SLV* registers (Slave 4)
Throwbot 1:1da89c13dfa1 517 uint8_t getSlave4Address();
Throwbot 1:1da89c13dfa1 518 void setSlave4Address(uint8_t address);
Throwbot 1:1da89c13dfa1 519 uint8_t getSlave4Register();
Throwbot 1:1da89c13dfa1 520 void setSlave4Register(uint8_t reg);
Throwbot 1:1da89c13dfa1 521 void setSlave4OutputByte(uint8_t data);
Throwbot 1:1da89c13dfa1 522 bool getSlave4Enabled();
Throwbot 1:1da89c13dfa1 523 void setSlave4Enabled(bool enabled);
Throwbot 1:1da89c13dfa1 524 bool getSlave4InterruptEnabled();
Throwbot 1:1da89c13dfa1 525 void setSlave4InterruptEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 526 bool getSlave4WriteMode();
Throwbot 1:1da89c13dfa1 527 void setSlave4WriteMode(bool mode);
Throwbot 1:1da89c13dfa1 528 uint8_t getSlave4MasterDelay();
Throwbot 1:1da89c13dfa1 529 void setSlave4MasterDelay(uint8_t delay);
Throwbot 1:1da89c13dfa1 530 uint8_t getSlate4InputByte();
Throwbot 1:1da89c13dfa1 531
Throwbot 1:1da89c13dfa1 532 // I2C_MST_STATUS register
Throwbot 1:1da89c13dfa1 533 bool getPassthroughStatus();
Throwbot 1:1da89c13dfa1 534 bool getSlave4IsDone();
Throwbot 1:1da89c13dfa1 535 bool getLostArbitration();
Throwbot 1:1da89c13dfa1 536 bool getSlave4Nack();
Throwbot 1:1da89c13dfa1 537 bool getSlave3Nack();
Throwbot 1:1da89c13dfa1 538 bool getSlave2Nack();
Throwbot 1:1da89c13dfa1 539 bool getSlave1Nack();
Throwbot 1:1da89c13dfa1 540 bool getSlave0Nack();
Throwbot 1:1da89c13dfa1 541
Throwbot 1:1da89c13dfa1 542 // INT_PIN_CFG register
Throwbot 1:1da89c13dfa1 543 bool getInterruptMode();
Throwbot 1:1da89c13dfa1 544 void setInterruptMode(bool mode);
Throwbot 1:1da89c13dfa1 545 bool getInterruptDrive();
Throwbot 1:1da89c13dfa1 546 void setInterruptDrive(bool drive);
Throwbot 1:1da89c13dfa1 547 bool getInterruptLatch();
Throwbot 1:1da89c13dfa1 548 void setInterruptLatch(bool latch);
Throwbot 1:1da89c13dfa1 549 bool getInterruptLatchClear();
Throwbot 1:1da89c13dfa1 550 void setInterruptLatchClear(bool clear);
Throwbot 1:1da89c13dfa1 551 bool getFSyncInterruptLevel();
Throwbot 1:1da89c13dfa1 552 void setFSyncInterruptLevel(bool level);
Throwbot 1:1da89c13dfa1 553 bool getFSyncInterruptEnabled();
Throwbot 1:1da89c13dfa1 554 void setFSyncInterruptEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 555 bool getI2CBypassEnabled();
Throwbot 1:1da89c13dfa1 556 void setI2CBypassEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 557 bool getClockOutputEnabled();
Throwbot 1:1da89c13dfa1 558 void setClockOutputEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 559
Throwbot 1:1da89c13dfa1 560 // INT_ENABLE register
Throwbot 1:1da89c13dfa1 561 uint8_t getIntEnabled();
Throwbot 1:1da89c13dfa1 562 void setIntEnabled(uint8_t enabled);
Throwbot 1:1da89c13dfa1 563 bool getIntFreefallEnabled();
Throwbot 1:1da89c13dfa1 564 void setIntFreefallEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 565 bool getIntMotionEnabled();
Throwbot 1:1da89c13dfa1 566 void setIntMotionEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 567 bool getIntZeroMotionEnabled();
Throwbot 1:1da89c13dfa1 568 void setIntZeroMotionEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 569 bool getIntFIFOBufferOverflowEnabled();
Throwbot 1:1da89c13dfa1 570 void setIntFIFOBufferOverflowEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 571 bool getIntI2CMasterEnabled();
Throwbot 1:1da89c13dfa1 572 void setIntI2CMasterEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 573 bool getIntDataReadyEnabled();
Throwbot 1:1da89c13dfa1 574 void setIntDataReadyEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 575
Throwbot 1:1da89c13dfa1 576 // INT_STATUS register
Throwbot 1:1da89c13dfa1 577 uint8_t getIntStatus();
Throwbot 1:1da89c13dfa1 578 bool getIntFreefallStatus();
Throwbot 1:1da89c13dfa1 579 bool getIntMotionStatus();
Throwbot 1:1da89c13dfa1 580 bool getIntZeroMotionStatus();
Throwbot 1:1da89c13dfa1 581 bool getIntFIFOBufferOverflowStatus();
Throwbot 1:1da89c13dfa1 582 bool getIntI2CMasterStatus();
Throwbot 1:1da89c13dfa1 583 bool getIntDataReadyStatus();
Throwbot 1:1da89c13dfa1 584
Throwbot 1:1da89c13dfa1 585 // ACCEL_*OUT_* registers
Throwbot 1:1da89c13dfa1 586 void getMotion9(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz, int16_t* mx, int16_t* my, int16_t* mz);
Throwbot 1:1da89c13dfa1 587 void getMotion6(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz);
Throwbot 1:1da89c13dfa1 588 void getAcceleration(int16_t* x, int16_t* y, int16_t* z);
Throwbot 1:1da89c13dfa1 589 int16_t getAccelerationX();
Throwbot 1:1da89c13dfa1 590 int16_t getAccelerationY();
Throwbot 1:1da89c13dfa1 591 int16_t getAccelerationZ();
Throwbot 1:1da89c13dfa1 592
Throwbot 1:1da89c13dfa1 593 // TEMP_OUT_* registers
Throwbot 1:1da89c13dfa1 594 int16_t getTemperature();
Throwbot 1:1da89c13dfa1 595
Throwbot 1:1da89c13dfa1 596 // GYRO_*OUT_* registers
Throwbot 1:1da89c13dfa1 597 void getRotation(int16_t* x, int16_t* y, int16_t* z);
Throwbot 1:1da89c13dfa1 598 int16_t getRotationX();
Throwbot 1:1da89c13dfa1 599 int16_t getRotationY();
Throwbot 1:1da89c13dfa1 600 int16_t getRotationZ();
Throwbot 1:1da89c13dfa1 601
Throwbot 1:1da89c13dfa1 602 // EXT_SENS_DATA_* registers
Throwbot 1:1da89c13dfa1 603 uint8_t getExternalSensorByte(int position);
Throwbot 1:1da89c13dfa1 604 uint16_t getExternalSensorWord(int position);
Throwbot 1:1da89c13dfa1 605 uint32_t getExternalSensorDWord(int position);
Throwbot 1:1da89c13dfa1 606
Throwbot 1:1da89c13dfa1 607 // MOT_DETECT_STATUS register
Throwbot 1:1da89c13dfa1 608 bool getXNegMotionDetected();
Throwbot 1:1da89c13dfa1 609 bool getXPosMotionDetected();
Throwbot 1:1da89c13dfa1 610 bool getYNegMotionDetected();
Throwbot 1:1da89c13dfa1 611 bool getYPosMotionDetected();
Throwbot 1:1da89c13dfa1 612 bool getZNegMotionDetected();
Throwbot 1:1da89c13dfa1 613 bool getZPosMotionDetected();
Throwbot 1:1da89c13dfa1 614 bool getZeroMotionDetected();
Throwbot 1:1da89c13dfa1 615
Throwbot 1:1da89c13dfa1 616 // I2C_SLV*_DO register
Throwbot 1:1da89c13dfa1 617 void setSlaveOutputByte(uint8_t num, uint8_t data);
Throwbot 1:1da89c13dfa1 618
Throwbot 1:1da89c13dfa1 619 // I2C_MST_DELAY_CTRL register
Throwbot 1:1da89c13dfa1 620 bool getExternalShadowDelayEnabled();
Throwbot 1:1da89c13dfa1 621 void setExternalShadowDelayEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 622 bool getSlaveDelayEnabled(uint8_t num);
Throwbot 1:1da89c13dfa1 623 void setSlaveDelayEnabled(uint8_t num, bool enabled);
Throwbot 1:1da89c13dfa1 624
Throwbot 1:1da89c13dfa1 625 // SIGNAL_PATH_RESET register
Throwbot 1:1da89c13dfa1 626 void resetGyroscopePath();
Throwbot 1:1da89c13dfa1 627 void resetAccelerometerPath();
Throwbot 1:1da89c13dfa1 628 void resetTemperaturePath();
Throwbot 1:1da89c13dfa1 629
Throwbot 1:1da89c13dfa1 630 // MOT_DETECT_CTRL register
Throwbot 1:1da89c13dfa1 631 uint8_t getAccelerometerPowerOnDelay();
Throwbot 1:1da89c13dfa1 632 void setAccelerometerPowerOnDelay(uint8_t delay);
Throwbot 1:1da89c13dfa1 633 uint8_t getFreefallDetectionCounterDecrement();
Throwbot 1:1da89c13dfa1 634 void setFreefallDetectionCounterDecrement(uint8_t decrement);
Throwbot 1:1da89c13dfa1 635 uint8_t getMotionDetectionCounterDecrement();
Throwbot 1:1da89c13dfa1 636 void setMotionDetectionCounterDecrement(uint8_t decrement);
Throwbot 1:1da89c13dfa1 637
Throwbot 1:1da89c13dfa1 638 // USER_CTRL register
Throwbot 1:1da89c13dfa1 639 bool getFIFOEnabled();
Throwbot 1:1da89c13dfa1 640 void setFIFOEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 641 bool getI2CMasterModeEnabled();
Throwbot 1:1da89c13dfa1 642 void setI2CMasterModeEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 643 void switchSPIEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 644 void resetFIFO();
Throwbot 1:1da89c13dfa1 645 void resetI2CMaster();
Throwbot 1:1da89c13dfa1 646 void resetSensors();
Throwbot 1:1da89c13dfa1 647
Throwbot 1:1da89c13dfa1 648 // PWR_MGMT_1 register
Throwbot 1:1da89c13dfa1 649 void reset();
Throwbot 1:1da89c13dfa1 650 bool getSleepEnabled();
Throwbot 1:1da89c13dfa1 651 void setSleepEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 652 bool getWakeCycleEnabled();
Throwbot 1:1da89c13dfa1 653 void setWakeCycleEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 654 bool getTempSensorEnabled();
Throwbot 1:1da89c13dfa1 655 void setTempSensorEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 656 uint8_t getClockSource();
Throwbot 1:1da89c13dfa1 657 void setClockSource(uint8_t source);
Throwbot 1:1da89c13dfa1 658
Throwbot 1:1da89c13dfa1 659 // PWR_MGMT_2 register
Throwbot 1:1da89c13dfa1 660 uint8_t getWakeFrequency();
Throwbot 1:1da89c13dfa1 661 void setWakeFrequency(uint8_t frequency);
Throwbot 1:1da89c13dfa1 662 bool getStandbyXAccelEnabled();
Throwbot 1:1da89c13dfa1 663 void setStandbyXAccelEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 664 bool getStandbyYAccelEnabled();
Throwbot 1:1da89c13dfa1 665 void setStandbyYAccelEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 666 bool getStandbyZAccelEnabled();
Throwbot 1:1da89c13dfa1 667 void setStandbyZAccelEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 668 bool getStandbyXGyroEnabled();
Throwbot 1:1da89c13dfa1 669 void setStandbyXGyroEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 670 bool getStandbyYGyroEnabled();
Throwbot 1:1da89c13dfa1 671 void setStandbyYGyroEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 672 bool getStandbyZGyroEnabled();
Throwbot 1:1da89c13dfa1 673 void setStandbyZGyroEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 674
Throwbot 1:1da89c13dfa1 675 // FIFO_COUNT_* registers
Throwbot 1:1da89c13dfa1 676 uint16_t getFIFOCount();
Throwbot 1:1da89c13dfa1 677
Throwbot 1:1da89c13dfa1 678 // FIFO_R_W register
Throwbot 1:1da89c13dfa1 679 uint8_t getFIFOByte();
Throwbot 1:1da89c13dfa1 680 void setFIFOByte(uint8_t data);
Throwbot 1:1da89c13dfa1 681 void getFIFOBytes(uint8_t *data, uint8_t length);
Throwbot 1:1da89c13dfa1 682
Throwbot 1:1da89c13dfa1 683 // WHO_AM_I register
Throwbot 1:1da89c13dfa1 684 uint8_t getDeviceID();
Throwbot 1:1da89c13dfa1 685 void setDeviceID(uint8_t id);
Throwbot 1:1da89c13dfa1 686
Throwbot 1:1da89c13dfa1 687 // ======== UNDOCUMENTED/DMP REGISTERS/METHODS ========
Throwbot 1:1da89c13dfa1 688
Throwbot 1:1da89c13dfa1 689 // XG_OFFS_TC register
Throwbot 1:1da89c13dfa1 690 uint8_t getOTPBankValid();
Throwbot 1:1da89c13dfa1 691 void setOTPBankValid(bool enabled);
Throwbot 1:1da89c13dfa1 692 int8_t getXGyroOffset();
Throwbot 1:1da89c13dfa1 693 void setXGyroOffset(int8_t offset);
Throwbot 1:1da89c13dfa1 694
Throwbot 1:1da89c13dfa1 695 // YG_OFFS_TC register
Throwbot 1:1da89c13dfa1 696 int8_t getYGyroOffset();
Throwbot 1:1da89c13dfa1 697 void setYGyroOffset(int8_t offset);
Throwbot 1:1da89c13dfa1 698
Throwbot 1:1da89c13dfa1 699 // ZG_OFFS_TC register
Throwbot 1:1da89c13dfa1 700 int8_t getZGyroOffset();
Throwbot 1:1da89c13dfa1 701 void setZGyroOffset(int8_t offset);
Throwbot 1:1da89c13dfa1 702
Throwbot 1:1da89c13dfa1 703 // X_FINE_GAIN register
Throwbot 1:1da89c13dfa1 704 int8_t getXFineGain();
Throwbot 1:1da89c13dfa1 705 void setXFineGain(int8_t gain);
Throwbot 1:1da89c13dfa1 706
Throwbot 1:1da89c13dfa1 707 // Y_FINE_GAIN register
Throwbot 1:1da89c13dfa1 708 int8_t getYFineGain();
Throwbot 1:1da89c13dfa1 709 void setYFineGain(int8_t gain);
Throwbot 1:1da89c13dfa1 710
Throwbot 1:1da89c13dfa1 711 // Z_FINE_GAIN register
Throwbot 1:1da89c13dfa1 712 int8_t getZFineGain();
Throwbot 1:1da89c13dfa1 713 void setZFineGain(int8_t gain);
Throwbot 1:1da89c13dfa1 714
Throwbot 1:1da89c13dfa1 715 // XA_OFFS_* registers
Throwbot 1:1da89c13dfa1 716 int16_t getXAccelOffset();
Throwbot 1:1da89c13dfa1 717 void setXAccelOffset(int16_t offset);
Throwbot 1:1da89c13dfa1 718
Throwbot 1:1da89c13dfa1 719 // YA_OFFS_* register
Throwbot 1:1da89c13dfa1 720 int16_t getYAccelOffset();
Throwbot 1:1da89c13dfa1 721 void setYAccelOffset(int16_t offset);
Throwbot 1:1da89c13dfa1 722
Throwbot 1:1da89c13dfa1 723 // ZA_OFFS_* register
Throwbot 1:1da89c13dfa1 724 int16_t getZAccelOffset();
Throwbot 1:1da89c13dfa1 725 void setZAccelOffset(int16_t offset);
Throwbot 1:1da89c13dfa1 726
Throwbot 1:1da89c13dfa1 727 // XG_OFFS_USR* registers
Throwbot 1:1da89c13dfa1 728 int16_t getXGyroOffsetUser();
Throwbot 1:1da89c13dfa1 729 void setXGyroOffsetUser(int16_t offset);
Throwbot 1:1da89c13dfa1 730
Throwbot 1:1da89c13dfa1 731 // YG_OFFS_USR* register
Throwbot 1:1da89c13dfa1 732 int16_t getYGyroOffsetUser();
Throwbot 1:1da89c13dfa1 733 void setYGyroOffsetUser(int16_t offset);
Throwbot 1:1da89c13dfa1 734
Throwbot 1:1da89c13dfa1 735 // ZG_OFFS_USR* register
Throwbot 1:1da89c13dfa1 736 int16_t getZGyroOffsetUser();
Throwbot 1:1da89c13dfa1 737 void setZGyroOffsetUser(int16_t offset);
Throwbot 1:1da89c13dfa1 738
Throwbot 1:1da89c13dfa1 739 // INT_ENABLE register (DMP functions)
Throwbot 1:1da89c13dfa1 740 bool getIntPLLReadyEnabled();
Throwbot 1:1da89c13dfa1 741 void setIntPLLReadyEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 742 bool getIntDMPEnabled();
Throwbot 1:1da89c13dfa1 743 void setIntDMPEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 744
Throwbot 1:1da89c13dfa1 745 // DMP_INT_STATUS
Throwbot 1:1da89c13dfa1 746 bool getDMPInt5Status();
Throwbot 1:1da89c13dfa1 747 bool getDMPInt4Status();
Throwbot 1:1da89c13dfa1 748 bool getDMPInt3Status();
Throwbot 1:1da89c13dfa1 749 bool getDMPInt2Status();
Throwbot 1:1da89c13dfa1 750 bool getDMPInt1Status();
Throwbot 1:1da89c13dfa1 751 bool getDMPInt0Status();
Throwbot 1:1da89c13dfa1 752
Throwbot 1:1da89c13dfa1 753 // INT_STATUS register (DMP functions)
Throwbot 1:1da89c13dfa1 754 bool getIntPLLReadyStatus();
Throwbot 1:1da89c13dfa1 755 bool getIntDMPStatus();
Throwbot 1:1da89c13dfa1 756
Throwbot 1:1da89c13dfa1 757 // USER_CTRL register (DMP functions)
Throwbot 1:1da89c13dfa1 758 bool getDMPEnabled();
Throwbot 1:1da89c13dfa1 759 void setDMPEnabled(bool enabled);
Throwbot 1:1da89c13dfa1 760 void resetDMP();
Throwbot 1:1da89c13dfa1 761
Throwbot 1:1da89c13dfa1 762 // BANK_SEL register
Throwbot 1:1da89c13dfa1 763 void setMemoryBank(uint8_t bank, bool prefetchEnabled=false, bool userBank=false);
Throwbot 1:1da89c13dfa1 764
Throwbot 1:1da89c13dfa1 765 // MEM_START_ADDR register
Throwbot 1:1da89c13dfa1 766 void setMemoryStartAddress(uint8_t address);
Throwbot 1:1da89c13dfa1 767
Throwbot 1:1da89c13dfa1 768 // MEM_R_W register
Throwbot 1:1da89c13dfa1 769 uint8_t readMemoryByte();
Throwbot 1:1da89c13dfa1 770 void writeMemoryByte(uint8_t data);
Throwbot 1:1da89c13dfa1 771 void readMemoryBlock(uint8_t *data, uint16_t dataSize, uint8_t bank=0, uint8_t address=0);
Throwbot 1:1da89c13dfa1 772 bool writeMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank=0, uint8_t address=0, bool verify=true, bool useProgMem=false);
Throwbot 1:1da89c13dfa1 773 bool writeProgMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank=0, uint8_t address=0, bool verify=true);
Throwbot 1:1da89c13dfa1 774
Throwbot 1:1da89c13dfa1 775 bool writeDMPConfigurationSet(const uint8_t *data, uint16_t dataSize, bool useProgMem=false);
Throwbot 1:1da89c13dfa1 776 bool writeProgDMPConfigurationSet(const uint8_t *data, uint16_t dataSize);
Throwbot 1:1da89c13dfa1 777
Throwbot 1:1da89c13dfa1 778 // DMP_CFG_1 register
Throwbot 1:1da89c13dfa1 779 uint8_t getDMPConfig1();
Throwbot 1:1da89c13dfa1 780 void setDMPConfig1(uint8_t config);
Throwbot 1:1da89c13dfa1 781
Throwbot 1:1da89c13dfa1 782 // DMP_CFG_2 register
Throwbot 1:1da89c13dfa1 783 uint8_t getDMPConfig2();
Throwbot 1:1da89c13dfa1 784 void setDMPConfig2(uint8_t config);
Throwbot 1:1da89c13dfa1 785
Throwbot 1:1da89c13dfa1 786 // special methods for MotionApps 2.0 implementation
Throwbot 1:1da89c13dfa1 787 #ifdef MPU6050_INCLUDE_DMP_MOTIONAPPS20
Throwbot 1:1da89c13dfa1 788 uint8_t *dmpPacketBuffer;
Throwbot 1:1da89c13dfa1 789 uint16_t dmpPacketSize;
Throwbot 1:1da89c13dfa1 790
Throwbot 1:1da89c13dfa1 791 uint8_t dmpInitialize();
Throwbot 1:1da89c13dfa1 792 bool dmpPacketAvailable();
Throwbot 1:1da89c13dfa1 793
Throwbot 1:1da89c13dfa1 794 uint8_t dmpSetFIFORate(uint8_t fifoRate);
Throwbot 1:1da89c13dfa1 795 uint8_t dmpGetFIFORate();
Throwbot 1:1da89c13dfa1 796 uint8_t dmpGetSampleStepSizeMS();
Throwbot 1:1da89c13dfa1 797 uint8_t dmpGetSampleFrequency();
Throwbot 1:1da89c13dfa1 798 int32_t dmpDecodeTemperature(int8_t tempReg);
Throwbot 1:1da89c13dfa1 799
Throwbot 1:1da89c13dfa1 800 // Register callbacks after a packet of FIFO data is processed
Throwbot 1:1da89c13dfa1 801 //uint8_t dmpRegisterFIFORateProcess(inv_obj_func func, int16_t priority);
Throwbot 1:1da89c13dfa1 802 //uint8_t dmpUnregisterFIFORateProcess(inv_obj_func func);
Throwbot 1:1da89c13dfa1 803 uint8_t dmpRunFIFORateProcesses();
Throwbot 1:1da89c13dfa1 804
Throwbot 1:1da89c13dfa1 805 // Setup FIFO for various output
Throwbot 1:1da89c13dfa1 806 uint8_t dmpSendQuaternion(uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 807 uint8_t dmpSendGyro(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 808 uint8_t dmpSendAccel(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 809 uint8_t dmpSendLinearAccel(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 810 uint8_t dmpSendLinearAccelInWorld(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 811 uint8_t dmpSendControlData(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 812 uint8_t dmpSendSensorData(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 813 uint8_t dmpSendExternalSensorData(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 814 uint8_t dmpSendGravity(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 815 uint8_t dmpSendPacketNumber(uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 816 uint8_t dmpSendQuantizedAccel(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 817 uint8_t dmpSendEIS(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 818
Throwbot 1:1da89c13dfa1 819 // Get Fixed Point data from FIFO
Throwbot 1:1da89c13dfa1 820 uint8_t dmpGetAccel(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 821 uint8_t dmpGetAccel(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 822 uint8_t dmpGetAccel(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 823 uint8_t dmpGetQuaternion(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 824 uint8_t dmpGetQuaternion(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 825 uint8_t dmpGetQuaternion(Quaternion *q, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 826 uint8_t dmpGet6AxisQuaternion(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 827 uint8_t dmpGet6AxisQuaternion(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 828 uint8_t dmpGet6AxisQuaternion(Quaternion *q, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 829 uint8_t dmpGetRelativeQuaternion(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 830 uint8_t dmpGetRelativeQuaternion(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 831 uint8_t dmpGetRelativeQuaternion(Quaternion *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 832 uint8_t dmpGetGyro(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 833 uint8_t dmpGetGyro(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 834 uint8_t dmpGetGyro(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 835 uint8_t dmpSetLinearAccelFilterCoefficient(float coef);
Throwbot 1:1da89c13dfa1 836 uint8_t dmpGetLinearAccel(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 837 uint8_t dmpGetLinearAccel(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 838 uint8_t dmpGetLinearAccel(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 839 uint8_t dmpGetLinearAccel(VectorInt16 *v, VectorInt16 *vRaw, VectorFloat *gravity);
Throwbot 1:1da89c13dfa1 840 uint8_t dmpGetLinearAccelInWorld(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 841 uint8_t dmpGetLinearAccelInWorld(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 842 uint8_t dmpGetLinearAccelInWorld(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 843 uint8_t dmpGetLinearAccelInWorld(VectorInt16 *v, VectorInt16 *vReal, Quaternion *q);
Throwbot 1:1da89c13dfa1 844 uint8_t dmpGetGyroAndAccelSensor(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 845 uint8_t dmpGetGyroAndAccelSensor(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 846 uint8_t dmpGetGyroAndAccelSensor(VectorInt16 *g, VectorInt16 *a, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 847 uint8_t dmpGetGyroSensor(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 848 uint8_t dmpGetGyroSensor(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 849 uint8_t dmpGetGyroSensor(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 850 uint8_t dmpGetControlData(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 851 uint8_t dm pGetTemperature(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 852 uint8_t dmpGetGravity(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 853 uint8_t dmpGetGravity(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 854 uint8_t dmpGetGravity(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 855 uint8_t dmpGetGravity(VectorFloat *v, Quaternion *q);
Throwbot 1:1da89c13dfa1 856 uint8_t dmpGetUnquantizedAccel(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 857 uint8_t dmpGetUnquantizedAccel(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 858 uint8_t dmpGetUnquantizedAccel(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 859 uint8_t dmpGetQuantizedAccel(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 860 uint8_t dmpGetQuantizedAccel(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 861 uint8_t dmpGetQuantizedAccel(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 862 uint8_t dmpGetExternalSensorData(int32_t *data, uint16_t size, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 863 uint8_t dmpGetEIS(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 864
Throwbot 1:1da89c13dfa1 865 uint8_t dmpGetEuler(float *data, Quaternion *q);
Throwbot 1:1da89c13dfa1 866 uint8_t dmpGetYawPitchRoll(float *data, Quaternion *q, VectorFloat *gravity);
Throwbot 1:1da89c13dfa1 867
Throwbot 1:1da89c13dfa1 868 // Get Floating Point data from FIFO
Throwbot 1:1da89c13dfa1 869 uint8_t dmpGetAccelFloat(float *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 870 uint8_t dmpGetQuaternionFloat(float *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 871
Throwbot 1:1da89c13dfa1 872 uint8_t dmpProcessFIFOPacket(const unsigned char *dmpData);
Throwbot 1:1da89c13dfa1 873 uint8_t dmpReadAndProcessFIFOPacket(uint8_t numPackets, uint8_t *processed=NULL);
Throwbot 1:1da89c13dfa1 874
Throwbot 1:1da89c13dfa1 875 uint8_t dmpSetFIFOProcessedCallback(void (*func) (void));
Throwbot 1:1da89c13dfa1 876
Throwbot 1:1da89c13dfa1 877 uint8_t dmpInitFIFOParam();
Throwbot 1:1da89c13dfa1 878 uint8_t dmpCloseFIFO();
Throwbot 1:1da89c13dfa1 879 uint8_t dmpSetGyroDataSource(uint8_t source);
Throwbot 1:1da89c13dfa1 880 uint8_t dmpDecodeQuantizedAccel();
Throwbot 1:1da89c13dfa1 881 uint32_t dmpGetGyroSumOfSquare();
Throwbot 1:1da89c13dfa1 882 uint32_t dmpGetAccelSumOfSquare();
Throwbot 1:1da89c13dfa1 883 void dmpOverrideQuaternion(long *q);
Throwbot 1:1da89c13dfa1 884 uint16_t dmpGetFIFOPacketSize();
Throwbot 1:1da89c13dfa1 885 #endif
Throwbot 1:1da89c13dfa1 886
Throwbot 1:1da89c13dfa1 887 // special methods for MotionApps 4.1 implementation
Throwbot 1:1da89c13dfa1 888 #ifdef MPU6050_INCLUDE_DMP_MOTIONAPPS41
Throwbot 1:1da89c13dfa1 889 uint8_t *dmpPacketBuffer;
Throwbot 1:1da89c13dfa1 890 uint16_t dmpPacketSize;
Throwbot 1:1da89c13dfa1 891
Throwbot 1:1da89c13dfa1 892 uint8_t dmpInitialize();
Throwbot 1:1da89c13dfa1 893 bool dmpPacketAvailable();
Throwbot 1:1da89c13dfa1 894
Throwbot 1:1da89c13dfa1 895 uint8_t dmpSetFIFORate(uint8_t fifoRate);
Throwbot 1:1da89c13dfa1 896 uint8_t dmpGetFIFORate();
Throwbot 1:1da89c13dfa1 897 uint8_t dmpGetSampleStepSizeMS();
Throwbot 1:1da89c13dfa1 898 uint8_t dmpGetSampleFrequency();
Throwbot 1:1da89c13dfa1 899 int32_t dmpDecodeTemperature(int8_t tempReg);
Throwbot 1:1da89c13dfa1 900
Throwbot 1:1da89c13dfa1 901 // Register callbacks after a packet of FIFO data is processed
Throwbot 1:1da89c13dfa1 902 //uint8_t dmpRegisterFIFORateProcess(inv_obj_func func, int16_t priority);
Throwbot 1:1da89c13dfa1 903 //uint8_t dmpUnregisterFIFORateProcess(inv_obj_func func);
Throwbot 1:1da89c13dfa1 904 uint8_t dmpRunFIFORateProcesses();
Throwbot 1:1da89c13dfa1 905
Throwbot 1:1da89c13dfa1 906 // Setup FIFO for various output
Throwbot 1:1da89c13dfa1 907 uint8_t dmpSendQuaternion(uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 908 uint8_t dmpSendGyro(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 909 uint8_t dmpSendAccel(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 910 uint8_t dmpSendLinearAccel(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 911 uint8_t dmpSendLinearAccelInWorld(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 912 uint8_t dmpSendControlData(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 913 uint8_t dmpSendSensorData(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 914 uint8_t dmpSendExternalSensorData(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 915 uint8_t dmpSendGravity(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 916 uint8_t dmpSendPacketNumber(uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 917 uint8_t dmpSendQuantizedAccel(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 918 uint8_t dmpSendEIS(uint_fast16_t elements, uint_fast16_t accuracy);
Throwbot 1:1da89c13dfa1 919
Throwbot 1:1da89c13dfa1 920 // Get Fixed Point data from FIFO
Throwbot 1:1da89c13dfa1 921 uint8_t dmpGetAccel(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 922 uint8_t dmpGetAccel(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 923 uint8_t dmpGetAccel(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 924 uint8_t dmpGetQuaternion(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 925 uint8_t dmpGetQuaternion(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 926 uint8_t dmpGetQuaternion(Quaternion *q, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 927 uint8_t dmpGet6AxisQuaternion(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 928 uint8_t dmpGet6AxisQuaternion(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 929 uint8_t dmpGet6AxisQuaternion(Quaternion *q, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 930 uint8_t dmpGetRelativeQuaternion(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 931 uint8_t dmpGetRelativeQuaternion(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 932 uint8_t dmpGetRelativeQuaternion(Quaternion *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 933 uint8_t dmpGetGyro(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 934 uint8_t dmpGetGyro(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 935 uint8_t dmpGetGyro(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 936 uint8_t dmpGetMag(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 937 uint8_t dmpSetLinearAccelFilterCoefficient(float coef);
Throwbot 1:1da89c13dfa1 938 uint8_t dmpGetLinearAccel(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 939 uint8_t dmpGetLinearAccel(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 940 uint8_t dmpGetLinearAccel(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 941 uint8_t dmpGetLinearAccel(VectorInt16 *v, VectorInt16 *vRaw, VectorFloat *gravity);
Throwbot 1:1da89c13dfa1 942 uint8_t dmpGetLinearAccelInWorld(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 943 uint8_t dmpGetLinearAccelInWorld(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 944 uint8_t dmpGetLinearAccelInWorld(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 945 uint8_t dmpGetLinearAccelInWorld(VectorInt16 *v, VectorInt16 *vReal, Quaternion *q);
Throwbot 1:1da89c13dfa1 946 uint8_t dmpGetGyroAndAccelSensor(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 947 uint8_t dmpGetGyroAndAccelSensor(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 948 uint8_t dmpGetGyroAndAccelSensor(VectorInt16 *g, VectorInt16 *a, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 949 uint8_t dmpGetGyroSensor(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 950 uint8_t dmpGetGyroSensor(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 951 uint8_t dmpGetGyroSensor(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 952 uint8_t dmpGetControlData(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 953 uint8_t dmpGetTemperature(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 954 uint8_t dmpGetGravity(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 955 uint8_t dmpGetGravity(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 956 uint8_t dmpGetGravity(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 957 uint8_t dmpGetGravity(VectorFloat *v, Quaternion *q);
Throwbot 1:1da89c13dfa1 958 uint8_t dmpGetUnquantizedAccel(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 959 uint8_t dmpGetUnquantizedAccel(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 960 uint8_t dmpGetUnquantizedAccel(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 961 uint8_t dmpGetQuantizedAccel(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 962 uint8_t dmpGetQuantizedAccel(int16_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 963 uint8_t dmpGetQuantizedAccel(VectorInt16 *v, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 964 uint8_t dmpGetExternalSensorData(int32_t *data, uint16_t size, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 965 uint8_t dmpGetEIS(int32_t *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 966
Throwbot 1:1da89c13dfa1 967 uint8_t dmpGetEuler(float *data, Quaternion *q);
Throwbot 1:1da89c13dfa1 968 uint8_t dmpGetYawPitchRoll(float *data, Quaternion *q, VectorFloat *gravity);
Throwbot 1:1da89c13dfa1 969
Throwbot 1:1da89c13dfa1 970 // Get Floating Point data from FIFO
Throwbot 1:1da89c13dfa1 971 uint8_t dmpGetAccelFloat(float *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 972 uint8_t dmpGetQuaternionFloat(float *data, const uint8_t* packet=0);
Throwbot 1:1da89c13dfa1 973
Throwbot 1:1da89c13dfa1 974 uint8_t dmpProcessFIFOPacket(const unsigned char *dmpData);
Throwbot 1:1da89c13dfa1 975 uint8_t dmpReadAndProcessFIFOPacket(uint8_t numPackets, uint8_t *processed=NULL);
Throwbot 1:1da89c13dfa1 976
Throwbot 1:1da89c13dfa1 977 uint8_t dmpSetFIFOProcessedCallback(void (*func) (void));
Throwbot 1:1da89c13dfa1 978
Throwbot 1:1da89c13dfa1 979 uint8_t dmpInitFIFOParam();
Throwbot 1:1da89c13dfa1 980 uint8_t dmpCloseFIFO();
Throwbot 1:1da89c13dfa1 981 uint8_t dmpSetGyroDataSource(uint8_t source);
Throwbot 1:1da89c13dfa1 982 uint8_t dmpDecodeQuantizedAccel();
Throwbot 1:1da89c13dfa1 983 uint32_t dmpGetGyroSumOfSquare();
Throwbot 1:1da89c13dfa1 984 uint32_t dmpGetAccelSumOfSquare();
Throwbot 1:1da89c13dfa1 985 void dmpOverrideQuaternion(long *q);
Throwbot 1:1da89c13dfa1 986 uint16_t dmpGetFIFOPacketSize();
Throwbot 1:1da89c13dfa1 987 #endif
Throwbot 1:1da89c13dfa1 988
Throwbot 1:1da89c13dfa1 989 private:
Throwbot 1:1da89c13dfa1 990 uint8_t devAddr;
Throwbot 1:1da89c13dfa1 991 uint8_t buffer[14];
Throwbot 1:1da89c13dfa1 992 };
Throwbot 1:1da89c13dfa1 993
Throwbot 1:1da89c13dfa1 994 #endif /* _MPU6050_H_ */