docs.rs failed to build drogue-mpu-6050-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
drogue-mpu-6050
i2c Driver for the InvenSense MPU-6050 motion-processor.
Advanced DMP
This driver can load the appropriate firmware for quaternion-based DMP processing on-chip.
Set up
i2c
Initialize your i2c bus per usual:
let scl3 = gpioc.pc0.into_open_drain_output.into_af4;
let sda3 = gpioc.pc1.into_open_drain_output.into_af4;
let i2c = i2c3;
MPU driver
The MPU driver requires an embedded-time capable clock.
let sensor = new.unwrap;
Once your clock is ticking, you may then manipulate the MPU.
For ease, the initialize_dmp() method is provided to set up reasonable configurations and load the DMP firmware into the processor.
let sensor: &mut = ctx.resources.sensor;
sensor.initialize_dmp.unwrap;
If using the advanced on-chip DMP logic, the FIFO will contain 28-byte packets of quaternion and other data.
The first 16 bytes are quaternions, which can be constructed using the Quaternion class.
let len = sensor.get_fifo_count.unwrap;
if len >= 28
A quaternion may also be converted into a Euler or YawPitchRoll measurement.