2 * Copyright Droids Corporation, Microb Technology, Eirbot (2006)
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.
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.
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
18 * Revision : $Id: timer.h,v 1.1.2.4 2007-05-23 17:18:14 zer0 Exp $
23 * Olivier MATZ - Droids-corp 2006
25 * \brief Interface of the timer module
27 * The objective of this module is to provide a simple and portable
28 * interface to the hardware timers of AVR devices.
34 #include <aversive/parts.h>
37 #include <timer_declarations.h>
38 #include <timer_definitions.h>
39 #include <timer_prescaler.h>
41 #include <timer_config.h>
44 /** Init of all timers with static configutaion (see timer_config.h) */
45 void timer_init(void);
47 /* declare all timer functions (see timer_declarations.h) */
49 #if defined TIMER0_ENABLED && defined TIMER0_AVAILABLE
50 DECLARE_TIMER_FUNCS(0)
53 #if defined TIMER1_ENABLED && defined TIMER1_AVAILABLE
54 DECLARE_TIMER_FUNCS(1)
57 #if defined TIMER2_ENABLED && defined TIMER2_AVAILABLE
58 DECLARE_TIMER_FUNCS(2)
61 #if defined TIMER3_ENABLED && defined TIMER3_AVAILABLE
62 DECLARE_TIMER_FUNCS(3)
65 /* define static inline functions (see timer_definitions.h) */
67 #if defined TIMER0_ENABLED && defined TIMER0_AVAILABLE
68 DEFINE_TIMER_US_CONVERSIONS(0)
71 #if defined TIMER1_ENABLED && defined TIMER1_AVAILABLE
72 DEFINE_TIMER_US_CONVERSIONS(1)
75 #if defined TIMER2_ENABLED && defined TIMER2_AVAILABLE
76 DEFINE_TIMER_US_CONVERSIONS(2)
79 #if defined TIMER3_ENABLED && defined TIMER3_AVAILABLE
80 DEFINE_TIMER_US_CONVERSIONS(3)