esp_hal::timer::systimer

Struct AnyComparator

Source
pub struct AnyComparator<'d>(/* private fields */);
Expand description

Any Comparator. Could be either comparator 0, comparator 1, etc.

Trait Implementations§

Source§

impl Comparator for AnyComparator<'_>

Source§

fn channel(&self) -> u8

Returns the comparators number.
Source§

fn set_enable(&self, enable: bool)

Enables/disables the comparator. If enabled, this means it will generate interrupt based on its configuration.
Source§

fn is_enabled(&self) -> bool

Returns true if the comparator has been enabled. This means it will generate interrupt based on its configuration.
Source§

fn set_unit(&self, is_unit0: bool)

Sets the unit this comparator uses as a reference count.
Source§

fn set_mode(&self, mode: ComparatorMode)

Set the mode of the comparator to be either target or periodic.
Source§

fn mode(&self) -> ComparatorMode

Get the current mode of the comparator, which is either target or periodic.
Source§

fn set_period(&self, value: u32)

Set how often the comparator should generate an interrupt when in periodic mode.
Source§

fn set_target(&self, value: u64)

Set when the comparator should generate an interrupt in target mode.
Source§

fn actual_target(&self) -> u64

Get the actual target value of the comparator.
Source§

fn set_interrupt_handler(&self, handler: InterruptHandler)

Set the interrupt handler for this comparator.
Source§

impl<'d> Debug for AnyComparator<'d>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'d, const CHANNEL: u8> From<SpecificComparator<'d, CHANNEL>> for AnyComparator<'d>

Source§

fn from(_value: SpecificComparator<'d, CHANNEL>) -> Self

Converts to this type from the input type.
Source§

impl<'d, const CHANNEL: u8> TryFrom<AnyComparator<'d>> for SpecificComparator<'d, CHANNEL>

Source§

type Error = u8

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

fn try_from(value: AnyComparator<'d>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'d> Freeze for AnyComparator<'d>

§

impl<'d> RefUnwindSafe for AnyComparator<'d>

§

impl<'d> Send for AnyComparator<'d>

§

impl<'d> Sync for AnyComparator<'d>

§

impl<'d> Unpin for AnyComparator<'d>

§

impl<'d> UnwindSafe for AnyComparator<'d>

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.