Event Recorder  Version 1.0.0
MDK Debugger Views for Status and Event Information
 All Files Functions Macros Groups Pages
Event Recorder - Timer

Functions that access a configurable hardware timer. More...

Functions

uint32_t EventRecorderTimerInit (void)
 Initialize timer hardware. More...
 
uint32_t EventRecorderTimerGet (void)
 Get Time from timer hardware. More...
 

Description

Functions that access a configurable hardware timer.

This section contains user-provided functions, which configure and provide timing information for recorded events. These functions are only used with the Event Recorder is configured for

Todo:
what do we want to say here? sentence inclompete.
Note
ARM Cortex-M3/M4/M7 processors provide a debug timer that can be used during debug. Refer to Debug Exception and Monitor Control Register (DEMCR) for more information.
Todo:
provide different example for an RTC timer

Code Example

void SysTick_Handler (void) {
SysTick_Overflow_Counter++;
SysTick_Overflow_Updated = 1U;
}

Function Documentation

uint32_t EventRecorderTimerGet ( void  )

Get Time from timer hardware.

Returns
timer value (32-bit)

Code Example

uint32_t EventRecorderTimerGet (void) {
uint32_t load;
uint32_t val;
uint32_t ovf;
load = SysTick->LOAD;
do {
SysTick_Overflow_Updated = 0U;
val = SysTick->VAL;
ovf = SysTick_Overflow_Counter;
} while (SysTick_Overflow_Updated != 0U);
return (((load + 1U) * ovf) + (load - val));
}
uint32_t EventRecorderTimerInit ( void  )

Initialize timer hardware.

Returns
timer frequency in Hz

Code Example

uint32_t Event_TimerInit (void) {
SysTick->LOAD = SYSTICK_PERIOD - 1U;
SysTick->VAL = 0U;
SysTick->CTRL = SysTick_CTRL_ENABLE_Msk |
SysTick_CTRL_TICKINT_Msk |
SysTick_CTRL_CLKSOURCE_Msk;
return (SYSTICK_CLOCK);
}