Add dual-license information.
[bertos.git] / drv / timer_i196.h
1 /*!
2  * \file
3  * <!--
4  * Copyright 2000 Bernardo Innocenti
5  * Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/)
6  * This file is part of DevLib - See devlib/README for information.
7  * -->
8  *
9  * \version $Id$
10  *
11  * \author Bernardo Innocenti <bernie@develer.com>
12  *
13  * \brief Low-level timer module for AVR
14  */
15
16 /*
17  * $Log$
18  * Revision 1.2  2004/06/03 11:27:09  bernie
19  * Add dual-license information.
20  *
21  * Revision 1.1  2004/05/23 18:23:30  bernie
22  * Import drv/timer module.
23  *
24  */
25
26 #ifndef TIMER_I196_H
27 #define TIMER_I196_H
28
29         /*!
30          * Retrigger TIMER2, adjusting the time to account for
31          * the interrupt prologue latency.
32          */
33 #       define TIMER_RETRIGGER (TIMER2 -= TICKS_RATE)
34
35 #       define TIMER_INIT \
36                 TIMER2 = (65535 - TICKS_RATE); \
37                 INT_MASK1 |= INT1F_T2OVF; \
38                 \
39                 DISABLE_INTS; \
40                 WSR = 1; \
41                 IOC3 |= IOC3F_T2_ENA; \
42                 WSR = 0; \
43                 ENABLE_INTS
44
45 #define DEFINE_TIMER_ISR \
46         INTERRUPT(0x38) void TM2_OVFL_interrupt(void);  \
47         INTERRUPT(0x38) void TM2_OVFL_interrupt(void)
48
49 #endif /* DRV_TIMER_I196_H */