Struct nrf52810_hal::qdec::Qdec[][src]

pub struct Qdec { /* fields omitted */ }

A safe wrapper around the QDEC peripheral with associated pins.

Implementations

impl Qdec[src]

pub fn new(
    qdec: QDEC,
    pin_a: Pin<Input<PullUp>>,
    pin_b: Pin<Input<PullUp>>,
    pin_led: Option<Pin<Input<PullUp>>>,
    sample_period: SamplePeriod
) -> Qdec
[src]

Takes ownership of the QDEC peripheral and associated pins, returning a safe wrapper.

pub fn debounce(&self, enable: bool) -> &Qdec[src]

Enables/disables input debounce filters.

pub fn led_polarity(&self, polarity: LedPolarity) -> &Qdec[src]

LED output pin polarity.

pub fn led_pre(&self, usecs: u16) -> &Qdec[src]

Time period the LED is switched ON prior to sampling (0..511 us).

pub fn reset_events(&self)[src]

Marks the interrupt trigger event as handled.

pub fn enable_interrupt(&self, num_samples: NumSamples) -> &Qdec[src]

Triggers the QDEC interrupt on the specified number of non-zero samples.

pub fn disable_interrupt(&self) -> &Qdec[src]

Disables the QDEC interrupt triggering.

pub fn enable(&self)[src]

Enables the quadrature decoder.

pub fn disable(&self)[src]

Disables the quadrature decoder.

pub fn read(&self) -> i16[src]

Returns the accumulated change since last read (-1024..1023).

pub fn free(
    self
) -> (QDEC, Pin<Input<PullUp>>, Pin<Input<PullUp>>, Option<Pin<Input<PullUp>>>)
[src]

Consumes self and returns back the raw QDEC peripheral.

Auto Trait Implementations

impl Send for Qdec

impl !Sync for Qdec

impl Unpin for Qdec

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<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

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.