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_init.c,v 1.1.2.4 2009-01-30 20:18:36 zer0 Exp $
22 #include <aversive/timers.h>
24 #include <timer_intr.h>
25 #include <timer_prescaler.h>
27 #include <timer_config.h>
29 /** Init of all timers with static configutaion (see timer_config.h) */
37 #if defined TIMER0_ENABLED && defined TIMER0_AVAILABLE
38 CS00_REG = __timer0_div_to_reg(TIMER0_PRESCALER_DIV) << CS00 ;
41 #if defined TIMER1_ENABLED && defined TIMER1_AVAILABLE
42 CS10_REG = __timer1_div_to_reg(TIMER1_PRESCALER_DIV) << CS10 ;
45 #if defined TIMER2_ENABLED && defined TIMER2_AVAILABLE
46 CS20_REG = __timer2_div_to_reg(TIMER2_PRESCALER_DIV) << CS20 ;
49 #if defined TIMER3_ENABLED && defined TIMER3_AVAILABLE
50 CS30_REG = __timer3_div_to_reg(TIMER3_PRESCALER_DIV) << CS30 ;
53 #if defined TIMER4_ENABLED && defined TIMER4_AVAILABLE
54 CS40_REG = __timer4_div_to_reg(TIMER4_PRESCALER_DIV) << CS40 ;
57 #if defined TIMER5_ENABLED && defined TIMER5_AVAILABLE
58 CS50_REG = __timer5_div_to_reg(TIMER5_PRESCALER_DIV) << CS50 ;