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>
impl<const FREQ: u32> DwtProfiler<FREQ>
Sourcepub fn new(dcb: &mut DCB, dwt: DWT, sysclk: u32) -> Self
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>
impl<const FREQ: u32> EmbeddedProfiler for DwtProfiler<FREQ>
Source§fn read_clock(&self) -> EPInstant
fn read_clock(&self) -> EPInstant
Takes a reading from the clock. Read more
Source§fn log_snapshot(&self, snapshot: &EPSnapshot)
fn log_snapshot(&self, snapshot: &EPSnapshot)
Optionally log the snapshot to some output, like a serial port.
Source§fn at_start(&self)
fn at_start(&self)
Optional function that gets called at the start of the snapshot recording. Read more
Source§fn start_snapshot(&self) -> Instant<u64, 1, 1000000>
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>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more