Struct nrf52833_hal::lpcomp::LpComp[][src]

pub struct LpComp { /* fields omitted */ }

A safe wrapper around the LPCOMP peripheral.

Implementations

impl LpComp[src]

pub fn new<P>(lpcomp: LPCOMP, input_pin: &P) -> LpComp where
    P: LpCompInputPin
[src]

Takes ownership of the LPCOMP peripheral, returning a safe wrapper using specified input pin and a default Vref of Vdd/2.

pub fn vref(&self, vref: VRef) -> &LpComp[src]

Selects comparator Vref.

pub fn aref_pin<P>(&self, ref_pin: &P) -> &LpComp where
    P: LpCompRefPin
[src]

Sets analog reference pin.

pub fn hysteresis(&self, enabled: bool) -> &LpComp[src]

Enables/disables comparator hysteresis.

pub fn analog_detect(&self, event: Transition) -> &LpComp[src]

Analog detect event configuration, used for analog signal power up from OFF.

pub fn enable_interrupt(&self, event: Transition) -> &LpComp[src]

Enables COMP_LPCOMP interrupt triggering on the specified event.

pub fn disable_interrupt(&self, event: Transition) -> &LpComp[src]

Disables COMP_LPCOMP interrupt triggering on the specified event.

pub fn enable(&self)[src]

Enables the comparator and waits until it’s ready to use.

pub fn disable(&self)[src]

Disables the comparator.

pub fn is_up(&self) -> bool[src]

Checks if the Up transition event has been triggered.

pub fn is_down(&self) -> bool[src]

Checks if the Down transition event has been triggered.

pub fn is_cross(&self) -> bool[src]

Checks if the Cross transition event has been triggered.

pub fn event_up(&self) -> &Reg<u32, _EVENTS_UP>[src]

Returns reference to Up transition event endpoint for PPI.

pub fn event_down(&self) -> &Reg<u32, _EVENTS_DOWN>[src]

Returns reference to Down transition event endpoint for PPI.

pub fn event_cross(&self) -> &Reg<u32, _EVENTS_CROSS>[src]

Returns reference to Cross transition event endpoint for PPI.

pub fn reset_event(&self, event: Transition)[src]

Marks event as handled.

pub fn reset_events(&self)[src]

Marks all events as handled.

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

Returns the output state of the comparator.

pub fn free(self) -> LPCOMP[src]

Consumes self and returns back the raw LPCOMP peripheral.

Auto Trait Implementations

impl Send for LpComp

impl !Sync for LpComp

impl Unpin for LpComp

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.