vt100: include pgmspace.h as we use PROGMEM macro
[aversive.git] / modules / hardware / timer / timer.h
1 /*  
2  *  Copyright Droids Corporation, Microb Technology, Eirbot (2006)
3  * 
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  *  Revision : $Id: timer.h,v 1.1.2.4 2007-05-23 17:18:14 zer0 Exp $
19  *
20  */
21
22 /** 
23  *  Olivier MATZ - Droids-corp 2006
24  * 
25  *  \brief Interface of the timer module
26  * 
27  *  The objective of this module is to provide a simple and portable
28  *  interface to the hardware timers of AVR devices.
29  */
30
31 #ifndef _TIMER_H_
32 #define _TIMER_H_
33
34 #include <aversive/parts.h>
35
36 #include <aversive.h>
37 #include <timer_declarations.h>
38 #include <timer_definitions.h>
39 #include <timer_prescaler.h>
40
41 #include <timer_config.h>
42
43
44 /** Init of all timers with static configutaion (see timer_config.h) */
45 void timer_init(void);
46
47 /* declare all timer functions (see timer_declarations.h) */
48
49 #if defined TIMER0_ENABLED && defined TIMER0_AVAILABLE
50 DECLARE_TIMER_FUNCS(0)
51 #endif
52
53 #if defined TIMER1_ENABLED && defined TIMER1_AVAILABLE
54 DECLARE_TIMER_FUNCS(1)
55 #endif
56
57 #if defined TIMER2_ENABLED && defined TIMER2_AVAILABLE
58 DECLARE_TIMER_FUNCS(2)
59 #endif
60
61 #if defined TIMER3_ENABLED && defined TIMER3_AVAILABLE
62 DECLARE_TIMER_FUNCS(3)
63 #endif
64
65 /* define static inline functions (see timer_definitions.h) */
66
67 #if defined TIMER0_ENABLED && defined TIMER0_AVAILABLE
68 DEFINE_TIMER_US_CONVERSIONS(0)
69 #endif
70
71 #if defined TIMER1_ENABLED && defined TIMER1_AVAILABLE
72 DEFINE_TIMER_US_CONVERSIONS(1)
73 #endif
74
75 #if defined TIMER2_ENABLED && defined TIMER2_AVAILABLE
76 DEFINE_TIMER_US_CONVERSIONS(2)
77 #endif
78
79 #if defined TIMER3_ENABLED && defined TIMER3_AVAILABLE
80 DEFINE_TIMER_US_CONVERSIONS(3)
81 #endif
82
83 #endif