My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

pinsDebug_Teensyduino.h 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2017 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. //
  23. // some of the pin mapping functions of the Teensduino extension to the Arduino IDE
  24. // do not function the same as the other Arduino extensions
  25. //
  26. #define TEENSYDUINO_IDE
  27. //digitalPinToTimer(pin) function works like Arduino but Timers are not defined
  28. #define TIMER0B 1
  29. #define TIMER1A 7
  30. #define TIMER1B 8
  31. #define TIMER1C 9
  32. #define TIMER2A 6
  33. #define TIMER2B 2
  34. #define TIMER3A 5
  35. #define TIMER3B 4
  36. #define TIMER3C 3
  37. // digitalPinToPort function just returns the pin number so need to create our own
  38. #define PA 1
  39. #define PB 2
  40. #define PC 3
  41. #define PD 4
  42. #define PE 5
  43. #define PF 6
  44. #undef digitalPinToPort
  45. const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
  46. PD, // 0 - PD0 - INT0 - PWM
  47. PD, // 1 - PD1 - INT1 - PWM
  48. PD, // 2 - PD2 - INT2 - RX
  49. PD, // 3 - PD3 - INT3 - TX
  50. PD, // 4 - PD4
  51. PD, // 5 - PD5
  52. PD, // 6 - PD6
  53. PD, // 7 - PD7
  54. PE, // 8 - PE0
  55. PE, // 9 - PE1
  56. PC, // 10 - PC0
  57. PC, // 11 - PC1
  58. PC, // 12 - PC2
  59. PC, // 13 - PC3
  60. PC, // 14 - PC4 - PWM
  61. PC, // 15 - PC5 - PWM
  62. PC, // 16 - PC6 - PWM
  63. PC, // 17 - PC7
  64. PE, // 18 - PE6 - INT6
  65. PE, // 19 - PE7 - INT7
  66. PB, // 20 - PB0
  67. PB, // 21 - PB1
  68. PB, // 22 - PB2
  69. PB, // 23 - PB3
  70. PB, // 24 - PB4 - PWM
  71. PB, // 25 - PB5 - PWM
  72. PB, // 26 - PB6 - PWM
  73. PB, // 27 - PB7 - PWM
  74. PA, // 28 - PA0
  75. PA, // 29 - PA1
  76. PA, // 30 - PA2
  77. PA, // 31 - PA3
  78. PA, // 32 - PA4
  79. PA, // 33 - PA5
  80. PA, // 34 - PA6
  81. PA, // 35 - PA7
  82. PE, // 36 - PE4 - INT4
  83. PE, // 37 - PE5 - INT5
  84. PF, // 38 - PF0 - A0
  85. PF, // 39 - PF1 - A1
  86. PF, // 40 - PF2 - A2
  87. PF, // 41 - PF3 - A3
  88. PF, // 42 - PF4 - A4
  89. PF, // 43 - PF5 - A5
  90. PF, // 44 - PF6 - A6
  91. PF, // 45 - PF7 - A7
  92. PE, // 46 - PE2 (not defined in teensyduino)
  93. PE, // 47 - PE3 (not defined in teensyduino)
  94. };
  95. #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
  96. // digitalPinToBitMask(pin) is OK
  97. #define digitalRead_mod(p) digitalRead(p) // Teensyduino's version of digitalRead doesn't
  98. // disable the PWMs so we can use it as is
  99. // portModeRegister(pin) is OK