Sistema l'errore da me commesso in fase di conversione...
[bertos.git] / drv / at91 / timer.h
1 /**
2  * \file
3  * <!--
4  * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
5  * This file is part of DevLib - See README.devlib for information.
6  * -->
7  *
8  * \version $Id$
9  *
10  * \author Francesco Sacchi <batt@develer.com>
11  *
12  * \brief Low-level timer module for Atmel AT91 (interface).
13  */
14
15 #ifndef DRV_AT91_TIMER_H
16 #define DRV_AT91_TIMER_H
17
18 #include <appconfig.h>     /* CONFIG_TIMER */
19 #include <cfg/compiler.h>  /* uint8_t */
20 #include <hw_cpu.h>        /* CLOCK_FREQ */
21
22 /**
23  * \name Values for CONFIG_TIMER.
24  *
25  * Select which hardware timer interrupt to use for system clock and softtimers.
26  *
27  * \{
28  */
29 #define TIMER_ON_PIT 1  ///< System timer on Periodic interval timer
30
31 #define TIMER_DEFAULT TIMER_ON_PIT  ///< Default system timer
32 /* \} */
33
34 /*
35  * Hardware dependent timer initialization.
36  */
37 #if (CONFIG_TIMER == TIMER_ON_PIT)
38
39         #define DEFINE_TIMER_ISR     void timer_handler(void)
40         #define TIMER_TICKS_PER_SEC  1000
41         #define TIMER_HW_CNT         FIXME
42
43         /// Type of time expressed in ticks of the hardware high-precision timer
44         typedef uint32_t hptime_t;
45 #else
46
47         #error Unimplemented value for CONFIG_TIMER
48 #endif /* CONFIG_TIMER */
49
50 /** Frequency of the hardware high-precision timer. */
51 #define TIMER_HW_HPTICKS_PER_SEC FIXME
52
53 #endif /* DRV_TIMER_AT91_H */