source: rtos_arduino/trunk/arduino_lib/libraries/Servo/src/samd/ServoTimersSamd.h@ 136

Last change on this file since 136 was 136, checked in by ertl-honda, 8 years ago

ライブラリとOS及びベーシックなサンプルの追加.

File size: 1.9 KB
Line 
1/*
2 Copyright (c) 2013 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 * If _useTimerX is defined then TimerX is a 16 bit timer on the current board
23 * timer16_Sequence_t enumerates the sequence that the timers should be allocated
24 * _Nbr_16timers indicates how many 16 bit timers are available.
25 */
26
27/**
28 * SAM Only definitions
29 * --------------------
30 */
31
32// For SAMD21G:
33#define _useTimer0
34#define _useTimer1
35#define _useTimer2
36
37
38
39
40#if defined (_useTimer0)
41#define TC_FOR_TIMER0 TCC0
42#define CHANNEL0_FOR_TIMER0 0
43#define CHANNEL1_FOR_TIMER0 1
44#define CHANNEL2_FOR_TIMER0 2
45#define CHANNEL3_FOR_TIMER0 3
46//#define ID_TC_FOR_TIMER1 ID_TC3 //forse non serve
47
48#endif
49#if defined (_useTimer1)
50#define TC_FOR_TIMER1 TCC1
51#define CHANNEL0_FOR_TIMER1 0
52#define CHANNEL1_FOR_TIMER1 1
53//#define ID_TC_FOR_TIMER2 ID_TC4 //forse non serve
54#endif
55
56
57#if defined (_useTimer2)
58#define TC_FOR_TIMER2 TCC2
59#define CHANNEL_FOR_TIMER2 0
60#define CHANNEL_FOR_TIMER2 1
61//#define ID_TC_FOR_TIMER3 ID_TC5 //forse non serve
62
63#endif
64
65#endif
66
67//typedef enum { _timer1, _timer2, _timer3, _timer4, _timer5, _Nbr_16timers } timer16_Sequence_t ; // forse non serve
68
Note: See TracBrowser for help on using the repository browser.