FastArduino  v1.8
C++ library to build fast but small Arduino/AVR projects
mpu6050.h File Reference

API to handle MPU6050 3-axis gyroscope/accelerometer I2C chip. More...

#include <math.h>
#include <stdint.h>
#include "common_magneto.h"
#include "../array.h"
#include "../i2c_device.h"
#include "../utilities.h"
Include dependency graph for mpu6050.h:

Go to the source code of this file.

Classes

class  devices::magneto::FIFOEnable
 Configuration for MPU6050 FIFO Enable register (register map §4.6). More...
 
class  devices::magneto::INTStatus
 The structure of the Interrupt Status register (register map §4.16). More...
 
struct  devices::magneto::AllSensors
 Structure to store all MPU6050 sensors data (3 axis gyroscope and accelerometer, chip temperature). More...
 
class  devices::magneto::MPU6050< MANAGER >
 I2C device driver for the MPU6050 gyroscope/accelerometer chip. More...
 
class  devices::magneto::MPU6050< MANAGER >::BeginFuture
 Create a future to be used by asynchronous method begin(BeginFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::FifoBeginFuture
 Create a future to be used by asynchronous method begin(FifoBeginFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::EndFuture
 Create a future to be used by asynchronous method end(EndFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::ResetFuture
 Create a future to be used by asynchronous method reset(ResetFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::GyroFuture
 Create a future to be used by asynchronous method gyro_measures(GyroFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::TemperatureFuture
 Create a future to be used by asynchronous method temperature(TemperatureFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::AccelFuture
 Create a future to be used by asynchronous method accel_measures(AccelFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::AllMeasuresFuture
 Create a future to be used by asynchronous method all_measures(AllMeasuresFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::InterruptStatusFuture
 Create a future to be used by asynchronous method interrupt_status(InterruptStatusFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::ResetFifoFuture
 Create a future to be used by asynchronous method reset_fifo(ResetFifoFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::FifoCountFuture
 Create a future to be used by asynchronous method fifo_count(FifoCountFuture&). More...
 
class  devices::magneto::MPU6050< MANAGER >::FifoPopFuture< T >
 Create a future to be used by asynchronous method fifo_pop(FifoPopFuture<T>&). More...
 
class  devices::magneto::MPU6050< MANAGER >::FifoPushFuture
 Create a future to be used by asynchronous method fifo_push(FifoPushFuture&). More...
 

Namespaces

 devices
 Defines all API for all external devices supported by FastArduino.
 
 devices::magneto
 Defines API for magnetic sensors for direction, speed and acceleration properties.
 

Typedefs

using devices::magneto::INTEnable = INTStatus
 The structure of the Interrupt Enable register (register map §4.15). More...
 

Enumerations

enum  devices::magneto::GyroRange : uint8_t {
  RANGE_250 = 0 << 3,
  RANGE_500 = 1 << 3,
  RANGE_1000 = 2 << 3,
  RANGE_2000 = 3 << 3
}
 The full-scale range of the gyroscope in dps (datasheet §6.1). More...
 
enum  devices::magneto::AccelRange : uint8_t {
  RANGE_2G = 0 << 3,
  RANGE_4G = 1 << 3,
  RANGE_8G = 2 << 3,
  RANGE_16G = 3 << 3
}
 The full-scale range of the accelerometer in g (datasheet §6.2). More...
 
enum  devices::magneto::ClockSelect : uint8_t {
  INTERNAL_8MHZ = 0,
  PLL_X_AXIS_GYRO = 1,
  PLL_Y_AXIS_GYRO = 2,
  PLL_Z_AXIS_GYRO = 3,
  PLL_EXTERNAL_32KHZ = 4,
  PLL_EXTERNAL_19MHZ = 5,
  STOPPED = 7
}
 The clock to select for the chip (datasheet §6.6). More...
 
enum  devices::magneto::DLPF : uint8_t {
  ACCEL_BW_260HZ = 0,
  ACCEL_BW_184HZ = 1,
  ACCEL_BW_94HZ = 2,
  ACCEL_BW_44HZ = 3,
  ACCEL_BW_21HZ = 4,
  ACCEL_BW_10HZ = 5,
  ACCEL_BW_5HZ = 6,
  GYRO_BW_256HZ = 0,
  GYRO_BW_188HZ = 1,
  GYRO_BW_98HZ = 2,
  GYRO_BW_42HZ = 3,
  GYRO_BW_20HZ = 4,
  GYRO_BW_10HZ = 5,
  GYRO_BW_5HZ = 6
}
 The Digital Low Pass Filter bandwidth to select for the chip (register map §4.3). More...
 
enum  devices::magneto::AD0 : uint8_t {
  devices::magneto::AD0::LOW = 0,
  devices::magneto::AD0::HIGH = 1
}
 Possible values of I2C address lower bit for the chip (the chip may have one of two possible addresses, based on the level of pin AD0, datasheet §6.4, §7.1). More...
 

Functions

static constexpr uint16_t devices::magneto::GYRO_RANGE_DPS (GyroRange range)
 Convert a GyroRange constant to the real gyroscope range in dps.
 
static constexpr uint16_t devices::magneto::ACCEL_RANGE_G (AccelRange range)
 Convert an AccelRange constant to the real accelerometer range in g.
 

Detailed Description