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: multiservo_config.h,v 1.3.4.1 2006-11-26 21:06:05 zer0 Exp $
23 #ifndef _MULTISERVO_CONFIG_H_
24 #define _MULTISERVO_CONFIG_H_
26 /** we need one timer, can be 0, 1, 2, 3 (depending on arch) */
27 #define MULTISERVO_TIMER 2
29 /* You should specify the config for prescaler
30 * It is in TCCRnB for 16 bits timer or in TCCRn for
31 * 8 bits timer. See the doc of your AVR device.
32 * This is not automatic because it would be too complicated.
34 * Example (for timer 3, prescaler 1) :
36 * #define MULTISERVO_TIMER_PRESCALER 1
37 * #define MULTISERVO_TIMER_PRESCALER_CONFIG (1 << CS30)
39 * Another example (for timer 2, prescaler 32) :
41 * #define MULTISERVO_TIMER_PRESCALER 128
42 * #define MULTISERVO_TIMER_PRESCALER_CONFIG ((1 << CS22) | (1 << CS20))
44 * XXX : currently, the user has to choose a good prescaler
45 * value. A good prescaler value is the more precise value
46 * (the highest) that can count during 2 ms.
49 /* this is ok for atm 32... */
50 #define MULTISERVO_TIMER_PRESCALER 256
51 #define MULTISERVO_TIMER_PRESCALER_CONFIG ((1 << CS22) | (1 << CS21))
53 #define MULTISERVO_NB_MAX 4