32 #define MPU6050_ADDRESS_AD0_LOW 0x68 // address pin low (GND), default for InvenSense evaluation board
33 #define MPU6050_ADDRESS_AD0_HIGH 0x69 // address pin high (VCC)
34 #define ADDR MPU6050_ADDRESS_AD0_LOW // device address
37 #define MPU6050_CLOCK_PLL_XGYRO 0x01
38 #define MPU6050_GYRO_FS_250 0x00
39 #define MPU6050_ACCEL_FS_2 0x00
40 #define MPU6050_RA_INT_PIN_CFG 0x37
42 #define MPU6050_RA_ACCEL_XOUT_H 0x3B
43 #define MPU6050_RA_ACCEL_XOUT_L 0x3C
44 #define MPU6050_RA_ACCEL_YOUT_H 0x3D
45 #define MPU6050_RA_ACCEL_YOUT_L 0x3E
46 #define MPU6050_RA_ACCEL_ZOUT_H 0x3F
47 #define MPU6050_RA_ACCEL_ZOUT_L 0x40
48 #define MPU6050_RA_TEMP_OUT_H 0x41
49 #define MPU6050_RA_TEMP_OUT_L 0x42
50 #define MPU6050_RA_GYRO_XOUT_H 0x43
51 #define MPU6050_RA_GYRO_XOUT_L 0x44
52 #define MPU6050_RA_GYRO_YOUT_H 0x45
53 #define MPU6050_RA_GYRO_YOUT_L 0x46
54 #define MPU6050_RA_GYRO_ZOUT_H 0x47
55 #define MPU6050_RA_GYRO_ZOUT_L 0x48
57 #define MPU6050_RA_CONFIG 0x1A
58 #define MPU6050_CFG_DLPF_CFG_BIT 2
59 #define MPU6050_CFG_DLPF_CFG_LENGTH 3
61 #define MPU6050_RA_GYRO_CONFIG 0x1B
62 #define MPU6050_GCONFIG_FS_SEL_BIT 4
63 #define MPU6050_GCONFIG_FS_SEL_LENGTH 2
65 #define MPU6050_RA_ACCEL_CONFIG 0x1C
66 #define MPU6050_ACONFIG_AFS_SEL_BIT 4
67 #define MPU6050_ACONFIG_AFS_SEL_LENGTH 2
70 #define MPU9150_RA_MAG_ADDRESS 0x0C
71 #define MPU9150_RA_MAG_XOUT_L 0x03
73 #define MPU6050_RA_PWR_MGMT_1 0x6B
74 #define MPU6050_PWR1_CLKSEL_BIT 2
75 #define MPU6050_PWR1_CLKSEL_LENGTH 3
76 #define MPU6050_PWR1_SLEEP_BIT 6
78 #define MPU6050_RA_INT_PIN_CFG 0x37
81 #define MPU6050_PWR1_TEMP_DIS_BIT 3
82 #define MPU6050_RA_WHO_AM_I 0x75
83 #define MPU6050_WHO_AM_I_BIT 6
84 #define MPU6050_WHO_AM_I_LENGTH 6
86 #define SMOOTH_TIMES 10.0
126 MPU9150 (
int bus,
int devAddr);
182 mraa_i2c_context m_i2Ctx;
188 uint16_t i2cReadReg_N (
int reg,
unsigned int len, uint8_t * buffer);
189 mraa_result_t i2cWriteReg (uint8_t reg, uint8_t value);
190 int updateRegBits (uint8_t reg, uint8_t bitStart,
191 uint8_t length, uint16_t data);
192 uint8_t getRegBits (uint8_t reg, uint8_t bitStart,
193 uint8_t length, uint8_t * data);
mraa_result_t initSensor()
Definition: mpu9150.cxx:57
~MPU9150()
Definition: mpu9150.cxx:52
uint8_t getDeviceID()
Definition: mpu9150.cxx:78
MPU9150(int bus, int devAddr)
Definition: mpu9150.cxx:36
Definition: mpu9150.h:105
mraa_result_t getData()
Definition: mpu9150.cxx:85
std::string name()
Definition: mpu9150.h:172
mraa_result_t getAcceleromter(Vector3D *data)
Definition: mpu9150.cxx:134
mraa_result_t getMagnometer(Vector3D *data)
Definition: mpu9150.cxx:152
mraa_result_t getGyro(Vector3D *data)
Definition: mpu9150.cxx:143
float getTemperature()
Definition: mpu9150.cxx:161
C++ API for MPU9150 chip (Accelrometer, Gyro and Magnometer Sensor)
Definition: mpu9150.h:118