X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fat91%2Ftimer.h;fp=drv%2Fat91%2Ftimer.h;h=ca3ccdfc455d14142d3ef6d02f436734bb4c0f00;hb=338e860b340dd66f9f6ec92e692a7aa116b0d6a8;hp=0000000000000000000000000000000000000000;hpb=0b8a2bfb0f6c98c436f9ca5070e4ccfad4277059;p=bertos.git diff --git a/drv/at91/timer.h b/drv/at91/timer.h new file mode 100755 index 00000000..ca3ccdfc --- /dev/null +++ b/drv/at91/timer.h @@ -0,0 +1,53 @@ +/** + * \file + * + * + * \version $Id$ + * + * \author Francesco Sacchi + * + * \brief Low-level timer module for Atmel AT91 (interface). + */ + +#ifndef DRV_AT91_TIMER_H +#define DRV_AT91_TIMER_H + +#include /* CONFIG_TIMER */ +#include /* uint8_t */ +#include /* CLOCK_FREQ */ + +/** + * \name Values for CONFIG_TIMER. + * + * Select which hardware timer interrupt to use for system clock and softtimers. + * + * \{ + */ +#define TIMER_ON_PIT 1 ///< System timer on Periodic interval timer + +#define TIMER_DEFAULT TIMER_ON_PIT ///< Default system timer +/* \} */ + +/* + * Hardware dependent timer initialization. + */ +#if (CONFIG_TIMER == TIMER_ON_PIT) + + #define DEFINE_TIMER_ISR void timer_handler(void) + #define TIMER_TICKS_PER_SEC 1000 + #define TIMER_HW_CNT FIXME + + /// Type of time expressed in ticks of the hardware high-precision timer + typedef uint32_t hptime_t; +#else + + #error Unimplemented value for CONFIG_TIMER +#endif /* CONFIG_TIMER */ + +/** Frequency of the hardware high-precision timer. */ +#define TIMER_HW_HPTICKS_PER_SEC FIXME + +#endif /* DRV_TIMER_AT91_H */