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.9KB

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