DWT

Struct DWT 

pub struct DWT {
    _marker: PhantomData<*const ()>,
}
Expand description

Data Watchpoint and Trace unit

Fields§

§_marker: PhantomData<*const ()>

Implementations§

§

impl DWT

pub fn num_comp() -> u8

Number of comparators implemented

A value of zero indicates no comparator support.

pub fn has_exception_trace() -> bool

Returns true if the the implementation supports sampling and exception tracing

pub fn has_external_match() -> bool

Returns true if the implementation includes external match signals

pub fn has_cycle_counter() -> bool

Returns true if the implementation supports a cycle counter

pub fn has_profiling_counter() -> bool

Returns true if the implementation the profiling counters

pub fn enable_cycle_counter(&mut self)

Enables the cycle counter

The global trace enable (DCB::enable_trace) should be set before enabling the cycle counter, the processor may ignore writes to the cycle counter enable if the global trace is disabled (implementation defined behaviour).

pub fn disable_cycle_counter(&mut self)

Disables the cycle counter

pub fn cycle_counter_enabled() -> bool

Returns true if the cycle counter is enabled

pub fn get_cycle_count() -> u32

👎Deprecated since 0.7.4: Use cycle_count which follows the C-GETTER convention

Returns the current clock cycle count

pub fn cycle_count() -> u32

Returns the current clock cycle count

pub fn set_cycle_count(&mut self, count: u32)

Set the cycle count

pub fn unlock()

Removes the software lock on the DWT

Some devices, like the STM32F7, software lock the DWT after a power cycle.

pub fn cpi_count() -> u8

Get the CPI count

Counts additional cycles required to execute multi-cycle instructions, except those recorded by lsu_count, and counts any instruction fetch stalls.

pub fn set_cpi_count(&mut self, count: u8)

Set the CPI count

pub fn exception_count() -> u8

Get the total cycles spent in exception processing

pub fn set_exception_count(&mut self, count: u8)

Set the exception count

pub fn sleep_count() -> u8

Get the total number of cycles that the processor is sleeping

ARM recommends that this counter counts all cycles when the processor is sleeping, regardless of whether a WFI or WFE instruction, or the sleep-on-exit functionality, caused the entry to sleep mode. However, all sleep features are implementation defined and therefore when this counter counts is implementation defined.

pub fn set_sleep_count(&mut self, count: u8)

Set the sleep count

pub fn lsu_count() -> u8

Get the additional cycles required to execute all load or store instructions

pub fn set_lsu_count(&mut self, count: u8)

Set the lsu count

pub fn fold_count() -> u8

Get the folded instruction count

Increments on each instruction that takes 0 cycles.

pub fn set_fold_count(&mut self, count: u8)

Set the folded instruction count

§

impl DWT

pub const PTR: *const RegisterBlock = {0xe0001000 as *const cortex_m::peripheral::dwt::RegisterBlock}

Pointer to the register block

pub const fn ptr() -> *const RegisterBlock

👎Deprecated since 0.7.5: Use the associated constant PTR instead

Returns a pointer to the register block

Trait Implementations§

§

impl Deref for DWT

§

type Target = RegisterBlock

The resulting type after dereferencing.
§

fn deref(&self) -> &<DWT as Deref>::Target

Dereferences the value.
§

impl Send for DWT

Auto Trait Implementations§

§

impl Freeze for DWT

§

impl RefUnwindSafe 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.