Struct cortexm4f::dwt::Dwt

source ·
pub struct Dwt { /* private fields */ }

Implementations§

source§

impl Dwt

source

pub const fn new() -> Dwt

source

pub fn is_cycle_counter_present(&self) -> bool

Returns wether a cycle counter is present on the chip.

Trait Implementations§

source§

impl CycleCounter for Dwt

source§

fn start(&self)

Enable and start the cycle counter. Depending on the underlying hardware, it may be necessary to call reset before starting the cycle counter for the first time to get accurate results.
source§

fn stop(&self)

Stop the cycle counter. Does nothing if the cycle counter is not present.
source§

fn count(&self) -> u64

Return the current value of the cycle counter.
source§

fn reset(&self)

Reset the counter to zero and stop the cycle counter.
source§

fn profile_closure<F>(&self, f: F) -> u64
where F: FnOnce(),

Benchmark the number of cycles to run a passed closure. This function is intended for use debugging in-kernel routines.

Auto Trait Implementations§

§

impl Freeze for Dwt

§

impl !RefUnwindSafe for Dwt

§

impl !Send for Dwt

§

impl !Sync for Dwt

§

impl Unpin for Dwt

§

impl !UnwindSafe for Dwt

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>,

§

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>,

§

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.