Struct ace128_driver::Ace128[][src]

pub struct Ace128<GpioPin> { /* fields omitted */ }

Holds the GPIO pins in use by the encoder.

Implementations

impl<GpioPin: InputPin> Ace128<GpioPin>[src]

pub fn new(
    p1: GpioPin,
    p2: GpioPin,
    p3: GpioPin,
    p4: GpioPin,
    p5: GpioPin,
    p6: GpioPin,
    p7: GpioPin,
    p8: GpioPin
) -> Self
[src]

Creates a new instance of the encoder driver attached to the eight supplied GpioPin pins.

pub fn read_angle(&self) -> Result<f64, <GpioPin as InputPin>::Error>[src]

Read the absolute position of the encoder in radians.

pub fn read(&self) -> Result<Option<u8>, <GpioPin as InputPin>::Error>[src]

Read the output of the encoder from 0 to 127.

Auto Trait Implementations

impl<GpioPin> Send for Ace128<GpioPin> where
    GpioPin: Send

impl<GpioPin> Sync for Ace128<GpioPin> where
    GpioPin: Sync

impl<GpioPin> Unpin for Ace128<GpioPin> where
    GpioPin: Unpin

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.