Platform-agnostic Rust support for the InvenSense MPU-6050 accelerometer and gyroscope.
Status: runs on hardware: an MPU-6050 module on an ESP32-C3, on I²C at 100 kHz, with
initandread_samplepaced by the data-ready interrupt. SPI, the FIFO, the self-test, calibration, the motion interrupt, cycle mode and DMP access are tested against a behavioral model of the chip only.
| Crate | Version | Description |
|---|---|---|
mpu6050-registers |
A typed map of the MPU-6050's registers. | |
mpu6050-ng |
A blocking and async embedded-hal driver. |
|
mpu6050-sim |
not published | A behavioral model for host tests. |
flowchart LR
hal[embedded-hal /<br/>embedded-hal-async] --> ng[mpu6050-ng]
regs[mpu6050-registers] --> ng
regs --> sim[mpu6050-sim]
fake[fake-bus] --> sim
sim -. tests, doctests, fuzzing .-> ng
The driver is mpu6050-ng because the mpu6050 name on crates.io belongs to an older,
unrelated crate.
task ci # all checks, tests, embedded builds, MSRV, fuzz build and Kani proofs
task build:xtensa # the Xtensa ESP32 build; needs the esp toolchainrelease-plz does the releases (see
CONTRIBUTING.md). Each merge to
main updates a release PR. Merging it tags the changed crates (mpu6050-registers-vX.Y.Z,
vX.Y.Z for mpu6050-ng) and creates the GitHub Releases. Each tag runs the publish workflow,
which publishes the crate to crates.io via
trusted publishing (no API token in the
repository).
Copyright © 2026 Markus Mayer
Triple licensed under your choice of either of:
- European Union Public Licence, Version 1.2, (LICENSE-EUPL or https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
See CONTRIBUTING.md. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you shall be triple licensed as above, without any additional terms or conditions.