Struct cortex_m::peripheral::DWT

source ·
pub struct DWT { /* private fields */ }
Expand description

Data Watchpoint and Trace unit

Implementations§

source§

impl DWT

source

pub fn num_comp() -> u8

Number of comparators implemented

A value of zero indicates no comparator support.

source

pub fn has_exception_trace() -> bool

Returns true if the the implementation supports sampling and exception tracing

source

pub fn has_external_match() -> bool

Returns true if the implementation includes external match signals

source

pub fn has_cycle_counter() -> bool

Returns true if the implementation supports a cycle counter

source

pub fn has_profiling_counter() -> bool

Returns true if the implementation the profiling counters

source

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).

source

pub fn disable_cycle_counter(&mut self)

Disables the cycle counter

source

pub fn cycle_counter_enabled() -> bool

Returns true if the cycle counter is enabled

source

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

source

pub fn cycle_count() -> u32

Returns the current clock cycle count

source

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

Set the cycle count

source

pub fn unlock()

Removes the software lock on the DWT

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

source

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.

source

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

Set the CPI count

source

pub fn exception_count() -> u8

Get the total cycles spent in exception processing

source

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

Set the exception count

source

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.

source

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

Set the sleep count

source

pub fn lsu_count() -> u8

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

source

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

Set the lsu count

source

pub fn fold_count() -> u8

Get the folded instruction count

Increments on each instruction that takes 0 cycles.

source

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

Set the folded instruction count

source§

impl DWT

source

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

Pointer to the register block

source

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§

source§

impl Deref for DWT

§

type Target = RegisterBlock

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

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