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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. #ifndef __PINSDEBUG_TEENSYDUINO_H__
  27. #define __PINSDEBUG_TEENSYDUINO_H__
  28. #undef NUM_DIGITAL_PINS
  29. #define NUM_DIGITAL_PINS 48 // Teensy says 46 but FASTIO is 48
  30. // "digitalPinToPort" function just returns the pin number so need to create our own.
  31. // Can't use the name "digitalPinToPort" for our own because it interferes with the
  32. // FAST_PWM_FAN function if we do
  33. #define PA 1
  34. #define PB 2
  35. #define PC 3
  36. #define PD 4
  37. #define PE 5
  38. #define PF 6
  39. const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = {
  40. PD, // 0 - PD0 - INT0 - PWM
  41. PD, // 1 - PD1 - INT1 - PWM
  42. PD, // 2 - PD2 - INT2 - RX
  43. PD, // 3 - PD3 - INT3 - TX
  44. PD, // 4 - PD4
  45. PD, // 5 - PD5
  46. PD, // 6 - PD6
  47. PD, // 7 - PD7
  48. PE, // 8 - PE0
  49. PE, // 9 - PE1
  50. PC, // 10 - PC0
  51. PC, // 11 - PC1
  52. PC, // 12 - PC2
  53. PC, // 13 - PC3
  54. PC, // 14 - PC4 - PWM
  55. PC, // 15 - PC5 - PWM
  56. PC, // 16 - PC6 - PWM
  57. PC, // 17 - PC7
  58. PE, // 18 - PE6 - INT6
  59. PE, // 19 - PE7 - INT7
  60. PB, // 20 - PB0
  61. PB, // 21 - PB1
  62. PB, // 22 - PB2
  63. PB, // 23 - PB3
  64. PB, // 24 - PB4 - PWM
  65. PB, // 25 - PB5 - PWM
  66. PB, // 26 - PB6 - PWM
  67. PB, // 27 - PB7 - PWM
  68. PA, // 28 - PA0
  69. PA, // 29 - PA1
  70. PA, // 30 - PA2
  71. PA, // 31 - PA3
  72. PA, // 32 - PA4
  73. PA, // 33 - PA5
  74. PA, // 34 - PA6
  75. PA, // 35 - PA7
  76. PE, // 36 - PE4 - INT4
  77. PE, // 37 - PE5 - INT5
  78. PF, // 38 - PF0 - A0
  79. PF, // 39 - PF1 - A1
  80. PF, // 40 - PF2 - A2
  81. PF, // 41 - PF3 - A3
  82. PF, // 42 - PF4 - A4
  83. PF, // 43 - PF5 - A5
  84. PF, // 44 - PF6 - A6
  85. PF, // 45 - PF7 - A7
  86. PE, // 46 - PE2 (not defined in teensyduino)
  87. PE, // 47 - PE3 (not defined in teensyduino)
  88. };
  89. #define digitalPinToPort_Teensy(P) ( pgm_read_byte( digital_pin_to_port_PGM_Teensy + (P) ) )
  90. // digitalPinToBitMask(pin) is OK
  91. #define digitalRead_mod(p) digitalRead(p) // Teensyduino's version of digitalRead doesn't
  92. // disable the PWMs so we can use it as is
  93. // portModeRegister(pin) is OK
  94. #endif // __PINSDEBUG_TEENSYDUINO_H__