[][src]Struct nrf52832_hal::comp::Comp

pub struct Comp { /* fields omitted */ }

A safe wrapper around the COMP peripheral.

Implementations

impl Comp[src]

pub fn new<P>(comp: COMP, input_pin: &P) -> Comp where
    P: CompInputPin
[src]

Takes ownership of the COMP peripheral, returning a safe wrapper.

pub fn power_mode(&self, mode: PowerMode) -> &Comp[src]

Sets the speed and power mode of the comparator.

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

Sets Vref of the comparator in single ended mode.

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

Sets analog reference pin.

pub fn differential<P>(&self, ref_pin: &P) -> &Comp where
    P: CompRefPin
[src]

Sets comparator mode to differential with external Vref pin.

pub fn hysteresis_threshold_up(&self, value: u8) -> &Comp[src]

Upward hysteresis threshold in single ended mode Vup = (value+1)/64*Vref.

pub fn hysteresis_threshold_down(&self, value: u8) -> &Comp[src]

Downward hysteresis threshold in single ended mode Vdown = (value+1)/64*Vref.

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

Enables/disables differential comparator hysteresis (50mV).

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

Enables COMP_LPCOMP interrupt triggering on the specified event.

pub fn disable_interrupt(&self, event: Transition) -> &Comp[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) -> COMP[src]

Consumes self and returns back the raw COMP peripheral.

Auto Trait Implementations

impl Send for Comp

impl !Sync for Comp

impl Unpin for Comp

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.