Struct md22::Md22[][src]

pub struct Md22<I2C> { /* fields omitted */ }

MD22 Driver

Implementations

impl<I2C, E> Md22<I2C> where
    I2C: WriteRead<Error = E> + Write<Error = E>,
    E: Debug
[src]

pub fn new(
    i2c: I2C,
    mode: OperatingMode,
    address: I2CAddressSwitchState
) -> Result<Self, E>
[src]

Create a new MD22 driver from the given I2C peripheral and mode.
Defaults the speed, acceleration, and turn registers to 0.

pub fn set_mode(&mut self, mode: OperatingMode) -> Result<(), E>[src]

Set the operating mode.

pub fn set_speed(&mut self, speed: u8) -> Result<(), E>[src]

Set the motor speed register to the specified value.

pub fn set_turn(&mut self, turn: u8) -> Result<(), E>[src]

Set the motor turn register to the specified value.

pub fn set_acceleration(&mut self, acceleration: u8) -> Result<(), E>[src]

Set the motor acceleration register to the specified value.
The acceleration time is given by this value * 64us * n_steps.

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

Auto Trait Implementations

impl<I2C> RefUnwindSafe for Md22<I2C> where
    I2C: RefUnwindSafe
[src]

impl<I2C> Send for Md22<I2C> where
    I2C: Send
[src]

impl<I2C> Sync for Md22<I2C> where
    I2C: Sync
[src]

impl<I2C> Unpin for Md22<I2C> where
    I2C: Unpin
[src]

impl<I2C> UnwindSafe for Md22<I2C> where
    I2C: UnwindSafe
[src]

Blanket Implementations

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

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

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

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

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

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> 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.