libopencm3/libopencm3 — pull request #207 by BuFran (2013-09-12 13:26:43+00:00)
Title: Support cpu counter for benchmarking, DWT

Add register definitions for Data Watchpoint and Trace unit
Add suport for benchmarking of code

```C
#include
void main(void)
{
setup_clocks();
if (!dwt_enable_cycle_counter()) {
raise_error_not_supported();
}

uint32_t start = dwt_read_cycle_counter();
benchmarked_function();
uint32_t stop = dwt_read_cycle_counter();
/* the ticks will contain number of ticks spent in benchmarked_function */
int32_t ticks = stop - start;
}
```