PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

known_16bit_timers.h 4.0KB

vor 3 Jahren
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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__)
  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. // Sanguino
  106. //
  107. #elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__)
  108. #define TIMER1_A_PIN 13
  109. #define TIMER1_B_PIN 12
  110. #define TIMER1_ICP_PIN 14
  111. #define TIMER1_CLK_PIN 1
  112. // Wildfire - Wicked Devices
  113. //
  114. #elif defined(__AVR_ATmega1284P__) && defined(WILDFIRE_VERSION) && WILDFIRE_VERSION >= 3
  115. #define TIMER1_A_PIN 5 // PD5
  116. #define TIMER1_B_PIN 8 // PD4
  117. #define TIMER1_ICP_PIN 6 // PD6
  118. #define TIMER1_CLK_PIN 23 // PB1
  119. #define TIMER3_A_PIN 12 // PB6
  120. #define TIMER3_B_PIN 13 // PB7
  121. #define TIMER3_ICP_PIN 9 // PB5
  122. #define TIMER3_CLK_PIN 0 // PD0
  123. #elif defined(__AVR_ATmega1284P__) && defined(WILDFIRE_VERSION) && WILDFIRE_VERSION < 3
  124. #define TIMER1_A_PIN 5 // PD5
  125. #define TIMER1_B_PIN 4 // PD4
  126. #define TIMER1_ICP_PIN 6 // PD6
  127. #define TIMER1_CLK_PIN 15 // PB1
  128. #define TIMER3_A_PIN 12 // PB6
  129. #define TIMER3_B_PIN 13 // PB7
  130. #define TIMER3_ICP_PIN 11 // PB5
  131. #define TIMER3_CLK_PIN 0 // PD0
  132. // Mighty-1284 - Maniacbug
  133. //
  134. #elif defined(__AVR_ATmega1284P__)
  135. #define TIMER1_A_PIN 12 // PD5
  136. #define TIMER1_B_PIN 13 // PD4
  137. #define TIMER1_ICP_PIN 14 // PD6
  138. #define TIMER1_CLK_PIN 1 // PB1
  139. #define TIMER3_A_PIN 6 // PB6
  140. #define TIMER3_B_PIN 7 // PB7
  141. #define TIMER3_ICP_PIN 5 // PB5
  142. #define TIMER3_CLK_PIN 8 // PD0
  143. #endif
  144. #endif