Struct mpu6050_dmp::sensor::Mpu6050
source · [−]pub struct Mpu6050<I2c> where
I2c: Write + WriteRead,
<I2c as WriteRead>::Error: Debug,
<I2c as Write>::Error: Debug, { /* private fields */ }
Expand description
InvenSense MPU-6050 Driver
Implementations
sourceimpl<I2c> Mpu6050<I2c> where
I2c: Write + WriteRead,
<I2c as WriteRead>::Error: Debug,
<I2c as Write>::Error: Debug,
impl<I2c> Mpu6050<I2c> where
I2c: Write + WriteRead,
<I2c as WriteRead>::Error: Debug,
<I2c as Write>::Error: Debug,
pub fn load_firmware(&mut self) -> Result<(), Error<I2c>>
pub fn boot_firmware(&mut self) -> Result<(), Error<I2c>>
sourceimpl<I2c> Mpu6050<I2c> where
I2c: Write + WriteRead,
<I2c as WriteRead>::Error: Debug,
<I2c as Write>::Error: Debug,
impl<I2c> Mpu6050<I2c> where
I2c: Write + WriteRead,
<I2c as WriteRead>::Error: Debug,
<I2c as Write>::Error: Debug,
sourcepub fn new(i2c: I2c, address: Address) -> Result<Self, Error<I2c>>
pub fn new(i2c: I2c, address: Address) -> Result<Self, Error<I2c>>
Construct a new i2c driver for the MPU-6050
sourcepub fn initialize_dmp(
&mut self,
delay: &mut impl DelayMs<u32>
) -> Result<(), Error<I2c>>
pub fn initialize_dmp(
&mut self,
delay: &mut impl DelayMs<u32>
) -> Result<(), Error<I2c>>
Load DMP firmware and perform all appropriate initialization.
sourcepub fn reset(&mut self, clock: &mut impl DelayMs<u32>) -> Result<(), Error<I2c>>
pub fn reset(&mut self, clock: &mut impl DelayMs<u32>) -> Result<(), Error<I2c>>
Perform power reset of the MPU
sourcepub fn reset_signal_path(
&mut self,
clock: &mut impl DelayMs<u32>
) -> Result<(), Error<I2c>>
pub fn reset_signal_path(
&mut self,
clock: &mut impl DelayMs<u32>
) -> Result<(), Error<I2c>>
Perform reset of the signal path
sourcepub fn set_clock_source(
&mut self,
clock_source: ClockSource
) -> Result<(), Error<I2c>>
pub fn set_clock_source(
&mut self,
clock_source: ClockSource
) -> Result<(), Error<I2c>>
Pick the clock-source
pub fn disable_interrupts(&mut self) -> Result<(), Error<I2c>>
pub fn calibrate_accel(&mut self, loops: u8) -> Result<(), Error<I2c>>
pub fn set_accel_full_scale(
&mut self,
scale: AccelFullScale
) -> Result<(), Error<I2c>>
pub fn set_gyro_full_scale(
&mut self,
scale: GyroFullScale
) -> Result<(), Error<I2c>>
pub fn set_sample_rate_divider(&mut self, div: u8) -> Result<(), Error<I2c>>
pub fn set_digital_lowpass_filter(
&mut self,
filter: DigitalLowPassFilter
) -> Result<(), Error<I2c>>
pub fn reset_fifo(&mut self) -> Result<(), Error<I2c>>
pub fn enable_fifo(&mut self) -> Result<(), Error<I2c>>
sourcepub fn enable_dmp(&mut self) -> Result<(), Error<I2c>>
pub fn enable_dmp(&mut self) -> Result<(), Error<I2c>>
Set the DMP bit.
To perform full DMP initialization, see initialize_dmp()
pub fn disable_dmp(&mut self) -> Result<(), Error<I2c>>
sourcepub fn read_fifo<'a>(
&mut self,
buf: &'a mut [u8]
) -> Result<&'a [u8], Error<I2c>>
pub fn read_fifo<'a>(
&mut self,
buf: &'a mut [u8]
) -> Result<&'a [u8], Error<I2c>>
Read the FIFO
pub fn get_fifo_enabled(&mut self) -> Result<Fifo, Error<I2c>>
pub fn set_fifo_enabled(&mut self, fifo: Fifo) -> Result<(), Error<I2c>>
pub fn get_fifo_count(&mut self) -> Result<usize, Error<I2c>>
pub fn disable_sleep(&mut self) -> Result<(), Error<I2c>>
pub fn accel(&mut self) -> Result<Accel, Error<I2c>>
pub fn gyro(&mut self) -> Result<Gyro, Error<I2c>>
Auto Trait Implementations
impl<I2c> RefUnwindSafe for Mpu6050<I2c> where
I2c: RefUnwindSafe,
impl<I2c> Send for Mpu6050<I2c> where
I2c: Send,
impl<I2c> Sync for Mpu6050<I2c> where
I2c: Sync,
impl<I2c> Unpin for Mpu6050<I2c> where
I2c: Unpin,
impl<I2c> UnwindSafe for Mpu6050<I2c> where
I2c: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more