Skip to main content

CmpRunning

Struct CmpRunning 

Source
pub struct CmpRunning<POS, INV, LOCKED = Unlocked> { /* private fields */ }
Expand description

The comparator, running.

Once LOCKED is Locked the control register is frozen for good: the peripheral cannot be stopped and the pins cannot be taken back.

Implementations§

Source§

impl<POS, INV> CmpRunning<POS, INV, Unlocked>

Source

pub fn disable(self) -> Cmp<POS, INV>

Stops the comparator, handing back the configured but idle peripheral.

Source

pub fn lock(self) -> CmpRunning<POS, INV, Locked>

Freezes the control register until the next system reset.

Nothing clears CMPxLK, so the comparator keeps running for good and the pins stay with it: the locked type has neither disable nor a way out.

Source§

impl<POS, INV, LOCKED> CmpRunning<POS, INV, LOCKED>

Source

pub fn output(&self) -> bool

Whether the non-inverting input is above the inverting one.

CMPxO is taken before the polarity multiplexer, so Polarity does not show up here — only on the pin, EXTI and the timer.

Auto Trait Implementations§

§

impl<POS, INV, LOCKED = Unlocked> !Sync for CmpRunning<POS, INV, LOCKED>

§

impl<POS, INV, LOCKED> Freeze for CmpRunning<POS, INV, LOCKED>
where POS: Freeze, INV: Freeze, PhantomData<LOCKED>: Freeze,

§

impl<POS, INV, LOCKED> RefUnwindSafe for CmpRunning<POS, INV, LOCKED>

§

impl<POS, INV, LOCKED> Send for CmpRunning<POS, INV, LOCKED>
where POS: Send, INV: Send, PhantomData<LOCKED>: Send,

§

impl<POS, INV, LOCKED> Unpin for CmpRunning<POS, INV, LOCKED>
where POS: Unpin, INV: Unpin, PhantomData<LOCKED>: Unpin,

§

impl<POS, INV, LOCKED> UnsafeUnpin for CmpRunning<POS, INV, LOCKED>
where POS: UnsafeUnpin, INV: UnsafeUnpin, PhantomData<LOCKED>: UnsafeUnpin,

§

impl<POS, INV, LOCKED> UnwindSafe for CmpRunning<POS, INV, LOCKED>
where POS: UnwindSafe, INV: UnwindSafe, PhantomData<LOCKED>: 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.