[][src]Struct mpu6050::Mpu6050

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

Handles all operations on/with Mpu6050

Methods

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

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
[src]

custom sensitivity

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

Wakes MPU6050 with all sensors enabled (default)

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

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

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

Verifies device to address 0x68 with WHOAMI.addr() Register

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

Performs software calibration with steps number of readings of accelerometer and gyrometer sensor Readings must be made with MPU6050 in resting position

pub fn get_bias(&mut self) -> Option<&Bias>[src]

Get bias of measurements

pub fn calc_variance(&mut self, steps: Steps) -> Result<(), Mpu6050Error<E>>[src]

Get variance of sensor by observing in resting state for steps number of readings: accelerometer, gyro and temperature sensor each

pub fn get_variance(&mut self) -> Option<&Variance>[src]

get variance of measurements

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

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

pub fn get_acc_angles_avg(
    &mut self,
    steps: Steps
) -> Result<Vector2<f32>, Mpu6050Error<E>>
[src]

Roll and pitch estimation from raw accelerometer - averaged across window readings

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

Accelerometer readings in m/s^2

pub fn get_acc_avg(
    &mut self,
    steps: Steps
) -> Result<Vector3<f32>, Mpu6050Error<E>>
[src]

Accelerometer readings in m/s^2 - averaged

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

Gyro readings in rad/s

pub fn get_gyro_avg(
    &mut self,
    steps: Steps
) -> Result<Vector3<f32>, Mpu6050Error<E>>
[src]

Gyro readings in rad/s

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

Temp in degrees celcius

pub fn get_temp_avg(&mut self, steps: Steps) -> Result<f32, Mpu6050Error<E>>[src]

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

Writes byte to register

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

Reads byte from register

pub fn read_bytes(
    &mut self,
    reg: u8,
    buf: &mut [u8]
) -> Result<(), Mpu6050Error<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, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>,