KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
timer.h
Go to the documentation of this file.
1 /*
2  * KM3NeT CLB v2 Firmware
3  *
4  * Copyright 2013 KM3NeT Collaboration
5  *
6  * All Rights Reserved.
7  *
8  * timer.h
9  *
10  * Created on: 16 jul. 2013
11  * Author: Vincent van Beveren
12  */
13 
14 
15 #ifndef TIMER_H_
16 #define TIMER_H_
17 
18 /**
19  * @file
20  *
21  * @ingroup kernel
22  *
23  * @todo describe timer module
24  */
25 
26 #include <stdint.h>
27 
28 #include "cfg_soc.h"
29 
30 #define TIMER_SECT_COUNT 3 ///< No of timers to add
31 #define TIMER_SUM_SECS 5 ///< No of seconds to sum
32 
33 #define TIMER_SECT_IDLE 0 ///< time spend being idle
34 #define TIMER_SECT_TASK 1 ///< time spend executing a task
35 #define TIMER_SECT_IRQ 2 ///< time spend in IRQs
36 
37 #define TIMER_MAX_COUNT ( TIMER_SUM_SECS * 1000 )
38 
39 #if TIMER_MAX_COUNT > 0xFFFFFFFF
40 #error "Possible timer value overflow, please decrease sum seconds"
41 #endif
42 
43 /**
44  * Initializes the timer.
45  */
46 void timerInit();
47 
48 /**
49  * Starts the timing of a new section, the previous section is returned, or -1 if it is the first
50  */
51 int timerMark(int section);
52 
53 /**
54  * Returns
55  * @return
56  */
57 uint32_t * timerValues();
58 
59 #endif /* TIMER_H_ */
Defines the configuration of the LM32 SOC for the CLBv2.
int timerMark(int section)
Starts the timing of a new section, the previous section is returned, or -1 if it is the first...
Definition: timer.c:53
uint32_t * timerValues()
Returns.
Definition: timer.c:71
void timerInit()
Initializes the timer.
Definition: timer.c:27