Felix Rüdiger / MPU6050_lib

Dependents:   BLE_Nano_MPU6050Service

Embed: (wiki syntax)

« Back to documentation index

MPU6050 Class Reference

MPU6050 Class Reference

Based on the work of authors of https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050. More...

#include <MPU6050.h>

Public Types

enum  BaseAddress
 

Constants.

More...

Public Member Functions

 MPU6050 (PinName sda, PinName scl, BaseAddress address=ADDRESS_0)
 basic members
bool getAuxVDDIOLevel (AuxVDDIOLevel *level, float timeout_secs=defaultTimeout_secs)
 REG_AUX_VDDIO register.
bool getGyroSampleRateDivider (uint8_t *rateDivider, float timeout_secs=defaultTimeout_secs)
 REG_SMPLRT_DIV register.
bool getExternalFrameSync (ExtFrameSync *frameSync, float timeout_secs=defaultTimeout_secs)
 REG_CONFIG register.
bool getGyroXSelfTestEnabled (bool *enabled, float timeout_secs=defaultTimeout_secs)
 REG_GYRO_CONFIG register.
bool getAccelXSelfTestEnabled (bool *enabled, float timeout_secs=defaultTimeout_secs)
 REG_ACCEL_CONFIG register.
bool getFreefallDetectionThreshold (uint8_t *threshold, float timeout_secs=defaultTimeout_secs)
 REG_FF_THR register.
bool getFreefallDetectionDuration (uint8_t *duration, float timeout_secs=defaultTimeout_secs)
 REG_FF_DUR register.
bool getMotionDetectionThreshold (uint8_t *threshold, float timeout_secs=defaultTimeout_secs)
 REG_MOT_THR register.
bool getMotionDetectionDuration (uint8_t *duration, float timeout_secs=defaultTimeout_secs)
 REG_MOT_DUR register.
bool getZeroMotionDetectionThreshold (uint8_t *threshold, float timeout_secs=defaultTimeout_secs)
 REG_ZRMOT_THR register.
bool getZeroMotionDetectionDuration (uint8_t *duration, float timeout_secs=defaultTimeout_secs)
 REG_ZRMOT_DUR register.
bool getTempFIFOEnabled (bool *enabled, float timeout_secs=defaultTimeout_secs)
 REG_FIFO_EN register.
bool getInterruptLevel (InterruptLevel *level, float timeout_secs=defaultTimeout_secs)
 REG_INT_PIN_CFG register.
bool getInterruptsEnabled (Interrupt *interruptSet, float timeout_secs=defaultTimeout_secs)
 REG_INT_ENABLE register.
bool getInterruptStatuses (Interrupt *interruptSet, float timeout_secs=defaultTimeout_secs)
 REG_INT_STATUS register.
bool getAcceleration (int16_t *ax, int16_t *ay, int16_t *az, float timeout_secs=defaultTimeout_secs)
 REG_ACCEL_XOUT_H REG_ACCEL_XOUT_L REG_ACCEL_YOUT_H REG_ACCEL_YOUT_L REG_ACCEL_ZOUT_H REG_ACCEL_ZOUT_L REG_TEMP_OUT_H REG_TEMP_OUT_L REG_GYRO_XOUT_H REG_GYRO_XOUT_L REG_GYRO_YOUT_H REG_GYRO_YOUT_L REG_GYRO_ZOUT_H REG_GYRO_ZOUT_L registers.
bool getTemperature (int16_t *temp, float timeout_secs=defaultTimeout_secs)
 Temperature.
bool getRotationSpeed (int16_t *ox, int16_t *oy, int16_t *oz, float timeout_secs=defaultTimeout_secs)
 Rotation speed.
bool getMotionAndTemperature (int16_t *ax, int16_t *ay, int16_t *az, int16_t *ox, int16_t *oy, int16_t *oz, int16_t *temp, float timeout_secs=defaultTimeout_secs)
 All three.
bool getMotionStatus (Motion *motionSet, float timeout_secs=defaultTimeout_secs)
 REG_MOT_DETECT_STATUS register.
bool resetGyroscopeSignalPath (float timeout_secs=defaultTimeout_secs)
 REG_SIGNAL_PATH_RESET register.
bool getAccelerometerPowerOnDelay (PowerOnDelay *delay, float timeout_secs=defaultTimeout_secs)
 REG_MOT_DETECT_CTRL register.
bool getFIFOEnabled (bool *enabled, float timeout_secs=defaultTimeout_secs)
 REG_USER_CTRL register.
bool reset (float timeout_secs=defaultTimeout_secs)
 REG_PWR_MGMT_1 register.
bool getWakeFrequency (WakeFrequency *wakeFrequency, float timeout_secs=defaultTimeout_secs)
 REG_PWR_MGMT_2 register.
bool getFIFOCount (uint16_t *count, float timeout_secs=defaultTimeout_secs)
 REG_FIFO_COUNTH REG_FIFO_COUNTL registers.
bool readFIFO (uint8_t *data, float timeout_secs=defaultTimeout_secs)
 REG_FIFO_R_W register.
bool getDeviceId (uint8_t *id, float timeout_secs=defaultTimeout_secs)
 REG_WHO_AM_I register.
bool read (Register reg, uint8_t *data, float timeout_secs=defaultTimeout_secs)
 read and write registers

Detailed Description

Based on the work of authors of https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050.

Ported by Felix Rüdiger, 2015 (scrapping all the I2C-slave-bus stuff)

Definition at line 16 of file MPU6050.h.


Member Enumeration Documentation

Constants.

Definition at line 23 of file MPU6050.h.


Constructor & Destructor Documentation

MPU6050 ( PinName  sda,
PinName  scl,
BaseAddress  address = ADDRESS_0 
)

basic members

Definition at line 345 of file MPU6050.h.


Member Function Documentation

bool getAcceleration ( int16_t *  ax,
int16_t *  ay,
int16_t *  az,
float  timeout_secs = defaultTimeout_secs 
)

REG_ACCEL_XOUT_H REG_ACCEL_XOUT_L REG_ACCEL_YOUT_H REG_ACCEL_YOUT_L REG_ACCEL_ZOUT_H REG_ACCEL_ZOUT_L REG_TEMP_OUT_H REG_TEMP_OUT_L REG_GYRO_XOUT_H REG_GYRO_XOUT_L REG_GYRO_YOUT_H REG_GYRO_YOUT_L REG_GYRO_ZOUT_H REG_GYRO_ZOUT_L registers.

Acceleration

Definition at line 802 of file MPU6050.cpp.

bool getAccelerometerPowerOnDelay ( PowerOnDelay *  delay,
float  timeout_secs = defaultTimeout_secs 
)

REG_MOT_DETECT_CTRL register.

Definition at line 1073 of file MPU6050.cpp.

bool getAccelXSelfTestEnabled ( bool *  enabled,
float  timeout_secs = defaultTimeout_secs 
)

REG_ACCEL_CONFIG register.

Definition at line 206 of file MPU6050.cpp.

bool getAuxVDDIOLevel ( AuxVDDIOLevel *  level,
float  timeout_secs = defaultTimeout_secs 
)

REG_AUX_VDDIO register.

Definition at line 55 of file MPU6050.cpp.

bool getDeviceId ( uint8_t *  id,
float  timeout_secs = defaultTimeout_secs 
)

REG_WHO_AM_I register.

Definition at line 1445 of file MPU6050.cpp.

bool getExternalFrameSync ( ExtFrameSync *  frameSync,
float  timeout_secs = defaultTimeout_secs 
)

REG_CONFIG register.

Definition at line 83 of file MPU6050.cpp.

bool getFIFOCount ( uint16_t *  count,
float  timeout_secs = defaultTimeout_secs 
)

REG_FIFO_COUNTH REG_FIFO_COUNTL registers.

Definition at line 1413 of file MPU6050.cpp.

bool getFIFOEnabled ( bool *  enabled,
float  timeout_secs = defaultTimeout_secs 
)

REG_USER_CTRL register.

Definition at line 1127 of file MPU6050.cpp.

bool getFreefallDetectionDuration ( uint8_t *  duration,
float  timeout_secs = defaultTimeout_secs 
)

REG_FF_DUR register.

Definition at line 321 of file MPU6050.cpp.

bool getFreefallDetectionThreshold ( uint8_t *  threshold,
float  timeout_secs = defaultTimeout_secs 
)

REG_FF_THR register.

Definition at line 311 of file MPU6050.cpp.

bool getGyroSampleRateDivider ( uint8_t *  rateDivider,
float  timeout_secs = defaultTimeout_secs 
)

REG_SMPLRT_DIV register.

Definition at line 73 of file MPU6050.cpp.

bool getGyroXSelfTestEnabled ( bool *  enabled,
float  timeout_secs = defaultTimeout_secs 
)

REG_GYRO_CONFIG register.

Definition at line 119 of file MPU6050.cpp.

bool getInterruptLevel ( InterruptLevel *  level,
float  timeout_secs = defaultTimeout_secs 
)

REG_INT_PIN_CFG register.

Definition at line 486 of file MPU6050.cpp.

bool getInterruptsEnabled ( Interrupt *  interruptSet,
float  timeout_secs = defaultTimeout_secs 
)

REG_INT_ENABLE register.

Definition at line 599 of file MPU6050.cpp.

bool getInterruptStatuses ( Interrupt *  interruptSet,
float  timeout_secs = defaultTimeout_secs 
)

REG_INT_STATUS register.

Definition at line 731 of file MPU6050.cpp.

bool getMotionAndTemperature ( int16_t *  ax,
int16_t *  ay,
int16_t *  az,
int16_t *  ox,
int16_t *  oy,
int16_t *  oz,
int16_t *  temp,
float  timeout_secs = defaultTimeout_secs 
)

All three.

Definition at line 916 of file MPU6050.cpp.

bool getMotionDetectionDuration ( uint8_t *  duration,
float  timeout_secs = defaultTimeout_secs 
)

REG_MOT_DUR register.

Definition at line 341 of file MPU6050.cpp.

bool getMotionDetectionThreshold ( uint8_t *  threshold,
float  timeout_secs = defaultTimeout_secs 
)

REG_MOT_THR register.

Definition at line 331 of file MPU6050.cpp.

bool getMotionStatus ( Motion *  motionSet,
float  timeout_secs = defaultTimeout_secs 
)

REG_MOT_DETECT_STATUS register.

Definition at line 960 of file MPU6050.cpp.

bool getRotationSpeed ( int16_t *  ox,
int16_t *  oy,
int16_t *  oz,
float  timeout_secs = defaultTimeout_secs 
)

Rotation speed.

Definition at line 865 of file MPU6050.cpp.

bool getTemperature ( int16_t *  temp,
float  timeout_secs = defaultTimeout_secs 
)

Temperature.

Definition at line 853 of file MPU6050.cpp.

bool getTempFIFOEnabled ( bool *  enabled,
float  timeout_secs = defaultTimeout_secs 
)

REG_FIFO_EN register.

Definition at line 371 of file MPU6050.cpp.

bool getWakeFrequency ( WakeFrequency *  wakeFrequency,
float  timeout_secs = defaultTimeout_secs 
)

REG_PWR_MGMT_2 register.

Definition at line 1257 of file MPU6050.cpp.

bool getZeroMotionDetectionDuration ( uint8_t *  duration,
float  timeout_secs = defaultTimeout_secs 
)

REG_ZRMOT_DUR register.

Definition at line 361 of file MPU6050.cpp.

bool getZeroMotionDetectionThreshold ( uint8_t *  threshold,
float  timeout_secs = defaultTimeout_secs 
)

REG_ZRMOT_THR register.

Definition at line 351 of file MPU6050.cpp.

bool read ( Register  reg,
uint8_t *  data,
float  timeout_secs = defaultTimeout_secs 
)

read and write registers

Definition at line 18 of file MPU6050.cpp.

bool readFIFO ( uint8_t *  data,
float  timeout_secs = defaultTimeout_secs 
)

REG_FIFO_R_W register.

Definition at line 1425 of file MPU6050.cpp.

bool reset ( float  timeout_secs = defaultTimeout_secs )

REG_PWR_MGMT_1 register.

Definition at line 1162 of file MPU6050.cpp.

bool resetGyroscopeSignalPath ( float  timeout_secs = defaultTimeout_secs )

REG_SIGNAL_PATH_RESET register.

Definition at line 1055 of file MPU6050.cpp.