My Marlin configs for Fabrikator Mini and CTC i3 Pro B
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.

pinsDebug_Teensyduino.h 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. *
  18. */
  19. #pragma once
  20. //
  21. // some of the pin mapping functions of the Teensduino extension to the Arduino IDE
  22. // do not function the same as the other Arduino extensions
  23. //
  24. #define TEENSYDUINO_IDE
  25. //digitalPinToTimer(pin) function works like Arduino but Timers are not defined
  26. #define TIMER0B 1
  27. #define TIMER1A 7
  28. #define TIMER1B 8
  29. #define TIMER1C 9
  30. #define TIMER2A 6
  31. #define TIMER2B 2
  32. #define TIMER3A 5
  33. #define TIMER3B 4
  34. #define TIMER3C 3
  35. // digitalPinToPort function just returns the pin number so need to create our own
  36. #define PA 1
  37. #define PB 2
  38. #define PC 3
  39. #define PD 4
  40. #define PE 5
  41. #define PF 6
  42. #undef digitalPinToPort
  43. const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
  44. PD, // 0 - PD0 - INT0 - PWM
  45. PD, // 1 - PD1 - INT1 - PWM
  46. PD, // 2 - PD2 - INT2 - RX
  47. PD, // 3 - PD3 - INT3 - TX
  48. PD, // 4 - PD4
  49. PD, // 5 - PD5
  50. PD, // 6 - PD6
  51. PD, // 7 - PD7
  52. PE, // 8 - PE0
  53. PE, // 9 - PE1
  54. PC, // 10 - PC0
  55. PC, // 11 - PC1
  56. PC, // 12 - PC2
  57. PC, // 13 - PC3
  58. PC, // 14 - PC4 - PWM
  59. PC, // 15 - PC5 - PWM
  60. PC, // 16 - PC6 - PWM
  61. PC, // 17 - PC7
  62. PE, // 18 - PE6 - INT6
  63. PE, // 19 - PE7 - INT7
  64. PB, // 20 - PB0
  65. PB, // 21 - PB1
  66. PB, // 22 - PB2
  67. PB, // 23 - PB3
  68. PB, // 24 - PB4 - PWM
  69. PB, // 25 - PB5 - PWM
  70. PB, // 26 - PB6 - PWM
  71. PB, // 27 - PB7 - PWM
  72. PA, // 28 - PA0
  73. PA, // 29 - PA1
  74. PA, // 30 - PA2
  75. PA, // 31 - PA3
  76. PA, // 32 - PA4
  77. PA, // 33 - PA5
  78. PA, // 34 - PA6
  79. PA, // 35 - PA7
  80. PE, // 36 - PE4 - INT4
  81. PE, // 37 - PE5 - INT5
  82. PF, // 38 - PF0 - A0
  83. PF, // 39 - PF1 - A1
  84. PF, // 40 - PF2 - A2
  85. PF, // 41 - PF3 - A3
  86. PF, // 42 - PF4 - A4
  87. PF, // 43 - PF5 - A5
  88. PF, // 44 - PF6 - A6
  89. PF, // 45 - PF7 - A7
  90. PE, // 46 - PE2 (not defined in teensyduino)
  91. PE, // 47 - PE3 (not defined in teensyduino)
  92. };
  93. #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
  94. // digitalPinToBitMask(pin) is OK
  95. #define digitalRead_mod(p) extDigitalRead(p) // Teensyduino's version of digitalRead doesn't
  96. // disable the PWMs so we can use it as is
  97. // portModeRegister(pin) is OK