My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

pinsDebug.h 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /**
  2. * Marlin 3D Printer Firmware
  3. *
  4. * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  5. * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician)
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. #pragma once
  22. #define NUMBER_PINS_TOTAL PINS_COUNT
  23. #define digitalRead_mod(p) extDigitalRead(p)
  24. #define PRINT_PORT(p) do{ SERIAL_ECHOPGM(" Port: "); sprintf_P(buffer, PSTR("%c%02ld"), 'A' + g_APinDescription[p].ulPort, g_APinDescription[p].ulPin); SERIAL_ECHO(buffer); }while (0)
  25. #define PRINT_ARRAY_NAME(x) do{ sprintf_P(buffer, PSTR("%-" STRINGIFY(MAX_NAME_LENGTH) "s"), pin_array[x].name); SERIAL_ECHO(buffer); }while(0)
  26. #define PRINT_PIN(p) do{ sprintf_P(buffer, PSTR("%3d "), p); SERIAL_ECHO(buffer); }while(0)
  27. #define GET_ARRAY_PIN(p) pin_array[p].pin
  28. #define GET_ARRAY_IS_DIGITAL(p) pin_array[p].is_digital
  29. #define VALID_PIN(pin) (pin >= 0 && pin < (int8_t)NUMBER_PINS_TOTAL)
  30. #define DIGITAL_PIN_TO_ANALOG_PIN(p) digitalPinToAnalogInput(p)
  31. #define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P)!=-1)
  32. #define pwm_status(pin) digitalPinHasPWM(pin)
  33. #define MULTI_NAME_PAD 27 // space needed to be pretty if not first name assigned to a pin
  34. // pins that will cause hang/reset/disconnect in M43 Toggle and Watch utilities
  35. // uses pin index
  36. #define M43_NEVER_TOUCH(Q) ((Q) >= 75)
  37. bool GET_PINMODE(int8_t pin) { // 1: output, 0: input
  38. const EPortType samdport = g_APinDescription[pin].ulPort;
  39. const uint32_t samdpin = g_APinDescription[pin].ulPin;
  40. return PORT->Group[samdport].DIR.reg & MASK(samdpin) || (PORT->Group[samdport].PINCFG[samdpin].reg & (PORT_PINCFG_INEN | PORT_PINCFG_PULLEN)) == PORT_PINCFG_PULLEN;
  41. }
  42. void pwm_details(int32_t pin) {
  43. if (pwm_status(pin)) {
  44. //uint32_t chan = g_APinDescription[pin].ulPWMChannel TODO when fast pwm is operative;
  45. //SERIAL_ECHOPAIR("PWM = ", duty);
  46. }
  47. }
  48. /**
  49. * AGCM4 Board pin | PORT | Label
  50. * ----------------+--------+-------
  51. * 0 | PB25 | "RX0"
  52. * 1 | PB24 | "TX0"
  53. * 2 | PC18 |
  54. * 3 | PC19 |
  55. * 4 | PC20 |
  56. * 5 | PC21 |
  57. * 6 | PD20 |
  58. * 7 | PD21 |
  59. * 8 | PB18 |
  60. * 9 | PB2 |
  61. * 10 | PB22 |
  62. * 11 | PB23 |
  63. * 12 | PB0 | "A16"
  64. * 13 | PB1 | LED AMBER "L" / "A17"
  65. * 14 | PB16 | "TX3"
  66. * 15 | PB17 | "RX3"
  67. * 16 | PC22 | "TX2"
  68. * 17 | PC23 | "RX2"
  69. * 18 | PB12 | "TX1" / "A18"
  70. * 19 | PB13 | "RX1"
  71. * 20 | PB20 | "SDA"
  72. * 21 | PB21 | "SCL"
  73. * 22 | PD12 |
  74. * 23 | PA15 |
  75. * 24 | PC17 |
  76. * 25 | PC16 |
  77. * 26 | PA12 |
  78. * 27 | PA13 |
  79. * 28 | PA14 |
  80. * 29 | PB19 |
  81. * 30 | PA23 |
  82. * 31 | PA22 |
  83. * 32 | PA21 |
  84. * 33 | PA20 |
  85. * 34 | PA19 |
  86. * 35 | PA18 |
  87. * 36 | PA17 |
  88. * 37 | PA16 |
  89. * 38 | PB15 |
  90. * 39 | PB14 |
  91. * 40 | PC13 |
  92. * 41 | PC12 |
  93. * 42 | PC15 |
  94. * 43 | PC14 |
  95. * 44 | PC11 |
  96. * 45 | PC10 |
  97. * 46 | PC6 |
  98. * 47 | PC7 |
  99. * 48 | PC4 |
  100. * 49 | PC5 |
  101. * 50 | PD11 |
  102. * 51 | PD8 |
  103. * 52 | PD9 |
  104. * 53 | PD10 |
  105. * 54 | PB5 | "A8"
  106. * 55 | PB6 | "A9"
  107. * 56 | PB7 | "A10"
  108. * 57 | PB8 | "A11"
  109. * 58 | PB9 | "A12"
  110. * 69 | PA4 | "A13"
  111. * 60 | PA6 | "A14"
  112. * 61 | PA7 | "A15"
  113. * 62 | PB17 |
  114. * 63 | PB20 |
  115. * 64 | PD11 |
  116. * 65 | PD8 |
  117. * 66 | PD9 |
  118. * 67 | PA2 | "A0" / "DAC0"
  119. * 68 | PA5 | "A1" / "DAC1"
  120. * 69 | PB3 | "A2"
  121. * 70 | PC0 | "A3"
  122. * 71 | PC1 | "A4"
  123. * 72 | PC2 | "A5"
  124. * 73 | PC3 | "A6"
  125. * 74 | PB4 | "A7"
  126. * 75 | PC31 | LED GREEN "RX"
  127. * 76 | PC30 | LED GREEN "TX"
  128. * 77 | PA27 | USB: Host enable
  129. * 78 | PA24 | USB: D-
  130. * 79 | PA25 | USB: D+
  131. * 80 | PB29 | SD: MISO
  132. * 81 | PB27 | SD: SCK
  133. * 82 | PB26 | SD: MOSI
  134. * 83 | PB28 | SD: CS
  135. * 84 | PA3 | AREF
  136. * 85 | PA2 | DAC0 (Duplicate)
  137. * 86 | PA5 | DAC1 (Duplicate)
  138. * 87 | PB1 | LED AMBER "L" (Duplicate)
  139. * 88 | PC24 | NeoPixel
  140. * 89 | PB10 | QSPI: SCK
  141. * 90 | PB11 | QSPI: CS
  142. * 91 | PA8 | QSPI: IO0
  143. * 92 | PA9 | QSPI: IO1
  144. * 93 | PA10 | QSPI: IO2
  145. * 94 | PA11 | QSPI: IO3
  146. *
  147. */