[−][src]Struct nrf52840_hal::comp::Comp
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]
P: CompInputPin,
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]
P: CompRefPin,
Sets analog reference pin.
pub fn differential<P>(&self, ref_pin: &P) -> &Comp where
P: CompRefPin,
[src]
P: CompRefPin,
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
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>,