source: trunk/Arduino/libraries/Servo/src/megaavr/ServoTimers.h @ 4

Last change on this file since 4 was 3, checked in by markus, 7 years ago

Setup project structure

File size: 1.5 KB
Line 
1/*
2  Copyright (c) 2018 Arduino LLC. All right reserved.
3
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8
9  This library 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 GNU
12  Lesser General Public License for more details.
13
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17*/
18
19/*
20 * Defines for 16 bit timers used with Servo library
21 *
22 */
23
24#ifndef __SERVO_TIMERS_H__
25#define __SERVO_TIMERS_H__
26
27#define USE_TIMERB1        // interferes with PWM on pin 3
28//#define USE_TIMERB2        // interferes with PWM on pin 11
29//#define USE_TIMERB0        // interferes with PWM on pin 6
30
31#if !defined(USE_TIMERB1) && !defined(USE_TIMERB2) && !defined(USE_TIMERB0)
32    # error "No timers allowed for Servo"
33    /* Please uncomment a timer above and rebuild */
34#endif
35
36static volatile TCB_t* _timer =
37#if defined(USE_TIMERB0)
38&TCB0;
39#endif
40#if defined(USE_TIMERB1)
41&TCB1;
42#endif
43#if defined(USE_TIMERB2)
44&TCB2;
45#endif
46
47typedef enum {
48    timer0,
49    _Nbr_16timers } timer16_Sequence_t;
50
51
52#endif  /* __SERVO_TIMERS_H__ */
Note: See TracBrowser for help on using the repository browser.