Struct EPPinToggle

Source
pub struct EPPinToggle<E, P>
where P: OutputPin<Error = E>,
{ /* private fields */ }
Expand description

Implements EmbeddedProfiler by toggling the given pin.

Implementations§

Source§

impl<E, P> EPPinToggle<E, P>
where P: OutputPin<Error = E>,

Source

pub const fn new(pin: P) -> Self

Creates a new EPPinToggle with the given pin.

Source

pub fn free(self) -> P

Consumes EPPinToggle, returning the pin.

Trait Implementations§

Source§

impl<E, P> EmbeddedProfiler for EPPinToggle<E, P>
where P: OutputPin<Error = E>,

Source§

fn read_clock(&self) -> EPInstant

Takes a reading from the clock. Read more
Source§

fn at_start(&self)

Optional function that gets called at the start of the snapshot recording. Read more
Source§

fn at_end(&self)

Optional function that gets called at the end of the snapshot recording.
Source§

fn log_snapshot(&self, _snapshot: &EPSnapshot)

Optionally log the snapshot to some output, like a serial port.
Source§

fn start_snapshot(&self) -> Instant<u32, 1, 1000000>

takes the starting snapshot of a specific trace. Read more
Source§

fn end_snapshot( &self, start: Instant<u32, 1, 1000000>, name: &'static str, ) -> Option<EPSnapshot>

computes the duration of the snapshot given the start time, if there hasn’t been overflow.

Auto Trait Implementations§

§

impl<E, P> !Freeze for EPPinToggle<E, P>

§

impl<E, P> !RefUnwindSafe for EPPinToggle<E, P>

§

impl<E, P> Send for EPPinToggle<E, P>
where P: Send,

§

impl<E, P> !Sync for EPPinToggle<E, P>

§

impl<E, P> Unpin for EPPinToggle<E, P>
where P: Unpin,

§

impl<E, P> UnwindSafe for EPPinToggle<E, P>
where P: 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.