Struct WindowComparator

Source
pub struct WindowComparator<U, L, ED> {
    pub upper: Comparator<U, ED>,
    pub lower: Comparator<L, ED>,
}
Expand description

Uses two comparators to implement a window comparator. See Figure 69 in RM0444 Rev 5.

Fields§

§upper: Comparator<U, ED>§lower: Comparator<L, ED>

Implementations§

Source§

impl WindowComparator<COMP1, COMP2, Disabled>

Source

pub fn enable(self) -> WindowComparator<COMP1, COMP2, Enabled>

Enables the comparator

Source

pub fn listen(&self, edge: SignalEdge, exti: &mut EXTI)

Enables raising the ADC_COMP interrupt at the specified signal edge

Source§

impl WindowComparator<COMP1, COMP2, Enabled>

Source

pub fn disable(self) -> WindowComparator<COMP1, COMP2, Disabled>

Disables the comparator

Source

pub fn output(&self) -> bool

Returns the value of the output of the comparator

Source

pub fn above_lower(&self) -> bool

Returns true if the input signal is above the lower threshold

Source§

impl<ED> WindowComparator<COMP1, COMP2, ED>

Source

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

pub fn unlisten(&self, exti: &mut EXTI)

Disables raising interrupts for the output signal

Source

pub fn is_pending(&self, edge: SignalEdge, exti: &EXTI) -> bool

Returns true if the output signal interrupt is pending for the edge

Source

pub fn unpend(&self, exti: &EXTI)

Unpends the output signal interrupt

Source§

impl WindowComparator<COMP2, COMP1, Disabled>

Source

pub fn enable(self) -> WindowComparator<COMP2, COMP1, Enabled>

Enables the comparator

Source

pub fn listen(&self, edge: SignalEdge, exti: &mut EXTI)

Enables raising the ADC_COMP interrupt at the specified signal edge

Source§

impl WindowComparator<COMP2, COMP1, Enabled>

Source

pub fn disable(self) -> WindowComparator<COMP2, COMP1, Disabled>

Disables the comparator

Source

pub fn output(&self) -> bool

Returns the value of the output of the comparator

Source

pub fn above_lower(&self) -> bool

Returns true if the input signal is above the lower threshold

Source§

impl<ED> WindowComparator<COMP2, COMP1, ED>

Source

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.

Source

pub fn unlisten(&self, exti: &mut EXTI)

Disables raising interrupts for the output signal

Source

pub fn is_pending(&self, edge: SignalEdge, exti: &EXTI) -> bool

Returns true if the output signal interrupt is pending for the edge

Source

pub fn unpend(&self, exti: &EXTI)

Unpends the output signal interrupt

Auto Trait Implementations§

§

impl<U, L, ED> Freeze for WindowComparator<U, L, ED>
where U: Freeze, L: Freeze,

§

impl<U, L, ED> RefUnwindSafe for WindowComparator<U, L, ED>

§

impl<U, L, ED> Send for WindowComparator<U, L, ED>
where U: Send, L: Send, ED: Send,

§

impl<U, L, ED> Sync for WindowComparator<U, L, ED>
where U: Sync, L: Sync, ED: Sync,

§

impl<U, L, ED> Unpin for WindowComparator<U, L, ED>
where U: Unpin, L: Unpin, ED: Unpin,

§

impl<U, L, ED> UnwindSafe for WindowComparator<U, L, ED>
where U: UnwindSafe, L: UnwindSafe, ED: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.