Struct nrf52833_hal::lpcomp::LpComp [−][src]
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]
P: LpCompInputPin,
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]
P: LpCompRefPin,
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
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>,