Struct mpu9250_dmp::Mpu9250[][src]

pub struct Mpu9250 {
    pub accel_fsr: AccelFsr,
    pub gyro_fsr: GyroFsr,
    pub debug: bool,
    pub ak8963_i2c_addr: u16,
    // some fields omitted
}

Fields

Methods

impl Mpu9250
[src]

Connects to MPU-9250 and checks the WHOAMI.

If i2c_addr is None, defaults to 0x68. From the datasheet, the chip can be configured to respond to 0x68 or 0x69.

If whoami is None, defaults to 0x71 per datasheet, but it is configurable on the chip.

If ak8963_i2c_addr is None, defaults to 0x0c.

Configures the MPU-9250 to:

  • Acceleration full-scale range: 2G
  • Gyroscope full-scale range: 2000dps

Debug mode prints various messages to stdout.

Writes the accel and gyro FSRs to the device.

When the gyro isn't initialized, the register values read zero. This makes it easy to wait for the gyro to initialize. TODO: Is there a ready bit we should be checking instead?

Reads from dedicated accel & gyro registers. (Not from FIFO)

By enabling bypass, the magnetometer will be directly accessible over the i2c bus.

After resetting the device, the FSR and DLPF values will need to be set again.

Sets up mag interface on Slv0 interface.

Does not enable fifo. You must still call enable_fifo() to begin populating the fifo with mag data.

Assumes mag is connected to Slv0.

rate is specified as the number of samples per second (Hz). It controls the rate the FIFO is populated by the MPU. It also sets the upper bound rate the FIFO is populated by the DMP. Note: Per the docs, this only works if internal sampling is set to 1kHz.

Disables and then re-enables the fifo. This clears the contents of the fifo.

Enables interrupt and fifo.

Disables interrupt and fifo. Also resets the fifo and dmp.

Reads exactly count bytes from the fifo.

Auto Trait Implementations

impl Send for Mpu9250

impl Sync for Mpu9250