Robot
The embedded systems for UTRA's autonomous humanoid soccer-playing robot
MPU6050

Module for the MPU6050 IMU sensor. More...

Collaboration diagram for MPU6050:

Modules

 IMU Filter
 Digital filtering data structures and functions, for IMU data.
 
 Header
 

Functions

 IMUnamespace::MPU6050::MPU6050 (int SensorNum, I2C_HandleTypeDef *I2CHandle)
 The constructor for the MPU6050 class, which initializes non-I/O members. More...
 
void IMUnamespace::MPU6050::init (uint8_t lpf)
 This function is used to initialize all aspects of the IMU which require I/O. More...
 
void IMUnamespace::MPU6050::Read_Gyroscope_Withoffset ()
 Reads the gyroscope with offsets without interrupts. More...
 
void IMUnamespace::MPU6050::Read_Gyroscope_Withoffset_IT ()
 Reads the gyroscope with interrupts and offsets. More...
 
void IMUnamespace::MPU6050::Read_Accelerometer_Withoffset ()
 Reads the accelerometer with offsets without interrupts. More...
 
void IMUnamespace::MPU6050::Read_Accelerometer_Withoffset_IT ()
 Reads the accelerometer with interrupts and offsets. More...
 
void IMUnamespace::MPU6050::Fill_Struct (IMUStruct *myStruct)
 Fills an IMUStruct. More...
 
int IMUnamespace::MPU6050::Write_Reg (uint8_t reg_addr, uint8_t data)
 Writes to a register from the MPU6050. More...
 
uint8_t IMUnamespace::MPU6050::Read_Reg (uint8_t reg_addr)
 Reads a byte from a register on the sensor, and stores it in the member variable received_byte. More...
 
BaseType_t IMUnamespace::MPU6050::Read_Data_IT (uint8_t Reg_addr, uint8_t *sensor_buffer)
 Reads 6 bytes from the sensor with interrupts, and stores them in the sensor_buffer. More...
 
uint8_t IMUnamespace::MPU6050::Read_Data (uint8_t Reg_addr, uint8_t *sensor_buffer)
 Reads 6 bytes from the sensor, and stores them in the sensor_buffer. More...
 
int IMUnamespace::MPU6050::Set_LPF (uint8_t lpf)
 Sets the offsets of the sensor. More...
 

Detailed Description

Module for the MPU6050 IMU sensor.

Function Documentation

◆ Fill_Struct()

void MPU6050::Fill_Struct ( IMUStruct myStruct)

Fills an IMUStruct.

Parameters
myStructThe pointer to the struct being filled
Returns
None

Definition at line 302 of file MPU6050.cpp.

Here is the caller graph for this function:

◆ init()

void MPU6050::init ( uint8_t  lpf)

This function is used to initialize all aspects of the IMU which require I/O.

Parameters
lpfThe uint8_t lpf setting being used
Returns
None

Definition at line 209 of file MPU6050.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MPU6050()

MPU6050::MPU6050 ( int  SensorNum,
I2C_HandleTypeDef *  I2CHandle 
)

The constructor for the MPU6050 class, which initializes non-I/O members.

Parameters
SensorNumThe integer ID of the sensor being used
I2CHandleA pointer to the I2C_HandleTypeDef being used
Returns
None

Definition at line 188 of file MPU6050.cpp.

Here is the call graph for this function:

◆ Read_Accelerometer_Withoffset()

void MPU6050::Read_Accelerometer_Withoffset ( )

Reads the accelerometer with offsets without interrupts.

Parameters
None
Returns
None

Definition at line 262 of file MPU6050.cpp.

Here is the call graph for this function:

◆ Read_Accelerometer_Withoffset_IT()

void MPU6050::Read_Accelerometer_Withoffset_IT ( )

Reads the accelerometer with interrupts and offsets.

Parameters
None
Returns
None

Definition at line 274 of file MPU6050.cpp.

Here is the caller graph for this function:

◆ Read_Data()

uint8_t MPU6050::Read_Data ( uint8_t  Reg_addr,
uint8_t *  sensor_buffer 
)
private

Reads 6 bytes from the sensor, and stores them in the sensor_buffer.

Parameters
reg_addruint8_t address of the register
sensor_bufferuint8_t pointer to output buffer
Returns
Status

Definition at line 350 of file MPU6050.cpp.

Here is the caller graph for this function:

◆ Read_Data_IT()

BaseType_t MPU6050::Read_Data_IT ( uint8_t  Reg_addr,
uint8_t *  sensor_buffer 
)
private

Reads 6 bytes from the sensor with interrupts, and stores them in the sensor_buffer.

Parameters
reg_addruint8_t address of the register
sensor_bufferuint8_t pointer to output buffer
Returns
Status

Definition at line 339 of file MPU6050.cpp.

◆ Read_Gyroscope_Withoffset()

void MPU6050::Read_Gyroscope_Withoffset ( )

Reads the gyroscope with offsets without interrupts.

Parameters
None
Returns
None

Definition at line 220 of file MPU6050.cpp.

Here is the call graph for this function:

◆ Read_Gyroscope_Withoffset_IT()

void MPU6050::Read_Gyroscope_Withoffset_IT ( )

Reads the gyroscope with interrupts and offsets.

Parameters
None
Returns
None

Definition at line 232 of file MPU6050.cpp.

Here is the caller graph for this function:

◆ Read_Reg()

uint8_t MPU6050::Read_Reg ( uint8_t  reg_addr)
private

Reads a byte from a register on the sensor, and stores it in the member variable received_byte.

Parameters
reg_addruint8_t address of the register
Returns
Status

Definition at line 326 of file MPU6050.cpp.

Here is the caller graph for this function:

◆ Set_LPF()

int MPU6050::Set_LPF ( uint8_t  lpf)
private

Sets the offsets of the sensor.

Parameters
lpfThe uint8_t setting being used for the built-in LPF
Returns
None

Definition at line 363 of file MPU6050.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write_Reg()

int MPU6050::Write_Reg ( uint8_t  reg_addr,
uint8_t  data 
)
private

Writes to a register from the MPU6050.

Parameters
reg_addruint8_t address of the register
datauint8_t data to be written
Returns
Status

Definition at line 314 of file MPU6050.cpp.

Here is the caller graph for this function: