A platform independent firmware driver for using the GY-521 module with the MPU-6050 IC.
Go to file
Jake Goodwin c5fc7461e7 rewrote the twi setup and a test to handle the self test functionality of the IMU 2023-09-06 22:56:06 -07:00
build compile commands update 2023-08-30 20:17:04 -07:00
cmake/cmocka Initial commit 2023-08-30 05:43:48 +00:00
src updated register map and created new functions for preforming the mpu6050 selftest on the gyroscope 2023-09-06 00:00:05 -07:00
tests rewrote the twi setup and a test to handle the self test functionality of the IMU 2023-09-06 22:56:06 -07:00
.gitignore Initial commit 2023-08-30 05:43:48 +00:00
.gitmodules Initial commit 2023-08-30 05:43:48 +00:00
CMakeLists.txt Initial commit 2023-08-30 05:43:48 +00:00
LICENSE Initial commit 2023-08-30 05:43:48 +00:00
README.md updated with the actual info now 2023-08-31 18:22:53 -07:00
compile_commands.json Initial commit 2023-08-30 05:43:48 +00:00

README.md

gy-521 Driver

The gy-521 module is usally interfaced with via TWI/I2C. The actual chip that is used in the module is the mpu6050 ic.

This driver doesn't make any assumptions about the platform it will run on beyond that it supports "stdlib.h" and "inttypes.h".

The interface handles all the register and bitshift operations in the the backgorund. The module uses getters and setters to abstract the actual data. This prevents the end user from trying to directly use the structures data when it is volatile and may be setup to update in a ISR.

PINs

  • VCC: 3.3v
  • GND: ground or 0v
  • SCL: TWI clock
  • SDA: TWI data
  • XDA:
  • XCL:
  • AD0: changes the TWI address when pulled high.
  • INT: interrupt pin

Running and building the project

The project uses CMake along with cmocka for unit testing.

# change into the build dir
cd ./build

# generate the make files and make everything.
cmake ../ -DUNIT_TESTING=ON; make all;

# Run the tests
ctest

RoadMap

  • add in functions for interrupt driven updates.
  • add functions for configuration of module.
  • add functions to save configurations in memory.
  • add functions to load saved configs