Struct microbit::hal::comp::Comp [−][src]
pub struct Comp { /* fields omitted */ }Expand description
A safe wrapper around the COMP peripheral.
Implementations
impl Comp[src]
impl Comp[src]pub fn new<P>(comp: COMP, input_pin: &P) -> Comp where
P: CompInputPin, [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]
pub fn power_mode(&self, mode: PowerMode) -> &Comp[src]Sets the speed and power mode of the comparator.
pub fn aref_pin<P>(&self, ref_pin: &P) -> &Comp where
P: CompRefPin, [src]
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]
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]
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]
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]
pub fn hysteresis(&self, enabled: bool) -> &Comp[src]Enables/disables differential comparator hysteresis (50mV).
pub fn enable_interrupt(&self, event: Transition) -> &Comp[src]
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]
pub fn disable_interrupt(&self, event: Transition) -> &Comp[src]Disables COMP_LPCOMP interrupt triggering on the specified event.
pub fn event_up(&self) -> &Reg<u32, _EVENTS_UP>[src]
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]
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]
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]
pub fn reset_event(&self, event: Transition)[src]Marks event as handled.
pub fn reset_events(&self)[src]
pub fn reset_events(&self)[src]Marks all events as handled.
pub fn read(&self) -> CompResult[src]
pub fn read(&self) -> CompResult[src]Returns the output state of the comparator.
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> CheckedAs for T[src]
impl<T> CheckedAs for T[src]pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>, [src]
pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>, [src]Casts the value.
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>, [src]
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>, [src]pub fn lossless_try_into(self) -> Option<Dst>[src]
pub fn lossless_try_into(self) -> Option<Dst>[src]Performs the conversion.
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>, [src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>, [src]pub fn lossy_into(self) -> Dst[src]
pub fn lossy_into(self) -> Dst[src]Performs the conversion.
impl<T> OverflowingAs for T[src]
impl<T> OverflowingAs for T[src]pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>, [src]
pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>, [src]Casts the value.
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<T> SaturatingAs for T[src]
impl<T> SaturatingAs for T[src]pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>, [src]
pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>, [src]Casts the value.
impl<T> UnwrappedAs for T[src]
impl<T> UnwrappedAs for T[src]pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>, [src]
pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>, [src]Casts the value.
impl<T> WrappingAs for T[src]
impl<T> WrappingAs for T[src]pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>, [src]
pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>, [src]Casts the value.