Contiki-Inga 3.x
xmega_timer.h
1 #ifndef __XMEGA_TIMER_H__
2 #define __XMEGA_TIMER_H__ 1
3 
4 #if F_CPU == 32000000UL
5  #define CLOCK_CONF_SECOND 125
6  #define TIMER_TOP 250
7  #define TIMER_PRESCALE TC_CLKSEL_DIV1024_gc
8 #elif F_CPU == 16000000UL
9  #define CLOCK_CONF_SECOND 125
10  #define TIMER_TOP 500
11  #define TIMER_PRESCALE TC_CLKSEL_DIV256_gc
12 #elif F_CPU == 18000000UL
13  #define CLOCK_CONF_SECOND 375
14  #define TIMER_TOP 750
15  #define TIMER_PRESCALE TC_CLKSEL_DIV64_gc
16 #elif F_CPU == 20000000UL
17  #define CLOCK_CONF_SECOND 125
18  #define TIMER_TOP 625
19  #define TIMER_PRESCALE TC_CLKSEL_DIV256_gc
20 #elif F_CPU == 8000000UL
21  #define CLOCK_CONF_SECOND 125
22  #define TIMER_TOP 250
23  #define TIMER_PRESCALE TC_CLKSEL_DIV256_gc
24 #elif F_CPU == 4000000UL
25  #define CLOCK_CONF_SECOND 125
26  #define TIMER_TOP 250
27  #define TIMER_PRESCALE TC_CLKSEL_DIV256_gc
28 #elif F_CPU == 2000000UL
29  #define CLOCK_CONF_SECOND 125
30  #define TIMER_TOP 250
31  #define TIMER_PRESCALE TC_CLKSEL_DIV64_gc
32 #else
33  #error CPU Frequence Unknown
34 #endif
35 
36 #endif /* #ifndef __XMEGA_TIMER_H__ */