pub struct SysTickProfiler<const FREQ: u32> { /* private fields */ }Expand description
systick implementation of EmbeddedProfiler.
The frequency of the systick is encoded using the parameter FREQ.
Implementations§
Source§impl<const FREQ: u32> SysTickProfiler<FREQ>
impl<const FREQ: u32> SysTickProfiler<FREQ>
Sourcepub fn new(systick: SYST, sysclk: u32) -> Self
pub fn new(systick: SYST, sysclk: u32) -> Self
Enable the systick 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 SysTickProfiler<FREQ>
impl<const FREQ: u32> EmbeddedProfiler for SysTickProfiler<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 SysTickProfiler<FREQ>
impl<const FREQ: u32> RefUnwindSafe for SysTickProfiler<FREQ>
impl<const FREQ: u32> Send for SysTickProfiler<FREQ>
impl<const FREQ: u32> !Sync for SysTickProfiler<FREQ>
impl<const FREQ: u32> Unpin for SysTickProfiler<FREQ>
impl<const FREQ: u32> UnwindSafe for SysTickProfiler<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