PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

190 lines
4.8KB

  1. #ifndef known_16bit_timers_header_
  2. #define known_16bit_timers_header_
  3. // Wiring-S
  4. //
  5. #if defined(__AVR_ATmega644P__) && defined(WIRING)
  6. #define TIMER1_A_PIN 5
  7. #define TIMER1_B_PIN 4
  8. #define TIMER1_ICP_PIN 6
  9. // Teensy 2.0
  10. //
  11. #elif defined(__AVR_ATmega32U4__) && defined(CORE_TEENSY)
  12. #define TIMER1_A_PIN 14
  13. #define TIMER1_B_PIN 15
  14. #define TIMER1_C_PIN 4
  15. #define TIMER1_ICP_PIN 22
  16. #define TIMER1_CLK_PIN 11
  17. #define TIMER3_A_PIN 9
  18. #define TIMER3_ICP_PIN 10
  19. // Teensy++ 2.0
  20. #elif defined(__AVR_AT90USB1286__) && defined(CORE_TEENSY)
  21. #define TIMER1_A_PIN 25
  22. #define TIMER1_B_PIN 26
  23. #define TIMER1_C_PIN 27
  24. #define TIMER1_ICP_PIN 4
  25. #define TIMER1_CLK_PIN 6
  26. #define TIMER3_A_PIN 16
  27. #define TIMER3_B_PIN 15
  28. #define TIMER3_C_PIN 14
  29. #define TIMER3_ICP_PIN 17
  30. #define TIMER3_CLK_PIN 13
  31. // Teensy 3.0
  32. //
  33. #elif defined(__MK20DX128__)
  34. #define TIMER1_A_PIN 3
  35. #define TIMER1_B_PIN 4
  36. #define TIMER1_ICP_PIN 4
  37. // Teensy 3.1 / Teensy 3.2
  38. //
  39. #elif defined(__MK20DX256__)
  40. #define TIMER1_A_PIN 3
  41. #define TIMER1_B_PIN 4
  42. #define TIMER1_ICP_PIN 4
  43. #define TIMER3_A_PIN 32
  44. #define TIMER3_B_PIN 25
  45. #define TIMER3_ICP_PIN 32
  46. // Teensy 3.5 / Teensy 3.6
  47. //
  48. #elif defined(__MK64FX512__) || defined(__MK66FX1M0__)
  49. #define TIMER1_A_PIN 3
  50. #define TIMER1_B_PIN 4
  51. #define TIMER1_ICP_PIN 4
  52. #define TIMER3_A_PIN 29
  53. #define TIMER3_B_PIN 30
  54. #define TIMER3_ICP_PIN 29
  55. // Teensy-LC
  56. //
  57. #elif defined(__MKL26Z64__)
  58. #define TIMER1_A_PIN 16
  59. #define TIMER1_B_PIN 17
  60. #define TIMER1_ICP_PIN 17
  61. #define TIMER3_A_PIN 3
  62. #define TIMER3_B_PIN 4
  63. #define TIMER3_ICP_PIN 4
  64. // Teensy 4.0
  65. //
  66. #elif defined(__IMXRT1062__)
  67. #define TIMER1_A_PIN 7
  68. #define TIMER1_B_PIN 8
  69. #define TIMER3_A_PIN 9
  70. #define TIMER3_B_PIN 6
  71. // Arduino Mega
  72. //
  73. #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  74. #define TIMER1_A_PIN 11
  75. #define TIMER1_B_PIN 12
  76. #define TIMER3_A_PIN 5
  77. #define TIMER3_B_PIN 2
  78. #define TIMER3_C_PIN 3
  79. #define TIMER4_A_PIN 6
  80. #define TIMER4_B_PIN 7
  81. #define TIMER4_C_PIN 8
  82. #define TIMER4_ICP_PIN 49
  83. #define TIMER5_A_PIN 46
  84. #define TIMER5_B_PIN 45
  85. #define TIMER5_C_PIN 44
  86. #define TIMER3_ICP_PIN 48
  87. #define TIMER3_CLK_PIN 47
  88. // Arduino Leonardo, Yun, etc
  89. //
  90. #elif defined(__AVR_ATmega32U4__)
  91. #define TIMER1_A_PIN 9
  92. #define TIMER1_B_PIN 10
  93. #define TIMER1_C_PIN 11
  94. #define TIMER1_ICP_PIN 4
  95. #define TIMER1_CLK_PIN 12
  96. #define TIMER3_A_PIN 5
  97. #define TIMER3_ICP_PIN 13
  98. // Uno, Duemilanove, LilyPad, etc
  99. //
  100. #elif defined (__AVR_ATmega168__) || defined (__AVR_ATmega328P__) || defined (__AVR_ATmega328__) || defined (__AVR_ATmega8__)
  101. #define TIMER1_A_PIN 9
  102. #define TIMER1_B_PIN 10
  103. #define TIMER1_ICP_PIN 8
  104. #define TIMER1_CLK_PIN 5
  105. // Minicore generic
  106. //
  107. #elif defined(__AVR_ATmega48PB__) || defined(__AVR_ATmega88PB__) || defined(__AVR_ATmega168PB__)
  108. #define TIMER1_A_PIN 9
  109. #define TIMER1_B_PIN 10
  110. #define TIMER1_ICP_PIN 8
  111. #define TIMER1_CLK_PIN 5
  112. #elif defined(__AVR_ATmega328PB__)
  113. #define TIMER1_A_PIN 9
  114. #define TIMER1_B_PIN 10
  115. #define TIMER1_ICP_PIN 8
  116. #define TIMER1_CLK_PIN 5
  117. #define TIMER3_A_PIN 0
  118. #define TIMER3_B_PIN 2
  119. #define TIMER3_ICP_PIN 25
  120. #define TIMER3_CLK_PIN 26
  121. #define TIMER4_A_PIN 1
  122. #define TIMER4_B_PIN 2
  123. #define TIMER4_ICP_PIN 23
  124. #define TIMER4_CLK_PIN 24
  125. // attiny167
  126. //
  127. #elif defined (__AVR_ATtiny167__)
  128. #define TIMER1_A_PIN 14
  129. #define TIMER1_B_PIN 11
  130. //#define TIMER1_ICP_PIN 8
  131. //#define TIMER1_CLK_PIN 5
  132. // Sanguino
  133. //
  134. #elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__)
  135. #define TIMER1_A_PIN 13
  136. #define TIMER1_B_PIN 12
  137. #define TIMER1_ICP_PIN 14
  138. #define TIMER1_CLK_PIN 1
  139. // Wildfire - Wicked Devices
  140. //
  141. #elif defined(__AVR_ATmega1284P__) && defined(WILDFIRE_VERSION) && WILDFIRE_VERSION >= 3
  142. #define TIMER1_A_PIN 5 // PD5
  143. #define TIMER1_B_PIN 8 // PD4
  144. #define TIMER1_ICP_PIN 6 // PD6
  145. #define TIMER1_CLK_PIN 23 // PB1
  146. #define TIMER3_A_PIN 12 // PB6
  147. #define TIMER3_B_PIN 13 // PB7
  148. #define TIMER3_ICP_PIN 9 // PB5
  149. #define TIMER3_CLK_PIN 0 // PD0
  150. #elif defined(__AVR_ATmega1284P__) && defined(WILDFIRE_VERSION) && WILDFIRE_VERSION < 3
  151. #define TIMER1_A_PIN 5 // PD5
  152. #define TIMER1_B_PIN 4 // PD4
  153. #define TIMER1_ICP_PIN 6 // PD6
  154. #define TIMER1_CLK_PIN 15 // PB1
  155. #define TIMER3_A_PIN 12 // PB6
  156. #define TIMER3_B_PIN 13 // PB7
  157. #define TIMER3_ICP_PIN 11 // PB5
  158. #define TIMER3_CLK_PIN 0 // PD0
  159. // Mighty-1284 - Maniacbug
  160. //
  161. #elif defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega1284__)
  162. #define TIMER1_A_PIN 12 // PD5
  163. #define TIMER1_B_PIN 13 // PD4
  164. #define TIMER1_ICP_PIN 14 // PD6
  165. #define TIMER1_CLK_PIN 1 // PB1
  166. #define TIMER3_A_PIN 6 // PB6
  167. #define TIMER3_B_PIN 7 // PB7
  168. #define TIMER3_ICP_PIN 5 // PB5
  169. #define TIMER3_CLK_PIN 8 // PD0
  170. #endif
  171. #endif