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

Last change on this file since 32 was 20, checked in by markus, 7 years ago

Updated Arduino libraries

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#include <avr/io.h>
28
29//#define USE_TIMERB1        // interferes with PWM on pin 3
30#define USE_TIMERB2        // interferes with PWM on pin 11
31//#define USE_TIMERB0        // interferes with PWM on pin 6
32
33#if !defined(USE_TIMERB1) && !defined(USE_TIMERB2) && !defined(USE_TIMERB0)
34    # error "No timers allowed for Servo"
35    /* Please uncomment a timer above and rebuild */
36#endif
37
38static volatile TCB_t* _timer =
39#if defined(USE_TIMERB0)
40&TCB0;
41#endif
42#if defined(USE_TIMERB1)
43&TCB1;
44#endif
45#if defined(USE_TIMERB2)
46&TCB2;
47#endif
48
49typedef enum {
50    timer0,
51    _Nbr_16timers } timer16_Sequence_t;
52
53
54#endif  /* __SERVO_TIMERS_H__ */
Note: See TracBrowser for help on using the repository browser.