13#include "pico/stdlib.h"
15#include "config_MPU6050.h"
40 uint8_t
INT_PIN_CFG = INT_LEVEL | LATCH_INT_EN | INT_RD_CLEAR;
this is a C++ wrapper for the original pico SDK i2c master API
Definition hw_i2c.h:137
float acceleration_factor
the accelerator proportional factor computed according to the device configuration
Definition mpu6050.h:108
float gyro_x_offset
the x-gyrometer offset
Definition mpu6050.h:122
float accel_z_offset
the z-acceleration offset
Definition mpu6050.h:120
float get_MPU_temperature()
Get the MPU temperature object.
Definition mpu6050.cpp:183
void calibrate()
start the calibration of the MPU and compute gyro and accellero offset and conversion factor
Definition mpu6050.cpp:141
float temperature_gain
the proportional factor for the temperature
Definition mpu6050.h:112
void read_FIFO_accel_raw_data()
read raw acceleration data from FIFO
Definition mpu6050.cpp:131
float gyro_factor
the gyrometer proportional factor computed according to the device configuration
Definition mpu6050.h:110
struct_MPUData data
the set of measures from sensors
Definition mpu6050.h:167
struct_ConfigMPU6050 device_config
the MPU6050 configuration
Definition mpu6050.h:106
MPU6050(HW_I2C_Master *master, struct_ConfigMPU6050 default_config)
Construct a new MPU6050 object.
Definition mpu6050.cpp:7
void read_FIFO_g_accel_raw_data()
read raw acceleration and gyrometer data from FIFO
Definition mpu6050.cpp:119
float accel_y_offset
the y-acceleration offset
Definition mpu6050.h:118
struct_I2CXferResult get_measures()
Get the raw data, fill the internal struct_RawData, converts raw data to real measures according to o...
Definition mpu6050.cpp:191
struct_I2CXferResult read_registers_all_raw_data()
fill the internal data with raw values from sensors
Definition mpu6050.cpp:16
void convert_raw_to_measure()
fill the internal measures by converting the raw data
Definition mpu6050.cpp:44
bool is_data_ready()
the flag that indicates if sensors data are ready
Definition mpu6050.cpp:206
struct_RawData raw
the set of raw data from sensors
Definition mpu6050.h:169
float accel_x_offset
the x-acceleration offset
Definition mpu6050.h:116
uint16_t get_FIFO_count()
Get the FIFO count object.
Definition mpu6050.cpp:199
void init_mpu()
initialise the MPU configuration
Definition mpu6050.cpp:55
HW_I2C_Master * master
the I2C master that control the MPU6050 device
Definition mpu6050.h:104
float gyro_y_offset
the y-gyrometer offset
Definition mpu6050.h:124
float gyro_z_offset
the z-gyrometer offset
Definition mpu6050.h:126
void read_FIFO_all_raw_data()
read raw data from FIFO
Definition mpu6050.cpp:31
float temperature_offset
the temperature offset
Definition mpu6050.h:114
minimal set of MPU configuration data
Definition mpu6050.h:22
uint8_t SIGNAL_PATH_RESET
Reg 0x68: default no reset.
Definition mpu6050.h:44
uint8_t INT_ENABLE
Reg 0x38: INT each time a sensor register write occurs.
Definition mpu6050.h:42
uint16_t GYRO_FULL_SCALE_RANGE
Reg 0x1B: values in { 250, 500, 1000, 2000} DegreePerSecond.
Definition mpu6050.h:34
uint8_t ACCEL_FULL_SCALE_RANGE
Reg 0x1C:values in { 2, 4, 8, 16} G.
Definition mpu6050.h:36
uint8_t EXT_SYNC
Reg 0x1A: external synchronisation via FSYNC pin.
Definition mpu6050.h:30
uint8_t PWR_MGMT_1
Reg 0x6B:
Definition mpu6050.h:48
uint8_t FIFO_OP
Reg 0x6A: FIFO enable.
Definition mpu6050.h:46
uint8_t FIFO_SELECTED_SENSORS
Reg 0x23:
Definition mpu6050.h:38
uint8_t MPU_ADDR
MPU address, assuming AD0 pin is low otherwise = 0x69.
Definition mpu6050.h:24
uint8_t INT_PIN_CFG
Reg 0x37: Active LO, open drain, pulsed 50us, cleared any read operation.
Definition mpu6050.h:40
uint16_t SAMPLE_RATE
Reg 0x19: set sensors sample rate in Hz.
Definition mpu6050.h:26
uint16_t GYRO_OUT_RATE
Reg 0x1A: in Hz, depending on DLPF value.
Definition mpu6050.h:32
uint8_t DLPF_BW
Reg 0x1A: Digital Low-Pass Filter bandwidth. values in { 250, 200, 100, 50, 20, 10,...
Definition mpu6050.h:28
this data structure collects result when an I2C transfer is done. It gives a more verbose error descr...
Definition hw_i2c.h:33
measured sensor value after scale correction
Definition mpu6050.h:78
float gyro_x
rotation speed(x)
Definition mpu6050.h:88
float g_z
acceleration (z)
Definition mpu6050.h:84
float g_y
acceleration (y)
Definition mpu6050.h:82
float temp_out
chip temperature
Definition mpu6050.h:86
float gyro_z
rotation speed(z)
Definition mpu6050.h:92
float g_x
acceleration (x)
Definition mpu6050.h:80
float gyro_y
rotation speed(y)
Definition mpu6050.h:90
raw data as they are captured by sensor
Definition mpu6050.h:56
int16_t gyro_x
rotation speed(x)
Definition mpu6050.h:66
int16_t g_y
acceleration (y)
Definition mpu6050.h:60
int16_t temp_out
chip temperature
Definition mpu6050.h:64
int16_t g_z
acceleration (z)
Definition mpu6050.h:62
int16_t g_x
acceleration (x)
Definition mpu6050.h:58
int16_t gyro_y
rotation speed(y)
Definition mpu6050.h:68
int16_t gyro_z
rotation speed(z)
Definition mpu6050.h:70