[][src]Struct mpu6050::Mpu6050

pub struct Mpu6050<I, D> { /* fields omitted */ }

Handles all operations on/with Mpu6050


impl<I, D, E> Mpu6050<I, D> where
    I: Write<Error = E> + WriteRead<Error = E>,
    D: DelayMs<u8>, 

pub fn new(i2c: I, delay: D) -> Self[src]

Side effect free constructor with default sensitivies, no calibration

pub fn new_with_sens(
    i2c: I,
    delay: D,
    arange: AccelRange,
    grange: GyroRange
) -> Self

custom sensitivity

pub fn soft_calib(&mut self, steps: u8) -> Result<(), Error<E>>[src]

Performs software calibration with steps number of readings. Readings must be made with MPU6050 in resting position

pub fn wake(&mut self) -> Result<(), Error<E>>[src]

Wakes MPU6050 with all sensors enabled (default)

pub fn init(&mut self) -> Result<(), Error<E>>[src]

Init wakes MPU6050 and verifies register addr, e.g. in i2c

pub fn verify(&mut self) -> Result<(), Error<E>>[src]

Verifies device to address 0x68 with WHOAMI Register

pub fn get_acc_angles(&mut self) -> Result<(f32, f32), Error<E>>[src]

Roll and pitch estimation from raw accelerometer readings NOTE: no yaw! no magnetometer present on MPU6050

pub fn get_acc(&mut self) -> Result<(f32, f32, f32), Error<E>>[src]

Accelerometer readings in m/s^2

pub fn get_gyro(&mut self) -> Result<(f32, f32, f32), Error<E>>[src]

Gyro readings in rad/s

pub fn get_temp(&mut self) -> Result<f32, Error<E>>[src]

Temp in degrees celcius

pub fn write_u8(&mut self, reg: u8, byte: u8) -> Result<(), Error<E>>[src]

Writes byte to register

pub fn read_u8(&mut self, reg: u8) -> Result<u8, Error<E>>[src]

Reads byte from register

pub fn read_bytes(&mut self, reg: u8, buf: &mut [u8]) -> Result<(), Error<E>>[src]

Reads series of bytes into buf from specified reg

Auto Trait Implementations

impl<I, D> Send for Mpu6050<I, D> where
    D: Send,
    I: Send

impl<I, D> Sync for Mpu6050<I, D> where
    D: Sync,
    I: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 

impl<T> Borrow for T where
    T: ?Sized

impl<T> BorrowMut for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized