pub struct Comparator<C, ED> { /* private fields */ }
Implementations§
Source§impl Comparator<COMP1, Disabled>
impl Comparator<COMP1, Disabled>
Sourcepub fn comp1<P: PositiveInput<COMP1>, N: NegativeInput<COMP1>>(
comp: COMP1,
positive_input: P,
negative_input: N,
config: Config,
clocks: &Clocks,
) -> Self
pub fn comp1<P: PositiveInput<COMP1>, N: NegativeInput<COMP1>>( comp: COMP1, positive_input: P, negative_input: N, config: Config, clocks: &Clocks, ) -> Self
Initializes a comparator
Sourcepub fn enable(self) -> Comparator<COMP1, Enabled>
pub fn enable(self) -> Comparator<COMP1, Enabled>
Enables the comparator
Sourcepub fn listen(&self, edge: SignalEdge, exti: &EXTI)
pub fn listen(&self, edge: SignalEdge, exti: &EXTI)
Enables raising the ADC_COMP
interrupt at the specified output signal edge
Source§impl Comparator<COMP1, Enabled>
impl Comparator<COMP1, Enabled>
Source§impl<ED> Comparator<COMP1, ED>
impl<ED> Comparator<COMP1, ED>
Sourcepub fn is_pending(&self, edge: SignalEdge, exti: &EXTI) -> bool
pub fn is_pending(&self, edge: SignalEdge, exti: &EXTI) -> bool
Returns true
if the output signal interrupt is pending for the edge
Sourcepub fn output_pin<P: OutputPin<COMP1>>(&self, pin: P)
pub fn output_pin<P: OutputPin<COMP1>>(&self, pin: P)
Configures a GPIO pin to output the signal of the comparator
Multiple GPIO pins may be configured as the output simultaneously.
Source§impl Comparator<COMP2, Disabled>
impl Comparator<COMP2, Disabled>
Sourcepub fn comp2<P: PositiveInput<COMP2>, N: NegativeInput<COMP2>>(
comp: COMP2,
positive_input: P,
negative_input: N,
config: Config,
clocks: &Clocks,
) -> Self
pub fn comp2<P: PositiveInput<COMP2>, N: NegativeInput<COMP2>>( comp: COMP2, positive_input: P, negative_input: N, config: Config, clocks: &Clocks, ) -> Self
Initializes a comparator
Sourcepub fn enable(self) -> Comparator<COMP2, Enabled>
pub fn enable(self) -> Comparator<COMP2, Enabled>
Enables the comparator
Sourcepub fn listen(&self, edge: SignalEdge, exti: &EXTI)
pub fn listen(&self, edge: SignalEdge, exti: &EXTI)
Enables raising the ADC_COMP
interrupt at the specified output signal edge
Source§impl Comparator<COMP2, Enabled>
impl Comparator<COMP2, Enabled>
Source§impl<ED> Comparator<COMP2, ED>
impl<ED> Comparator<COMP2, ED>
Sourcepub fn is_pending(&self, edge: SignalEdge, exti: &EXTI) -> bool
pub fn is_pending(&self, edge: SignalEdge, exti: &EXTI) -> bool
Returns true
if the output signal interrupt is pending for the edge
Sourcepub fn output_pin<P: OutputPin<COMP2>>(&self, pin: P)
pub fn output_pin<P: OutputPin<COMP2>>(&self, pin: P)
Configures a GPIO pin to output the signal of the comparator
Multiple GPIO pins may be configured as the output simultaneously.
Auto Trait Implementations§
impl<C, ED> Freeze for Comparator<C, ED>where
C: Freeze,
impl<C, ED> RefUnwindSafe for Comparator<C, ED>where
C: RefUnwindSafe,
ED: RefUnwindSafe,
impl<C, ED> Send for Comparator<C, ED>
impl<C, ED> Sync for Comparator<C, ED>
impl<C, ED> Unpin for Comparator<C, ED>
impl<C, ED> UnwindSafe for Comparator<C, ED>where
C: UnwindSafe,
ED: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more