DwtProfiler

Struct DwtProfiler 

Source
pub struct DwtProfiler<const FREQ: u32> { /* private fields */ }
Expand description

DWT trace unit implementing EmbeddedProfiler.

The frequency of the DWT is encoded using the parameter FREQ.

Implementations§

Source§

impl<const FREQ: u32> DwtProfiler<FREQ>

Source

pub fn new(dcb: &mut DCB, dwt: DWT, sysclk: u32) -> Self

Enable the DWT and provide a new EmbeddedProfiler.

Note that the sysclk parameter should come from e.g. the HAL’s clock generation function so the real speed and the declared speed can be compared.

§Panics

asserts that the compile time constant FREQ matches the runtime provided sysclk

Trait Implementations§

Source§

impl<const FREQ: u32> EmbeddedProfiler for DwtProfiler<FREQ>

Source§

fn read_clock(&self) -> EPInstant

Takes a reading from the clock. Read more
Source§

fn log_snapshot(&self, snapshot: &EPSnapshot)

Optionally log the snapshot to some output, like a serial port.
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 start_snapshot(&self) -> Instant<u64, 1, 1000000>

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

fn end_snapshot( &self, start: Instant<u64, 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<const FREQ: u32> Freeze for DwtProfiler<FREQ>

§

impl<const FREQ: u32> RefUnwindSafe for DwtProfiler<FREQ>

§

impl<const FREQ: u32> Send for DwtProfiler<FREQ>

§

impl<const FREQ: u32> !Sync for DwtProfiler<FREQ>

§

impl<const FREQ: u32> Unpin for DwtProfiler<FREQ>

§

impl<const FREQ: u32> UnwindSafe for DwtProfiler<FREQ>

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.