mpu6050-driver
no_std embedded-hal 1.0 driver for the
InvenSense MPU-6050 6-axis IMU (accelerometer + gyroscope).
Features
no_std, blocking I2C viaembedded-hal1.0- Wake / reset,
WHO_AM_Iidentity decode - Accel/gyro full-scale range, DLPF, and sample-rate divider
- Raw accel/temp/gyro block reads with optional suspicious-sample retry
- FIFO byte reads with diagnostics
- Data-ready and FIFO-overflow interrupt helpers
- Conversion helpers (
raw_to_imu_sample, temperature in °C) - Magnitude helpers for a quick stationary smoke check
(
ImuSample::accel_magnitude_g,gyro_magnitude_dps)
Quick start
use ;
# # where
# I2C: I2c,
#
Replace i2c with your board’s embedded_hal::i2c::I2c implementation.
Address::Ad0Low is 0x68 (AD0 tied low); use Address::Ad0High for 0x69.
Examples
From this crate directory (or after cargo package extract):
wake_and_read uses a mock I2C bus so it runs on the host without hardware.
stationary_usability shows a single-sample |a|≈1 g / quiet-gyro smoke check
(not clone detection, not a full log analyzer).
Cargo
[]
= "0.1.1"
Validating that a module is usable
This driver does not judge authenticity or “clone vs original.” WHO_AM_I
and Identity only report what the bus returned.
In this crate (lightweight):
- Wake and configure ranges.
- Leave the board still.
raw_to_imu_sample→ImuSample::accel_magnitude_g≈ 1 g,gyro_magnitude_dpssmall.- See
examples/stationary_usability.rsfor pass/fail smoke gates.
Not in this crate (full reports): multi-sample thresholds, stationary
fraction, and JSON verdicts live in the workspace imu-tool
(analyze / stationary-suite) — optional host tooling only.
Validation workspace
Developed inside
naoNao89/mpu6050-validation-workspace
(ESP32 firmware + imu-tool). Those paths are not part of this package.
License
MIT. See LICENSE.