libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
libopencm3 Cortex-M Data Watchpoint and Trace unit More...
Functions | |
bool | dwt_enable_cycle_counter (void) |
DebugTrace Enable the CPU cycle counter. More... | |
uint32_t | dwt_read_cycle_counter (void) |
DebugTrace Read the CPU cycle counter. More... | |
libopencm3 Cortex-M Data Watchpoint and Trace unit
The DWT provides
Which of these features are available is unfortunately implementation defined.
LGPL License Terms libopencm3 License
bool dwt_enable_cycle_counter | ( | void | ) |
DebugTrace Enable the CPU cycle counter.
This function will try to enable the CPU cycle counter that is intended for benchmarking performance of the code. If function fails, the cycle counter isn't available on this architecture.
Definition at line 58 of file dwt.c.
References DWT_CTRL, DWT_CTRL_CYCCNTENA, DWT_CTRL_NOCYCCNT, DWT_CYCCNT, SCS_DEMCR, and SCS_DEMCR_TRCENA.
uint32_t dwt_read_cycle_counter | ( | void | ) |
DebugTrace Read the CPU cycle counter.
This function reads the core cycle counter if it is enabled. It is the fastest clock running on the system.
Definition at line 90 of file dwt.c.
References DWT_CTRL, DWT_CTRL_CYCCNTENA, and DWT_CYCCNT.