peter@521: /* peter@521: This file is part of CanFestival, a library implementing CanOpen Stack. peter@521: peter@521: Copyright (C): Edouard TISSERANT and Francis DUPIN peter@521: AT91 Port: Peter CHRISTEN peter@521: peter@521: See COPYING file for copyrights details. peter@521: peter@521: This library is free software; you can redistribute it and/or peter@521: modify it under the terms of the GNU Lesser General Public peter@521: License as published by the Free Software Foundation; either peter@521: version 2.1 of the License, or (at your option) any later version. peter@521: peter@521: This library is distributed in the hope that it will be useful, peter@521: but WITHOUT ANY WARRANTY; without even the implied warranty of peter@521: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU peter@521: Lesser General Public License for more details. peter@521: peter@521: You should have received a copy of the GNU Lesser General Public peter@521: License along with this library; if not, write to the Free Software peter@521: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA peter@521: */ peter@521: peter@521: #ifndef __TIMERSCFG_H__ peter@521: #define __TIMERSCFG_H__ peter@521: peter@521: // Whatever your microcontroller, the timer wont work if peter@521: // TIMEVAL is not at least on 32 bits peter@521: #define TIMEVAL UNS32 peter@521: peter@521: // The timer of the AT91 counts from 0000 to 0xFFFF peter@521: #define TIMEVAL_MAX 0xFFFF peter@521: peter@521: // The timer is incrementing every 2.66 us. peter@521: #define MS_TO_TIMEVAL(ms) ((ms) * 375) peter@521: #define US_TO_TIMEVAL(us) ((us) * 3 / 8) peter@521: peter@521: #endif