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.

156 lines
4.3KB

  1. #if defined(KINETISK)
  2. #define F_TIMER F_BUS
  3. #elif defined(KINETISL)
  4. #if F_CPU > 16000000
  5. #define F_TIMER (F_PLL/2)
  6. #else
  7. #define F_TIMER (F_PLL)
  8. #endif//Low Power
  9. #endif
  10. #if defined(KINETISK)
  11. #define DEFAULT_FTM_02_MOD (4096 - 1)
  12. #elif defined(KINETISL)
  13. #define DEFAULT_FTM_02_MOD (4096 - 1)
  14. #endif
  15. #define DEFAULT_FTM_02_PRESCALE 0
  16. #if F_TIMER == 120000000
  17. #define DEFAULT_FTM_MOD (61440 - 1)
  18. #define DEFAULT_FTM_PRESCALE 2
  19. #elif F_TIMER == 108000000
  20. #define DEFAULT_FTM_MOD (55296 - 1)
  21. #define DEFAULT_FTM_PRESCALE 2
  22. #elif F_TIMER == 96000000
  23. #define DEFAULT_FTM_MOD (49152 - 1)
  24. #define DEFAULT_FTM_PRESCALE 2
  25. #elif F_TIMER == 90000000
  26. #define DEFAULT_FTM_MOD (46080 - 1)
  27. #define DEFAULT_FTM_PRESCALE 2
  28. #elif F_TIMER == 80000000
  29. #define DEFAULT_FTM_MOD (40960 - 1)
  30. #define DEFAULT_FTM_PRESCALE 2
  31. #elif F_TIMER == 72000000
  32. #define DEFAULT_FTM_MOD (36864 - 1)
  33. #define DEFAULT_FTM_PRESCALE 2
  34. #elif F_TIMER == 64000000
  35. #define DEFAULT_FTM_MOD (65536 - 1)
  36. #define DEFAULT_FTM_PRESCALE 1
  37. #elif F_TIMER == 60000000
  38. #define DEFAULT_FTM_MOD (61440 - 1)
  39. #define DEFAULT_FTM_PRESCALE 1
  40. #elif F_TIMER == 56000000
  41. #define DEFAULT_FTM_MOD (57344 - 1)
  42. #define DEFAULT_FTM_PRESCALE 1
  43. #elif F_TIMER == 54000000
  44. #define DEFAULT_FTM_MOD (55296 - 1)
  45. #define DEFAULT_FTM_PRESCALE 1
  46. #elif F_TIMER == 48000000
  47. #define DEFAULT_FTM_MOD (49152 - 1)
  48. #define DEFAULT_FTM_PRESCALE 1
  49. #elif F_TIMER == 40000000
  50. #define DEFAULT_FTM_MOD (40960 - 1)
  51. #define DEFAULT_FTM_PRESCALE 1
  52. #elif F_TIMER == 36000000
  53. #define DEFAULT_FTM_MOD (36864 - 1)
  54. #define DEFAULT_FTM_PRESCALE 1
  55. #elif F_TIMER == 24000000
  56. #define DEFAULT_FTM_MOD (49152 - 1)
  57. #define DEFAULT_FTM_PRESCALE 0
  58. #elif F_TIMER == 16000000
  59. #define DEFAULT_FTM_MOD (32768 - 1)
  60. #define DEFAULT_FTM_PRESCALE 0
  61. #elif F_TIMER == 8000000
  62. #define DEFAULT_FTM_MOD (16384 - 1)
  63. #define DEFAULT_FTM_PRESCALE 0
  64. #elif F_TIMER == 4000000
  65. #define DEFAULT_FTM_MOD (8192 - 1)
  66. #define DEFAULT_FTM_PRESCALE 0
  67. #elif F_TIMER == 2000000
  68. #define DEFAULT_FTM_MOD (4096 - 1)
  69. #define DEFAULT_FTM_PRESCALE 0
  70. #endif
  71. #if defined(__MK20DX128__)
  72. #define FTM0_CH0_PIN 22
  73. #define FTM0_CH1_PIN 23
  74. #define FTM0_CH2_PIN 9
  75. #define FTM0_CH3_PIN 10
  76. #define FTM0_CH4_PIN 6
  77. #define FTM0_CH5_PIN 20
  78. #define FTM0_CH6_PIN 21
  79. #define FTM0_CH7_PIN 5
  80. #define FTM1_CH0_PIN 3
  81. #define FTM1_CH1_PIN 4
  82. #elif defined(__MK20DX256__)
  83. #define FTM0_CH0_PIN 22
  84. #define FTM0_CH1_PIN 23
  85. #define FTM0_CH2_PIN 9
  86. #define FTM0_CH3_PIN 10
  87. #define FTM0_CH4_PIN 6
  88. #define FTM0_CH5_PIN 20
  89. #define FTM0_CH6_PIN 21
  90. #define FTM0_CH7_PIN 5
  91. #define FTM1_CH0_PIN 3
  92. #define FTM1_CH1_PIN 4
  93. #define FTM2_CH0_PIN 32
  94. #define FTM2_CH1_PIN 25
  95. #elif defined(__MKL26Z64__)
  96. #define FTM0_CH0_PIN 22
  97. #define FTM0_CH1_PIN 23
  98. #define FTM0_CH2_PIN 9
  99. #define FTM0_CH3_PIN 10
  100. #define FTM0_CH4_PIN 6
  101. #define FTM0_CH5_PIN 20
  102. #define FTM1_CH0_PIN 16
  103. #define FTM1_CH1_PIN 17
  104. #define FTM2_CH0_PIN 3
  105. #define FTM2_CH1_PIN 4
  106. #elif defined(__MK64FX512__)
  107. #define FTM0_CH0_PIN 22
  108. #define FTM0_CH1_PIN 23
  109. #define FTM0_CH2_PIN 9
  110. #define FTM0_CH3_PIN 10
  111. #define FTM0_CH4_PIN 6
  112. #define FTM0_CH5_PIN 20
  113. #define FTM0_CH6_PIN 21
  114. #define FTM0_CH7_PIN 5
  115. #define FTM1_CH0_PIN 3
  116. #define FTM1_CH1_PIN 4
  117. #define FTM2_CH0_PIN 29
  118. #define FTM2_CH1_PIN 30
  119. #define FTM3_CH0_PIN 2
  120. #define FTM3_CH1_PIN 14
  121. #define FTM3_CH2_PIN 7
  122. #define FTM3_CH3_PIN 8
  123. #define FTM3_CH4_PIN 35
  124. #define FTM3_CH5_PIN 36
  125. #define FTM3_CH6_PIN 37
  126. #define FTM3_CH7_PIN 38
  127. #elif defined(__MK66FX1M0__)
  128. #define FTM0_CH0_PIN 22
  129. #define FTM0_CH1_PIN 23
  130. #define FTM0_CH2_PIN 9
  131. #define FTM0_CH3_PIN 10
  132. #define FTM0_CH4_PIN 6
  133. #define FTM0_CH5_PIN 20
  134. #define FTM0_CH6_PIN 21
  135. #define FTM0_CH7_PIN 5
  136. #define FTM1_CH0_PIN 3
  137. #define FTM1_CH1_PIN 4
  138. #define FTM2_CH0_PIN 29
  139. #define FTM2_CH1_PIN 30
  140. #define FTM3_CH0_PIN 2
  141. #define FTM3_CH1_PIN 14
  142. #define FTM3_CH2_PIN 7
  143. #define FTM3_CH3_PIN 8
  144. #define FTM3_CH4_PIN 35
  145. #define FTM3_CH5_PIN 36
  146. #define FTM3_CH6_PIN 37
  147. #define FTM3_CH7_PIN 38
  148. #define TPM1_CH0_PIN 16
  149. #define TPM1_CH1_PIN 17
  150. #endif