[−][src]Struct nrf52832_hal::qdec::Qdec
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]
qdec: QDEC,
pin_a: Pin<Input<PullUp>>,
pin_b: Pin<Input<PullUp>>,
pin_led: Option<Pin<Input<PullUp>>>,
sample_period: SamplePeriod
) -> Qdec
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]
self
) -> (QDEC, Pin<Input<PullUp>>, Pin<Input<PullUp>>, Option<Pin<Input<PullUp>>>)
Consumes self
and returns back the raw QDEC
peripheral.
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
Dst: LosslessTryFrom<Src>,
pub fn lossless_try_into(self) -> Option<Dst>
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
Dst: LossyFrom<Src>,
pub fn lossy_into(self) -> Dst
[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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,