1 #ifndef __XMEGA_TIMER_H__
2 #define __XMEGA_TIMER_H__ 1
4 #if F_CPU == 32000000UL
5 #define CLOCK_CONF_SECOND 125
7 #define TIMER_PRESCALE TC_CLKSEL_DIV1024_gc
8 #elif F_CPU == 16000000UL
9 #define CLOCK_CONF_SECOND 125
11 #define TIMER_PRESCALE TC_CLKSEL_DIV256_gc
12 #elif F_CPU == 18000000UL
13 #define CLOCK_CONF_SECOND 375
15 #define TIMER_PRESCALE TC_CLKSEL_DIV64_gc
16 #elif F_CPU == 20000000UL
17 #define CLOCK_CONF_SECOND 125
19 #define TIMER_PRESCALE TC_CLKSEL_DIV256_gc
20 #elif F_CPU == 8000000UL
21 #define CLOCK_CONF_SECOND 125
23 #define TIMER_PRESCALE TC_CLKSEL_DIV256_gc
24 #elif F_CPU == 4000000UL
25 #define CLOCK_CONF_SECOND 125
27 #define TIMER_PRESCALE TC_CLKSEL_DIV256_gc
28 #elif F_CPU == 2000000UL
29 #define CLOCK_CONF_SECOND 125
31 #define TIMER_PRESCALE TC_CLKSEL_DIV64_gc
33 #error CPU Frequence Unknown