aboutsummaryrefslogtreecommitdiff
path: root/Marlin/src/HAL/AVR/spi_pins.h
diff options
context:
space:
mode:
Diffstat (limited to 'Marlin/src/HAL/AVR/spi_pins.h')
-rw-r--r--Marlin/src/HAL/AVR/spi_pins.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/Marlin/src/HAL/AVR/spi_pins.h b/Marlin/src/HAL/AVR/spi_pins.h
new file mode 100644
index 0000000..8319729
--- /dev/null
+++ b/Marlin/src/HAL/AVR/spi_pins.h
@@ -0,0 +1,65 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+#pragma once
+
+/**
+ * Define SPI Pins: SCK, MISO, MOSI, SS
+ */
+#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
+ #define AVR_SCK_PIN 13
+ #define AVR_MISO_PIN 12
+ #define AVR_MOSI_PIN 11
+ #define AVR_SS_PIN 10
+#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
+ #define AVR_SCK_PIN 7
+ #define AVR_MISO_PIN 6
+ #define AVR_MOSI_PIN 5
+ #define AVR_SS_PIN 4
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+ #define AVR_SCK_PIN 52
+ #define AVR_MISO_PIN 50
+ #define AVR_MOSI_PIN 51
+ #define AVR_SS_PIN 53
+#elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
+ #define AVR_SCK_PIN 21
+ #define AVR_MISO_PIN 23
+ #define AVR_MOSI_PIN 22
+ #define AVR_SS_PIN 20
+#elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
+ #define AVR_SCK_PIN 10
+ #define AVR_MISO_PIN 12
+ #define AVR_MOSI_PIN 11
+ #define AVR_SS_PIN 16
+#endif
+
+#ifndef SD_SCK_PIN
+ #define SD_SCK_PIN AVR_SCK_PIN
+#endif
+#ifndef SD_MISO_PIN
+ #define SD_MISO_PIN AVR_MISO_PIN
+#endif
+#ifndef SD_MOSI_PIN
+ #define SD_MOSI_PIN AVR_MOSI_PIN
+#endif
+#ifndef SD_SS_PIN
+ #define SD_SS_PIN AVR_SS_PIN
+#endif