Mozzi  version v2.0
sound synthesis library for Arduino
known_16bit_timers.h
1 #ifndef known_16bit_timers_header_
2 #define known_16bit_timers_header_
3 /*
4 Part of TimerOne library, modified by Paul S. for Teensy boards.
5 TB2012 added Leonardo section.
6 */
7 
8 // Wiring-S
9 //
10 #if defined(__AVR_ATmega644P__) && defined(WIRING)
11  #define TIMER1_A_PIN 5
12  #define TIMER1_B_PIN 4
13  #define TIMER1_ICP_PIN 6
14 
15 
16 // Teensy 2.0
17 //
18 #elif defined(__AVR_ATmega32U4__) && defined(CORE_TEENSY)
19  #define TIMER1_A_PIN 14
20  #define TIMER1_B_PIN 15
21  #define TIMER1_C_PIN 4
22  #define TIMER1_ICP_PIN 22
23  #define TIMER1_CLK_PIN 11
24  #define TIMER3_A_PIN 9
25  #define TIMER3_ICP_PIN 10
26 
27 
28 // Leonardo - Make sure this is after the (__AVR_ATmega32U4__) && defined(CORE_TEENSY) entry
29  #elif defined(__AVR_ATmega32U4__)
30  #define TIMER1_A_PIN 9
31  #define TIMER1_B_PIN 10
32  #define TIMER1_C_PIN 11
33 
34 
35 // Teensy++ 2.0
36 #elif defined(__AVR_AT90USB1286__) && defined(CORE_TEENSY)
37  #define TIMER1_A_PIN 25
38  #define TIMER1_B_PIN 26
39  #define TIMER1_C_PIN 27
40  #define TIMER1_ICP_PIN 4
41  #define TIMER1_CLK_PIN 6
42  #define TIMER3_A_PIN 16
43  #define TIMER3_B_PIN 15
44  #define TIMER3_C_PIN 14
45  #define TIMER3_ICP_PIN 17
46  #define TIMER3_CLK_PIN 13
47 
48 
49 // Arduino Mega
50 //
51 #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
52  #define TIMER1_A_PIN 11
53  #define TIMER1_B_PIN 12
54  #define TIMER1_C_PIN 13
55  #define TIMER3_A_PIN 5
56  #define TIMER3_B_PIN 2
57  #define TIMER3_C_PIN 3
58  #define TIMER4_A_PIN 6
59  #define TIMER4_B_PIN 7
60  #define TIMER4_C_PIN 8
61  #define TIMER4_ICP_PIN 49
62  #define TIMER5_A_PIN 46
63  #define TIMER5_B_PIN 45
64  #define TIMER5_C_PIN 44
65  #define TIMER3_ICP_PIN 48
66  #define TIMER3_CLK_PIN 47
67 
68 
69 // Arduino Uno, Duemilanove, LilyPad, etc
70 //
71 #elif defined (__AVR_ATmega168__) || defined (__AVR_ATmega328P__)
72  #define TIMER1_A_PIN 9
73  #define TIMER1_B_PIN 10
74  #define TIMER1_ICP_PIN 8
75  #define TIMER1_CLK_PIN 5
76 
77 
78 // Sanguino
79 //
80 #elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__)
81  #define TIMER1_A_PIN 13
82  #define TIMER1_B_PIN 12
83  #define TIMER1_ICP_PIN 14
84  #define TIMER1_CLK_PIN 1
85 
86 #endif
87 
88 #endif