4 * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
5 * This file is part of DevLib - See README.devlib for information.
10 * \author Francesco Sacchi <batt@develer.com>
12 * \brief Low-level timer module for Atmel AT91 (interface).
15 #ifndef DRV_AT91_TIMER_H
16 #define DRV_AT91_TIMER_H
18 #include <appconfig.h> /* CONFIG_TIMER */
19 #include <cfg/compiler.h> /* uint8_t */
20 #include <hw_cpu.h> /* CLOCK_FREQ */
23 * \name Values for CONFIG_TIMER.
25 * Select which hardware timer interrupt to use for system clock and softtimers.
29 #define TIMER_ON_PIT 1 ///< System timer on Periodic interval timer
31 #define TIMER_DEFAULT TIMER_ON_PIT ///< Default system timer
35 * Hardware dependent timer initialization.
37 #if (CONFIG_TIMER == TIMER_ON_PIT)
39 #define DEFINE_TIMER_ISR void timer_handler(void)
40 #define TIMER_TICKS_PER_SEC 1000
41 #define TIMER_HW_CNT FIXME
43 /// Type of time expressed in ticks of the hardware high-precision timer
44 typedef uint32_t hptime_t;
47 #error Unimplemented value for CONFIG_TIMER
48 #endif /* CONFIG_TIMER */
50 /** Frequency of the hardware high-precision timer. */
51 #define TIMER_HW_HPTICKS_PER_SEC FIXME
53 #endif /* DRV_TIMER_AT91_H */