Ender3 - Marlin 2.1.2.4 build (#16)

This commit was merged in pull request #16.
This commit is contained in:
2024-10-10 01:45:01 +02:00
parent 36f7ac4197
commit 229bde3d18
2868 changed files with 1663193 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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/>.
*
*/
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H
#if ENABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#elif DISABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#undef REQUIRE_LPC1769
#endif

View File

@@ -0,0 +1,161 @@
/**
* 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
/**
* AZSMZ MINI pin assignments
* Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/AZSMZ%20MINI/AZSMZ.svg
* Source: https://raw.githubusercontent.com/Rose-Fish/AZSMZ-mini/master/AZSMZ.sch
*/
#include "env_validate.h"
#define BOARD_INFO_NAME "AZSMZ Mini"
//
// Servos
//
#define SERVO0_PIN P1_23
//
// Limit Switches
//
#define X_STOP_PIN P1_24
#define Y_STOP_PIN P1_26
#define Z_MIN_PIN P1_28
#define Z_MAX_PIN P1_29
//
// Steppers
//
#define X_STEP_PIN P2_00
#define X_DIR_PIN P0_05
#define X_ENABLE_PIN P0_04
#define Y_STEP_PIN P2_01
#define Y_DIR_PIN P0_11
#define Y_ENABLE_PIN P0_10
#define Z_STEP_PIN P2_02
#define Z_DIR_PIN P0_20
#define Z_ENABLE_PIN P0_19
#define E0_STEP_PIN P2_03
#define E0_DIR_PIN P0_22
#define E0_ENABLE_PIN P0_21
#define E1_STEP_PIN P2_08
#define E1_DIR_PIN P2_13
#define E1_ENABLE_PIN P4_29
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#define TEMP_0_PIN P0_23_A0 // A0 (TH1)
#define TEMP_BED_PIN P0_24_A1 // A1 (TH2)
#define TEMP_1_PIN P0_25_A2 // A2 (TH3)
//
// Heaters / Fans
//
// EFB
#define HEATER_0_PIN P2_04
#define HEATER_BED_PIN P2_05
#ifndef FAN0_PIN
#define FAN0_PIN P2_07
#endif
#define FAN1_PIN P0_26
#define LCD_SDSS P0_16 // LCD SD chip select
#if ENABLED(AZSMZ_12864)
#define BEEPER_PIN P1_30
#define DOGLCD_A0 P2_06
#define DOGLCD_CS P1_22
#define BTN_EN1 P4_28
#define BTN_EN2 P1_27
#define BTN_ENC P3_26
#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION LCD
#endif
#endif
#if SD_CONNECTION_IS(LCD)
#define SD_SCK_PIN P0_15
#define SD_MISO_PIN P0_17
#define SD_MOSI_PIN P0_18
#define SD_SS_PIN LCD_SDSS
#define SD_DETECT_PIN P3_25
#elif SD_CONNECTION_IS(ONBOARD)
#define SD_SCK_PIN P0_07
#define SD_MISO_PIN P0_08
#define SD_MOSI_PIN P0_09
#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
#define SD_SS_PIN ONBOARD_SD_CS_PIN
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
#error "No custom SD drive cable defined for this board."
#endif
//
// Ethernet pins
//
#define REF_CLK P1_15
#define ENET_MDIO P1_17
#define ENET_MOC P1_16
#define ENET_CRS P1_08
#define ENET_RX_ER P1_14
#define ENET_TX_EN P1_04
#define ENET_RXD0 P1_09
#define ENET_RXD1 P1_10
#define ENET_TXD0 P1_00
#define ENET_TXD1 P1_01
/**
* PWMs
*
* There are 6 PWMs. Each PWM can be assigned to one of two pins.
*
* SERVO2 does NOT have a PWM assigned to it.
*
* PWM1.1 DIO4 SERVO3_PIN FIL_RUNOUT_PIN 5V output, PWM
* PWM1.1 DIO26 E0_STEP_PIN
* PWM1.2 DIO11 SERVO0_PIN
* PWM1.2 DIO54 X_STEP_PIN
* PWM1.3 DIO6 SERVO1_PIN J5-1
* PWM1.3 DIO60 Y_STEP_PIN
* PWM1.4 DIO53 SDSS(SSEL0) J3-5 AUX-3
* PWM1.4 DIO46 Z_STEP_PIN
* PWM1.5 DIO3 X_MIN_PIN 10K PULLUP TO 3.3v, 1K SERIES
* PWM1.5 DIO9 MOSFET_B_PIN
* PWM1.6 DIO14 Y_MIN_PIN 10K PULLUP TO 3.3v, 1K SERIES
* PWM1.6 DIO10 MOSFET_A_PIN
*/
/**
* Special pins
* D37 - not 5V tolerant
* D49 - not 5V tolerant
* D57 - open collector
* D58 - open collector
*/

View File

@@ -0,0 +1,174 @@
/**
* 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
/**
* BIQU Thunder B300 V1.0
*/
#include "env_validate.h"
#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "BIQU Thunder B300 V1.0"
#endif
//
// Limit Switches
//
#define X_MIN_PIN P1_24 // 10k pullup to 3.3V, 1K series
#define X_MAX_PIN P1_25 // 10k pullup to 3.3V, 1K series
#define Y_MIN_PIN P1_26 // 10k pullup to 3.3V, 1K series
#define Y_MAX_PIN P1_27 // 10k pullup to 3.3V, 1K series
#define Z_MIN_PIN P1_28 // 10k pullup to 3.3V, 1K series
#define Z_MAX_PIN P1_29 // 10k pullup to 3.3V, 1K series
//
// Steppers
//
#define X_STEP_PIN P2_00
#define X_DIR_PIN P0_05
#define X_ENABLE_PIN P0_04
#ifndef X_CS_PIN
#define X_CS_PIN P1_15 // ETH
#endif
#define Y_STEP_PIN P2_01
#define Y_DIR_PIN P0_11
#define Y_ENABLE_PIN P0_10
#ifndef Y_CS_PIN
#define Y_CS_PIN P1_14 // ETH
#endif
#define Z_STEP_PIN P2_02
#define Z_DIR_PIN P0_20
#define Z_ENABLE_PIN P0_19
#ifndef Z_CS_PIN
#define Z_CS_PIN P1_16 // ETH
#endif
#define E0_STEP_PIN P2_03
#define E0_DIR_PIN P0_22
#define E0_ENABLE_PIN P0_21
#ifndef E0_CS_PIN
#define E0_CS_PIN P1_17 // ETH
#endif
//
// Default pins for TMC software SPI
//
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P0_18 // ETH
#endif
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_17 // ETH
#endif
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_15 // ETH
#endif
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#define TEMP_0_PIN P0_24_A1 // A0 (T0)
#define TEMP_BED_PIN P0_23_A0 // A1 (T1)
//
// Heaters / Fans
//
#define HEATER_0_PIN P2_07
#define HEATER_BED_PIN P2_05
#ifndef FAN0_PIN
#define FAN0_PIN P2_04
#endif
//
// Unused
//
//#define PIN_P2_10 P2_10 // IBOOT-1
//#define PIN_P0_27 P0_27 // Onboard SD Detect
/**
* LCD / Controller
*
* REPRAP_DISCOUNT_SMART_CONTROLLER is not supported due to the lack of LCD_PINS_D5,
* LCD_PINS_D6 or LCD_PINS_D7 in the EXP1 connector.
*
* A remote SD card is not supported as the pins routed to EXP2 are the same as used
* for the onboard SD card, and a chip select signal is not provided for the remote
* SD card.
*/
#if HAS_WIRED_LCD
#define BEEPER_PIN P1_31 // EXP1-1
#define BTN_EN1 P3_26 // EXP2-3
#define BTN_EN2 P3_25 // EXP2-5
#define BTN_ENC P1_30 // EXP1-2
#define SD_DETECT_PIN P0_27 // EXP2-7
#define LCD_PINS_RS P0_16 // EXP1-4
#define LCD_PINS_EN P0_18 // (MOSI) EXP1-3
#define LCD_PINS_D4 P0_15 // (SCK) EXP1-5
#if ALL(HAS_MARLINUI_HD44780, IS_RRD_SC)
#error "REPRAP_DISCOUNT_SMART_CONTROLLER displays aren't supported by the BIQU B300 v1.0"
#endif
#if HAS_MEDIA
#error "SDSUPPORT is not supported by the BIQU B300 v1.0 when an LCD controller is used"
#endif
#endif // HAS_WIRED_LCD
/**
* SD Card Reader
*
* Software SPI is used to interface with a stand-alone SD card reader connected to EXP1.
* Hardware SPI can't be used because P0_17 (MISO) is not brought out on this board.
*/
#if HAS_MEDIA
#define SD_SCK_PIN P0_15 // EXP1-5
#define SD_MISO_PIN P0_16 // EXP1-4
#define SD_MOSI_PIN P0_18 // EXP1-3
#define SD_SS_PIN P1_30 // EXP1-2
#define SDSS SD_SS_PIN
#endif
/**
* PWMS
*
* There are 6 PWMS. Each PWM can be assigned to one of two pins.
*
* PWM1.1 P0_18 LCD_PINS_EN
* PWM1.1 P2_0 X_STEP_PIN
* PWM1.2 P1_20 <none>
* PWM1.2 P2_1 Y_STEP_PIN
* PWM1.3 P1_21 <none>
* PWM1.3 P2_2 Z_STEP_PIN
* PWM1.4 P1_23 <none>
* PWM1.4 P2_3 E0_STEP_PIN
* PWM1.5 P1_24 X_MIN_PIN
* PWM1.5 P2_4 FAN0_PIN
* PWM1.6 P1_26 Y_MIN_PIN
* PWM1.6 P2_5 HEATER_BED_PIN
*/

View File

@@ -0,0 +1,153 @@
/**
* 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
/**
* BIQU BQ111-A4 pin assignments
*
* Applies to the following boards:
*
* BOARD_BIQU_BQ111_A4 (Hotend, Fan, Bed)
*/
#include "env_validate.h"
#define BOARD_INFO_NAME "BIQU BQ111-A4"
//
// Limit Switches
//
#define X_MIN_PIN P1_24 // 10k pullup to 3.3V, 1K series
#define X_MAX_PIN P1_25 // 10k pullup to 3.3V, 1K series
#define Y_MIN_PIN P1_26 // 10k pullup to 3.3V, 1K series
#define Y_MAX_PIN P1_27 // 10k pullup to 3.3V, 1K series
#define Z_MIN_PIN P1_28 // 10k pullup to 3.3V, 1K series
#define Z_MAX_PIN P1_29 // 10k pullup to 3.3V, 1K series
//
// Steppers
//
#define X_STEP_PIN P2_00
#define X_DIR_PIN P0_05
#define X_ENABLE_PIN P0_04
#define Y_STEP_PIN P2_01
#define Y_DIR_PIN P0_11
#define Y_ENABLE_PIN P0_10
#define Z_STEP_PIN P2_02
#define Z_DIR_PIN P0_20
#define Z_ENABLE_PIN P0_19
#define E0_STEP_PIN P2_03
#define E0_DIR_PIN P0_22
#define E0_ENABLE_PIN P0_21
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#define TEMP_0_PIN P0_23_A0 // A0 (T0)
#define TEMP_BED_PIN P0_24_A1 // A1 (T1)
//
// Heaters / Fans
//
#define HEATER_0_PIN P2_07
#define HEATER_BED_PIN P2_05
#ifndef FAN0_PIN
#define FAN0_PIN P2_04
#endif
//
// Unused
//
//#define PIN_P2_10 P2_10 // IBOOT-1
//#define PIN_P0_27 P0_27 // Onboard SD Detect
/**
* LCD / Controller
*
* REPRAP_DISCOUNT_SMART_CONTROLLER is not supported due to the lack of LCD_PINS_D5,
* LCD_PINS_D6 or LCD_PINS_D7 in the EXP1 connector.
*
* A remote SD card is not supported as the pins routed to EXP2 are the same as used
* for the onboard SD card, and a chip select signal is not provided for the remote
* SD card.
*/
#if HAS_WIRED_LCD
#define BEEPER_PIN P1_31 // EXP1-1
#define BTN_EN1 P3_26 // EXP2-3
#define BTN_EN2 P3_25 // EXP2-5
#define BTN_ENC P1_30 // EXP1-2
#define SD_DETECT_PIN P0_27 // EXP2-7
#define LCD_PINS_RS P0_16 // EXP1-4
#define LCD_PINS_EN P0_18 // (MOSI) EXP1-3
#define LCD_PINS_D4 P0_15 // (SCK) EXP1-5
#if ALL(HAS_MARLINUI_HD44780, IS_RRD_SC)
#error "REPRAP_DISCOUNT_SMART_CONTROLLER displays aren't supported by the BIQU BQ111-A4"
#endif
#if HAS_MEDIA
#error "SDSUPPORT is not supported by the BIQU BQ111-A4 when an LCD controller is used"
#endif
#endif // HAS_WIRED_LCD
/**
* SD Card Reader
*
* Software SPI is used to interface with a stand-alone SD card reader connected to EXP1.
* Hardware SPI can't be used because P0_17 (MISO) is not brought out on this board.
*/
#if HAS_MEDIA
#define SD_SCK_PIN P0_15 // EXP1-5
#define SD_MISO_PIN P0_16 // EXP1-4
#define SD_MOSI_PIN P0_18 // EXP1-3
#define SD_SS_PIN P1_30 // EXP1-2
#define SDSS SD_SS_PIN
#endif // HAS_MEDIA
/**
* PWMS
*
* There are 6 PWMS. Each PWM can be assigned to one of two pins.
*
* PWM1.1 P0_18 LCD_PINS_EN
* PWM1.1 P2_0 X_STEP_PIN
* PWM1.2 P1_20 <none>
* PWM1.2 P2_1 Y_STEP_PIN
* PWM1.3 P1_21 <none>
* PWM1.3 P2_2 Z_STEP_PIN
* PWM1.4 P1_23 <none>
* PWM1.4 P2_3 E0_STEP_PIN
* PWM1.5 P1_24 X_MIN_PIN
* PWM1.5 P2_4 FAN0_PIN
* PWM1.6 P1_26 Y_MIN_PIN
* PWM1.6 P2_5 HEATER_BED_PIN
*/

View File

@@ -0,0 +1,256 @@
/**
* 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
/**
* BigTreeTech SKR 1.1 pin assignments
* Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.1/SKR-V1.1SchDoc.pdf
* Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.1/blob/master/hardware/SKR-V1.1SchDoc.pdf
*/
#define BOARD_INFO_NAME "BTT SKR V1.1"
//
// Limit Switches
//
#define X_MIN_PIN P1_29
#define X_MAX_PIN P1_28
#define Y_MIN_PIN P1_27
#define Y_MAX_PIN P1_26
#define Z_MIN_PIN P1_25
#define Z_MAX_PIN P1_24
//
// Steppers
//
#define X_STEP_PIN P0_04
#define X_DIR_PIN P0_05
#define X_ENABLE_PIN P4_28
#define Y_STEP_PIN P2_01
#define Y_DIR_PIN P2_02
#define Y_ENABLE_PIN P2_00
#define Z_STEP_PIN P0_20
#define Z_DIR_PIN P0_21
#define Z_ENABLE_PIN P0_19
#define E0_STEP_PIN P0_11
#define E0_DIR_PIN P2_13
#define E0_ENABLE_PIN P2_12
/** ------ ------
* 1.30 | 1 2 | 2.11 0.17 | 1 2 | 0.15
* 0.18 | 3 4 | 0.16 3.26 | 3 4 | 1.23
* 0.15 5 6 | -- 3.25 5 6 | 0.18
* -- | 7 8 | -- 1.31 | 7 8 | RESET
* GND | 9 10 | 5V GND | 9 10 | --
* ------ ------
* EXP1 EXP2
*/
#define EXP1_01_PIN P1_30
#define EXP1_02_PIN P2_11
#define EXP1_03_PIN P0_18
#define EXP1_04_PIN P0_16
#define EXP1_05_PIN P0_15
#define EXP1_06_PIN -1 // NC
#define EXP1_07_PIN -1 // NC
#define EXP1_08_PIN -1 // NC
#define EXP2_01_PIN P0_17
#define EXP2_02_PIN P0_15
#define EXP2_03_PIN P3_26
#define EXP2_04_PIN P1_23
#define EXP2_05_PIN P3_25
#define EXP2_06_PIN P0_18
#define EXP2_07_PIN P1_31
#define EXP2_08_PIN -1 // RESET
/**
* LCD / Controller
*
* As of 20 JAN 2019 only the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER display has
* been tested with these settings. It can be connected to the SKR using standard cables
* via the EXP1 and EXP2 ports. Other displays may need a custom cable and/or changes to
* the pins defined below.
*
* The SD card on the LCD controller uses the same SPI signals as the LCD, resulting in
* garbage/lines on the LCD display during SD card access. The LCD code mitigates this
* by redrawing the screen after SD card accesses.
*/
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS EXP2_03_PIN
#endif
#elif HAS_WIRED_LCD
#define BTN_EN1 EXP2_03_PIN
#define BTN_EN2 EXP2_05_PIN
#define BTN_ENC EXP1_02_PIN
#define LCD_SDSS EXP2_04_PIN
#define LCD_PINS_RS EXP1_04_PIN
#define LCD_PINS_EN EXP2_06_PIN
#define LCD_PINS_D4 EXP2_02_PIN
#if ENABLED(MKS_MINI_12864)
#define DOGLCD_CS P2_06
#define DOGLCD_A0 EXP1_04_PIN
#endif
#endif // HAS_WIRED_LCD
//
// SD Support
//
// MKS_MINI_12864 strongly prefers the SD card on the display and
// requires jumpers on the SKR V1.1 board as documented here:
// https://www.facebook.com/groups/505736576548648/permalink/630639874058317/
#ifndef SDCARD_CONNECTION
#if ANY(MKS_MINI_12864, ENDER2_STOCKDISPLAY, IS_TFTGLCD_PANEL)
#define SDCARD_CONNECTION LCD
#else
#define SDCARD_CONNECTION ONBOARD
#endif
#endif
// Trinamic driver support
#if HAS_TRINAMIC_CONFIG
// Using TMC devices in intelligent mode requires extra connections to each device. Unfortunately
// the SKR does not have many free pins (especially if a display is in use). The SPI-based devices
// will require 3 connections (clock, mosi, miso), plus a chip select line (CS) for each driver.
// The UART-based devices require 2 pis per driver (one of which must be interrupt capable).
// The same SPI pins can be shared with the display/SD card reader, meaning SPI-based devices are
// probably a good choice for this board.
//
// SOFTWARE_DRIVER_ENABLE is a good option. It uses SPI to control the driver enable and allows the
// hardware ENABLE pins for each driver to be repurposed as SPI chip select. To use this mode the
// driver modules will probably need to be modified, removing the pin used for the enable line from
// the module and wiring this connection directly to GND (as is the case for TMC2130).
// Using this option and sharing all of the SPI pins allows 5 TMC2130 drivers to be used along with
// a REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER without requiring the use of any extra pins.
//
// Other options will probably require the use of any free pins and the TFT serial port or a
// different type of display (like the TFT), using the pins normally used for the display and encoder.
// Unfortunately, tests show it's not possible to use endstop and thermistor pins for chip-select.
// Sample settings are provided below, but only some have been tested.
//
// Another option is to share the enable and chip-select pins when using SPI. Several users have
// reported that this works. However, it's unlikely that this configuration will allow SPI communi-
// cation with the device when the drivers are active, meaning that some of the more advanced TMC
// options may not be available.
// When using any TMC SPI-based drivers, software SPI is used
// because pins may be shared with the display or SD card.
#define TMC_USE_SW_SPI
#define TMC_SPI_MOSI EXP2_06_PIN
#define TMC_SPI_MISO EXP2_01_PIN
// To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.)
#define TMC_SPI_SCK EXP2_02_PIN
// If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise.
//#define TMC_SPI_SCK P2_06
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
// Software enable allows the enable pins to be repurposed as chip-select pins.
// Note: Requires the driver modules to be modified to always be enabled with the enable pin removed.
#if AXIS_DRIVER_TYPE_X(TMC2130)
#define X_CS_PIN P4_28
#undef X_ENABLE_PIN
#endif
#if AXIS_DRIVER_TYPE_Y(TMC2130)
#define Y_CS_PIN P2_00
#undef Y_ENABLE_PIN
#endif
#if AXIS_DRIVER_TYPE_Z(TMC2130)
#define Z_CS_PIN P0_19
#undef Z_ENABLE_PIN
#endif
#if AXIS_DRIVER_TYPE_E0(TMC2130)
#define E0_CS_PIN P2_12
#undef E0_ENABLE_PIN
#endif
#if AXIS_DRIVER_TYPE_E1(TMC2130)
#define E1_CS_PIN P0_10
#undef E1_ENABLE_PIN
#endif
#else // !SOFTWARE_DRIVER_ENABLE
// A chip-select pin is needed for each driver.
// EXAMPLES
// Example 1: No LCD attached or a TFT style display using the AUX header RX/TX pins.
// SDCARD_CONNECTION must not be 'LCD'. Nothing should be connected to EXP1/EXP2.
//#define SKR_USE_LCD_PINS_FOR_CS
#if ENABLED(SKR_USE_LCD_PINS_FOR_CS)
#define X_CS_PIN EXP2_04_PIN
#define Y_CS_PIN EXP2_03_PIN
#define Z_CS_PIN EXP1_02_PIN
#define E0_CS_PIN EXP2_05_PIN
#define E1_CS_PIN EXP2_07_PIN
#endif
// Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
// The SD card reader attached to the LCD (if present) can't be used because
// the pins will be in use. So SDCARD_CONNECTION must not be 'LCD'.
//#define SKR_USE_LCD_SD_CARD_PINS_FOR_CS
#if ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS)
#define X_CS_PIN P0_02
#define Y_CS_PIN P0_03
#define Z_CS_PIN P2_06
// We use SD_DETECT_PIN for E0
#undef SD_DETECT_PIN
#define E0_CS_PIN EXP2_07_PIN
// We use LCD_SDSS pin for E1
#undef LCD_SDSS
#define LCD_SDSS -1
#define E1_CS_PIN EXP2_04_PIN
#endif
// Example 3: Use the driver enable pins for chip-select.
// Commands must not be sent to the drivers when enabled. So certain
// advanced features (like driver monitoring) will not be available.
//#define SKR_USE_ENABLE_CS
#if ENABLED(SKR_USE_ENABLE_FOR_CS)
#define X_CS_PIN X_ENABLE_PIN
#define Y_CS_PIN Y_ENABLE_PIN
#define Z_CS_PIN Z_ENABLE_PIN
#define E0_CS_PIN E0_ENABLE_PIN
#define E1_CS_PIN E1_ENABLE_PIN
#endif
#endif // SOFTWARE_DRIVER_ENABLE
#endif
// Include common SKR pins
#include "pins_BTT_SKR_common.h"

View File

@@ -0,0 +1,541 @@
/**
* 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
/**
* BigTreeTech SKR 1.3 pin assignments
* Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.3/SKR-V1.3-SCH.pdf
* Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.3/hardware/SKR-V1.3-SCH.pdf
*/
#define BOARD_INFO_NAME "BTT SKR V1.3"
#define LPC1768_IS_SKRV1_3
#define USES_DIAG_JUMPERS
//
// Trinamic Stallguard pins
//
#define X_DIAG_PIN P1_29 // X-
#define Y_DIAG_PIN P1_27 // Y-
#define Z_DIAG_PIN P1_25 // Z-
#define E0_DIAG_PIN P1_28 // X+
#define E1_DIAG_PIN P1_26 // Y+
//
// Limit Switches
//
#ifdef X_STALL_SENSITIVITY
#define X_STOP_PIN X_DIAG_PIN
#if X_HOME_TO_MIN
#define X_MAX_PIN P1_28 // X+
#else
#define X_MIN_PIN P1_28 // X+
#endif
#else
#define X_MIN_PIN P1_29 // X-
#define X_MAX_PIN P1_28 // X+
#endif
#ifdef Y_STALL_SENSITIVITY
#define Y_STOP_PIN Y_DIAG_PIN
#if Y_HOME_TO_MIN
#define Y_MAX_PIN P1_26 // Y+
#else
#define Y_MIN_PIN P1_26 // Y+
#endif
#else
#define Y_MIN_PIN P1_27 // Y-
#define Y_MAX_PIN P1_26 // Y+
#endif
#ifdef Z_STALL_SENSITIVITY
#define Z_STOP_PIN Z_DIAG_PIN
#if Z_HOME_TO_MIN
#define Z_MAX_PIN P1_24 // Z+
#else
#define Z_MIN_PIN P1_24 // Z+
#endif
#else
#define Z_MIN_PIN P1_25 // Z-
#define Z_MAX_PIN P1_24 // Z+
#endif
#define ONBOARD_ENDSTOPPULLUPS // Board has built-in pullups
//
// Servos
//
#ifndef SERVO0_PIN
#define SERVO0_PIN P2_00
#endif
//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN P1_24
#endif
//
// Probe enable
//
#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN)
#define PROBE_ENABLE_PIN SERVO0_PIN
#endif
//
// Filament Runout Sensor
//
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN P1_28
#endif
//
// Steppers
//
#define X_STEP_PIN P2_02
#define X_DIR_PIN P2_06
#define X_ENABLE_PIN P2_01
#ifndef X_CS_PIN
#define X_CS_PIN P1_17
#endif
#define Y_STEP_PIN P0_19
#define Y_DIR_PIN P0_20
#define Y_ENABLE_PIN P2_08
#ifndef Y_CS_PIN
#define Y_CS_PIN P1_15
#endif
#define Z_STEP_PIN P0_22
#define Z_DIR_PIN P2_11
#define Z_ENABLE_PIN P0_21
#ifndef Z_CS_PIN
#define Z_CS_PIN P1_10
#endif
#define E0_STEP_PIN P2_13
#define E0_DIR_PIN P0_11
#define E0_ENABLE_PIN P2_12
#ifndef E0_CS_PIN
#define E0_CS_PIN P1_08
#endif
#ifndef E1_CS_PIN
#define E1_CS_PIN P1_01
#endif
//
// Default pins for TMC software SPI
//
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P4_28
#endif
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_05
#endif
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_04
#endif
#if HAS_TMC_UART
/**
* TMC2208/TMC2209 stepper drivers
*
* Hardware serial communication ports.
* If undefined software serial is used according to the pins below
*/
//#define X_HARDWARE_SERIAL Serial1
//#define X2_HARDWARE_SERIAL Serial1
//#define Y_HARDWARE_SERIAL Serial1
//#define Y2_HARDWARE_SERIAL Serial1
//#define Z_HARDWARE_SERIAL Serial1
//#define Z2_HARDWARE_SERIAL Serial1
//#define E0_HARDWARE_SERIAL Serial1
//#define E1_HARDWARE_SERIAL Serial1
//#define E2_HARDWARE_SERIAL Serial1
//#define E3_HARDWARE_SERIAL Serial1
//#define E4_HARDWARE_SERIAL Serial1
#define X_SERIAL_TX_PIN P4_29
#define X_SERIAL_RX_PIN P1_17
#define Y_SERIAL_TX_PIN P1_16
#define Y_SERIAL_RX_PIN P1_15
#define Z_SERIAL_TX_PIN P1_14
#define Z_SERIAL_RX_PIN P1_10
#define E0_SERIAL_TX_PIN P1_09
#define E0_SERIAL_RX_PIN P1_08
#define E1_SERIAL_TX_PIN P1_04
#define E1_SERIAL_RX_PIN P1_01
// Reduce baud rate to improve software serial reliability
#ifndef TMC_BAUD_RATE
#define TMC_BAUD_RATE 19200
#endif
#endif // HAS_TMC_UART
/**
* ------ ------
* (BEEPER) 1.30 | 1 2 | 0.28 (BTN_ENC) (MISO) 0.17 | 1 2 | 0.15 (SCK)
* (LCD_EN) 1.18 | 3 4 | 1.19 (LCD_RS) (BTN_EN1) 3.26 | 3 4 | 0.16 (SD_SS)
* (LCD_D4) 1.20 5 6 | 1.21 (LCD_D5) (BTN_EN2) 3.25 5 6 | 0.18 (MOSI)
* (LCD_D6) 1.22 | 7 8 | 1.23 (LCD_D7) (SD_DETECT) 1.31 | 7 8 | RESET
* GND | 9 10 | 5V GND | 9 10 | --
* ------ ------
* EXP1 EXP2
*/
#define EXP1_01_PIN P1_30
#define EXP1_02_PIN P0_28
#define EXP1_03_PIN P1_18
#define EXP1_04_PIN P1_19
#define EXP1_05_PIN P1_20
#define EXP1_06_PIN P1_21
#define EXP1_07_PIN P1_22
#define EXP1_08_PIN P1_23
#define EXP2_01_PIN P0_17
#define EXP2_02_PIN P0_15
#define EXP2_03_PIN P3_26
#define EXP2_04_PIN P0_16
#define EXP2_05_PIN P3_25
#define EXP2_06_PIN P0_18
#define EXP2_07_PIN P1_31
#define EXP2_08_PIN -1
#if HAS_WIRED_LCD
#if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING)
#error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING only applies to the ANET 1.0 board."
#elif ENABLED(ANET_FULL_GRAPHICS_LCD)
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#endif
/**
* 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way.
* 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!)
* 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because it is open drain.)
* 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board.
*
* !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!!
*
* The ANET_FULL_GRAPHICS_LCD connector plug:
*
* BEFORE AFTER
* ------ ------
* (CLK) | 1 2 | (BEEPER) (BEEPER) |10 9 | --
* -- | 3 4 | (BTN_ENC) (BTN_ENC) | 8 7 | (CLK)
* (SID) 5 6 | (BTN_EN1) (BTN_EN1) 6 5 | (SID)
* (CS) | 7 8 | (BTN_EN2) (BTN_EN2) | 4 3 | (CS)
* GND | 9 10 | 5V GND | 2 1 | 5V
* ------ ------
* LCD LCD
*/
#define LCD_PINS_RS EXP1_08_PIN
#define BTN_EN1 EXP1_05_PIN
#define BTN_EN2 EXP1_07_PIN
#define BTN_ENC EXP1_03_PIN
#define LCD_PINS_EN EXP1_06_PIN
#define LCD_PINS_D4 EXP1_04_PIN
#elif ENABLED(WYH_L12864)
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! WYH_L12864 requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#endif
/**
* 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way.
* 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!)
* 3. Swap the LCD's MOSI (Pin9) and empty (Pin10) wires because Pin9 is open drain.
*
* !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!!
*
* The WYH_L12864 connector plug:
*
* BEFORE AFTER
* ______ ______
* | 1 2 | (MOSI) (MOSI) |10 9 | --
* (BTN_ENC) | 3 4 | (SCK) (BTN_ENC) | 8 7 | (SCK)
* (BTN_EN1) 5 6 | (SID) (BTN_EN1) 6 5 | (SID)
* (BTN_EN2) | 7 8 | (CS) (BTN_EN2) | 4 3 | (CS)
* 5V | 9 10 | GND GND | 2 1 | 5V
* ------ ------
* LCD LCD
*/
#define BTN_ENC EXP1_03_PIN
#define BTN_EN1 EXP1_05_PIN
#define BTN_EN2 EXP1_07_PIN
#define DOGLCD_CS EXP1_08_PIN
#define DOGLCD_A0 EXP1_06_PIN
#define DOGLCD_SCK EXP1_04_PIN
#define DOGLCD_MOSI EXP1_01_PIN
#define LCD_BACKLIGHT_PIN -1
#elif ENABLED(CR10_STOCKDISPLAY)
#define LCD_PINS_RS EXP1_07_PIN
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN
#define BTN_ENC EXP1_02_PIN // (58) open-drain
#define LCD_PINS_EN EXP1_08_PIN
#define LCD_PINS_D4 EXP1_06_PIN
#elif HAS_ADC_BUTTONS
#error "ADC BUTTONS do not work unmodified on SKR 1.3, The ADC ports cannot take more than 3.3v."
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
#define SDCARD_CONNECTION ONBOARD
#define BEEPER_PIN EXP1_01_PIN
#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 EXP2_03_PIN
#define BTN_EN2 EXP2_05_PIN
#define TFT_A0_PIN TFT_DC_PIN
#ifndef TFT_WIDTH
#define TFT_WIDTH 480
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#if ENABLED(BTT_TFT35_SPI_V1_0)
/**
* ------ ------
* BEEPER | 1 2 | LCD-BTN MISO | 1 2 | CLK
* T_MOSI | 3 4 | T_CS LCD-ENCA | 3 4 | TFTCS
* T_CLK | 5 6 T_MISO LCD-ENCB | 5 6 MOSI
* PENIRQ | 7 8 | F_CS RS | 7 8 | RESET
* GND | 9 10 | VCC GND | 9 10 | NC
* ------ ------
* EXP1 EXP2
*
* 480x320, 3.5", SPI Display with Rotary Encoder.
* Stock Display for the BIQU B1 SE Series.
* Schematic: https://github.com/bigtreetech/TFT35-SPI/blob/master/v1/Hardware/BTT%20TFT35-SPI%20V1-SCH.pdf
*/
#define TFT_CS_PIN EXP2_04_PIN
#define TFT_DC_PIN EXP2_07_PIN
#define TFT_SCK_PIN EXP2_02_PIN
#define TFT_MISO_PIN EXP2_01_PIN
#define TFT_MOSI_PIN EXP2_06_PIN
#define TOUCH_CS_PIN EXP1_04_PIN
#define TOUCH_SCK_PIN EXP1_05_PIN
#define TOUCH_MISO_PIN EXP1_06_PIN
#define TOUCH_MOSI_PIN EXP1_03_PIN
#define TOUCH_INT_PIN EXP1_07_PIN
#elif ENABLED(MKS_TS35_V2_0)
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! MKS_TS35_V2_0 requires wiring modifications. The SKR 1.3 EXP ports are rotated 180° from what the MKS_TS35_V2_0 expects. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this error.)"
#endif
/** ------ ------
* BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK
* TFT_BKL / LCD_EN | 3 4 | TFT_RESET / LCD_RS BTN_EN1 | 3 4 | SPI1_CS
* TOUCH_CS / LCD_D4 | 5 6 TOUCH_INT / LCD_D5 BTN_EN2 | 5 6 SPI1_MOSI
* SPI1_CS / LCD_D6 | 7 8 | SPI1_RS / LCD_D7 SPI1_RS | 7 8 | RESET
* GND | 9 10 | VCC GND | 9 10 | VCC
* ------ ------
* EXP1 EXP2
*/
#define TFT_CS_PIN EXP1_07_PIN
#define TFT_DC_PIN EXP1_08_PIN
#define TFT_RESET_PIN EXP1_04_PIN
#define TFT_BACKLIGHT_PIN EXP1_03_PIN
//#define TFT_RST_PIN EXP2_07_PIN
#define TFT_SCK_PIN EXP2_02_PIN
#define TFT_MISO_PIN EXP2_01_PIN
#define TFT_MOSI_PIN EXP2_06_PIN
#define LCD_USE_DMA_SPI
#define TFT_BUFFER_WORDS 2400
#define TOUCH_CS_PIN EXP1_05_PIN
#define TOUCH_INT_PIN EXP1_06_PIN
#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1
#endif
#if ENABLED(TFT_CLASSIC_UI)
#ifndef TOUCH_CALIBRATION_X
#define TOUCH_CALIBRATION_X -16794
#endif
#ifndef TOUCH_CALIBRATION_Y
#define TOUCH_CALIBRATION_Y 11000
#endif
#ifndef TOUCH_OFFSET_X
#define TOUCH_OFFSET_X 1024
#endif
#ifndef TOUCH_OFFSET_Y
#define TOUCH_OFFSET_Y -352
#endif
#elif ENABLED(TFT_COLOR_UI)
#ifndef TOUCH_CALIBRATION_X
#define TOUCH_CALIBRATION_X -16741
#endif
#ifndef TOUCH_CALIBRATION_Y
#define TOUCH_CALIBRATION_Y 11258
#endif
#ifndef TOUCH_OFFSET_X
#define TOUCH_OFFSET_X 1024
#endif
#ifndef TOUCH_OFFSET_Y
#define TOUCH_OFFSET_Y -367
#endif
#define TFT_BUFFER_WORDS 2400
#endif
#elif IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS EXP2_03_PIN
#endif
#define SD_DETECT_PIN EXP2_07_PIN
#else // !CR10_STOCKDISPLAY
#define LCD_PINS_RS EXP1_04_PIN
#define BTN_EN1 EXP2_03_PIN // (31) J3-2 & AUX-4
#define BTN_EN2 EXP2_05_PIN // (33) J3-4 & AUX-4
#define BTN_ENC EXP1_02_PIN // (58) open-drain
#define LCD_PINS_EN EXP1_03_PIN
#define LCD_PINS_D4 EXP1_05_PIN
#define LCD_SDSS EXP2_04_PIN // (16) J3-7 & AUX-4
#define SD_DETECT_PIN EXP2_07_PIN // (49) (NOT 5V tolerant)
#if ENABLED(FYSETC_MINI_12864)
#define DOGLCD_CS EXP1_03_PIN
#define DOGLCD_A0 EXP1_04_PIN
#define DOGLCD_SCK EXP2_02_PIN
#define DOGLCD_MOSI EXP2_06_PIN
#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
// results in LCD soft SPI mode 3, SD soft SPI mode 0
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
#if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN EXP1_06_PIN
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN EXP1_07_PIN
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN EXP1_08_PIN
#endif
#elif ENABLED(FYSETC_MINI_12864_2_1)
#define NEOPIXEL_PIN EXP1_06_PIN
#endif
#else // !FYSETC_MINI_12864
#if ENABLED(MKS_MINI_12864)
#define DOGLCD_CS EXP1_06_PIN
#define DOGLCD_A0 EXP1_07_PIN
#define DOGLCD_SCK EXP2_02_PIN
#define DOGLCD_MOSI EXP2_06_PIN
#define FORCE_SOFT_SPI
#elif ENABLED(ENDER2_STOCKDISPLAY)
/**
* Creality Ender-2 display pinout
* ------
* (SCK) P1_30 | 1 2 | P0_28 (BTN_ENC)
* (BTN_EN1) P1_18 | 3 4 | P1_19 (RESET)
* (BTN_EN2) P1_20 5 6 | P1_21 (LCD_A0)
* (LCD_CS) P1_22 | 7 8 | P1_23 (MOSI)
* GND | 9 10 | 5V
* ------
* EXP1
*/
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN
#define BTN_ENC EXP1_02_PIN
#define DOGLCD_CS EXP1_07_PIN
#define DOGLCD_A0 EXP1_06_PIN
#define DOGLCD_SCK EXP1_01_PIN
#define DOGLCD_MOSI EXP1_08_PIN
#define FORCE_SOFT_SPI
#define LCD_BACKLIGHT_PIN -1
#endif
#if IS_ULTIPANEL
#define LCD_PINS_D5 EXP1_06_PIN
#define LCD_PINS_D6 EXP1_07_PIN
#define LCD_PINS_D7 EXP1_08_PIN
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
#endif
#endif
#endif // !FYSETC_MINI_12864
#endif // !CR10_STOCKDISPLAY
#endif // HAS_WIRED_LCD
/**
* Special pins
* P1_30 (37) (NOT 5V tolerant)
* P1_31 (49) (NOT 5V tolerant)
* P0_27 (57) (Open collector)
* P0_28 (58) (Open collector)
*/
// Include common SKR pins
#include "pins_BTT_SKR_common.h"

View File

@@ -0,0 +1,616 @@
/**
* 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
/**
* BigTreeTech SKR 1.4 pin assignments
* Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.4%20+%20Turbo/BTT%20SKR%20V1.4-SCH.pdf
* Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4-SCH.pdf
*/
#include "env_validate.h"
#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "BTT SKR V1.4"
#endif
#ifndef BOARD_CUSTOM_BUILD_FLAGS
#define BOARD_CUSTOM_BUILD_FLAGS -DLPC_PINCFG_UART3_P4_28
#endif
#define USES_DIAG_PINS
//
// EEPROM
//
#if NO_EEPROM_SELECTED
//#define I2C_EEPROM // EEPROM on I2C-0
//#define SDCARD_EEPROM_EMULATION
//#undef NO_EEPROM_SELECTED
#endif
#if ENABLED(I2C_EEPROM)
#define MARLIN_EEPROM_SIZE 0x8000 // 32K
#elif ENABLED(SDCARD_EEPROM_EMULATION)
#define MARLIN_EEPROM_SIZE 0x800 // 2K
#endif
//
// Servos
//
#define SERVO0_PIN P2_00
//
// TMC StallGuard DIAG pins
//
#define X_DIAG_PIN P1_29 // X-STOP
#define Y_DIAG_PIN P1_28 // Y-STOP
#define Z_DIAG_PIN P1_27 // Z-STOP
#define E0_DIAG_PIN P1_26 // E0DET
#define E1_DIAG_PIN P1_25 // E1DET
//
// Limit Switches
//
#ifdef X_STALL_SENSITIVITY
#define X_STOP_PIN X_DIAG_PIN
#if X_HOME_TO_MIN
#define X_MAX_PIN P1_26 // E0DET
#else
#define X_MIN_PIN P1_26 // E0DET
#endif
#elif ENABLED(X_DUAL_ENDSTOPS)
#ifndef X_MIN_PIN
#define X_MIN_PIN P1_29 // X-STOP
#endif
#ifndef X_MAX_PIN
#define X_MAX_PIN P1_26 // E0DET
#endif
#else
#define X_STOP_PIN P1_29 // X-STOP
#endif
#ifdef Y_STALL_SENSITIVITY
#define Y_STOP_PIN Y_DIAG_PIN
#if Y_HOME_TO_MIN
#define Y_MAX_PIN P1_25 // E1DET
#else
#define Y_MIN_PIN P1_25 // E1DET
#endif
#elif ENABLED(Y_DUAL_ENDSTOPS)
#ifndef Y_MIN_PIN
#define Y_MIN_PIN P1_28 // Y-STOP
#endif
#ifndef Y_MAX_PIN
#define Y_MAX_PIN P1_25 // E1DET
#endif
#else
#define Y_STOP_PIN P1_28 // Y-STOP
#endif
#ifdef Z_STALL_SENSITIVITY
#define Z_STOP_PIN Z_DIAG_PIN
#if Z_HOME_TO_MIN
#define Z_MAX_PIN P1_00 // PWRDET
#else
#define Z_MIN_PIN P1_00 // PWRDET
#endif
#elif ENABLED(Z_MULTI_ENDSTOPS)
#ifndef Z_MIN_PIN
#define Z_MIN_PIN P1_27 // Z-STOP
#endif
#ifndef Z_MAX_PIN
#define Z_MAX_PIN P1_00 // PWRDET
#endif
#else
#ifndef Z_STOP_PIN
#define Z_STOP_PIN P1_27 // Z-STOP
#endif
#endif
//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN P0_10
#endif
//
// Probe enable
//
#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN)
#define PROBE_ENABLE_PIN SERVO0_PIN
#endif
//
// Filament Runout Sensor
//
#define FIL_RUNOUT_PIN P1_26 // E0DET
#define FIL_RUNOUT2_PIN P1_25 // E1DET
//
// Power Supply Control
//
#ifndef PS_ON_PIN
#define PS_ON_PIN P1_00 // PWRDET
#endif
//
// Power Loss Detection
//
#ifndef POWER_LOSS_PIN
#define POWER_LOSS_PIN P1_00 // PWRDET
#endif
//
// Steppers
//
#define X_STEP_PIN P2_02
#define X_DIR_PIN P2_06
#define X_ENABLE_PIN P2_01
#ifndef X_CS_PIN
#define X_CS_PIN P1_10
#endif
#define Y_STEP_PIN P0_19
#define Y_DIR_PIN P0_20
#define Y_ENABLE_PIN P2_08
#ifndef Y_CS_PIN
#define Y_CS_PIN P1_09
#endif
#define Z_STEP_PIN P0_22
#define Z_DIR_PIN P2_11
#define Z_ENABLE_PIN P0_21
#ifndef Z_CS_PIN
#define Z_CS_PIN P1_08
#endif
#define E0_STEP_PIN P2_13
#define E0_DIR_PIN P0_11
#define E0_ENABLE_PIN P2_12
#ifndef E0_CS_PIN
#define E0_CS_PIN P1_04
#endif
#define E1_STEP_PIN P1_15
#define E1_DIR_PIN P1_14
#define E1_ENABLE_PIN P1_16
#ifndef E1_CS_PIN
#define E1_CS_PIN P1_01
#endif
#define TEMP_1_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_1_PIN
#define TEMP_BED_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_BED_PIN
//
// Default pins for TMC software SPI
//
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P1_17
#endif
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_05
#endif
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_04
#endif
#if HAS_TMC_UART
/**
* TMC2208/TMC2209 stepper drivers
*
* Hardware serial communication ports.
* If undefined software serial is used according to the pins below
*/
//#define X_HARDWARE_SERIAL Serial1
//#define X2_HARDWARE_SERIAL Serial1
//#define Y_HARDWARE_SERIAL Serial1
//#define Y2_HARDWARE_SERIAL Serial1
//#define Z_HARDWARE_SERIAL Serial1
//#define Z2_HARDWARE_SERIAL Serial1
//#define E0_HARDWARE_SERIAL Serial1
//#define E1_HARDWARE_SERIAL Serial1
//#define E2_HARDWARE_SERIAL Serial1
//#define E3_HARDWARE_SERIAL Serial1
//#define E4_HARDWARE_SERIAL Serial1
#define X_SERIAL_TX_PIN P1_10
#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
#define Y_SERIAL_TX_PIN P1_09
#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
#define Z_SERIAL_TX_PIN P1_08
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
#define E0_SERIAL_TX_PIN P1_04
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
#define E1_SERIAL_TX_PIN P1_01
#define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
// Reduce baud rate to improve software serial reliability
#ifndef TMC_BAUD_RATE
#define TMC_BAUD_RATE 19200
#endif
#endif // HAS_TMC_UART
/** ------ ------
* 1.30 | 1 2 | 0.28 0.17 | 1 2 | 0.15
* 1.18 | 3 4 | 1.19 3.26 | 3 4 | 0.16
* 1.20 5 6 | 1.21 3.25 5 6 | 0.18
* 1.22 | 7 8 | 1.23 1.31 | 7 8 | RESET
* GND | 9 10 | 5V GND | 9 10 | --
* ------ ------
* EXP1 EXP2
*/
#define EXP1_01_PIN P1_30
#define EXP1_02_PIN P0_28
#define EXP1_03_PIN P1_18
#define EXP1_04_PIN P1_19
#define EXP1_05_PIN P1_20
#define EXP1_06_PIN P1_21
#define EXP1_07_PIN P1_22
#define EXP1_08_PIN P1_23
#define EXP2_01_PIN P0_17
#define EXP2_02_PIN P0_15
#define EXP2_03_PIN P3_26
#define EXP2_04_PIN P0_16
#define EXP2_05_PIN P3_25
#define EXP2_06_PIN P0_18
#define EXP2_07_PIN P1_31
#define EXP2_08_PIN -1 // RESET
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
// RET6 DWIN ENCODER LCD
#define BTN_ENC EXP1_05_PIN
#define BTN_EN1 EXP1_08_PIN
#define BTN_EN2 EXP1_07_PIN
#ifndef BEEPER_PIN
#define BEEPER_PIN EXP1_06_PIN
#endif
#elif HAS_WIRED_LCD
#if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING)
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! ANET_FULL_GRAPHICS_LCD_ALT_WIRING requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#endif
/**
* 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way.
* 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!)
*
* !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!!
*
* The ANET_FULL_GRAPHICS_LCD_ALT_WIRING connector plug:
*
* BEFORE AFTER
* ------ ------
* (BEEPER) | 1 2 | (CLK) (BEEPER) |10 9 | (CLK)
* (BTN_ENC) | 3 4 | -- (BTN_ENC) | 8 7 | --
* (BTN_EN1) 5 6 | (SID) (BTN_EN1) 6 5 | (SID)
* (BTN_EN2) | 7 8 | (CS) (BTN_EN2) | 4 3 | (CS)
* 5V | 9 10 | GND GND | 2 1 | 5V
* ------ ------
* LCD LCD
*/
#define LCD_PINS_RS EXP1_04_PIN
#define BTN_EN1 EXP1_06_PIN
#define BTN_EN2 EXP1_07_PIN
#define BTN_ENC EXP1_01_PIN
#define LCD_PINS_EN EXP1_03_PIN
#define LCD_PINS_D4 EXP1_05_PIN
#define BEEPER_PIN EXP1_08_PIN
#elif ENABLED(ANET_FULL_GRAPHICS_LCD)
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#endif
/**
* 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way.
* 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!)
* 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because it is open drain.)
* 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board.
*
* !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!!
*
* The ANET_FULL_GRAPHICS_LCD connector plug:
*
* BEFORE AFTER
* ------ ------
* (BEEPER) | 1 2 | (CLK) (BEEPER) |10 9 | --
* (BTN_ENC) | 3 4 | -- (BTN_ENC) | 8 7 | (CLK)
* (BTN_EN1) 5 6 | (SID) (BTN_EN1) 6 5 | (SID)
* (BTN_EN2) | 7 8 | (CS) (BTN_EN2) | 4 3 | (CS)
* 5V | 9 10 | GND GND | 2 1 | 5V
* ------ ------
* LCD LCD
*/
#define LCD_PINS_RS EXP1_08_PIN
#define BTN_EN1 EXP1_05_PIN
#define BTN_EN2 EXP1_07_PIN
#define BTN_ENC EXP1_03_PIN
#define LCD_PINS_EN EXP1_06_PIN
#define LCD_PINS_D4 EXP1_04_PIN
#define BEEPER_PIN EXP1_01_PIN
#elif ENABLED(CR10_STOCKDISPLAY)
#define LCD_PINS_RS EXP1_07_PIN
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN
#define BTN_ENC EXP1_02_PIN
#define LCD_PINS_EN EXP1_08_PIN
#define LCD_PINS_D4 EXP1_06_PIN
#elif ENABLED(ENDER2_STOCKDISPLAY)
/** Creality Ender-2 display pinout
* ------
* (SCK) 1.30 | 1 2 | 0.28 (BTN_ENC)
* (BTN_EN1) 1.18 | 3 4 | 1.19 (RESET)
* (BTN_EN2) 1.20 5 6 | 1.21 (LCD_A0)
* (LCD_RS) 1.22 | 7 8 | 1.23 (MOSI)
* GND | 9 10 | 5V
* ------
* EXP1
*/
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN
#define BTN_ENC EXP1_02_PIN
#define DOGLCD_CS EXP1_07_PIN
#define DOGLCD_A0 EXP1_06_PIN
#define DOGLCD_SCK EXP1_01_PIN
#define DOGLCD_MOSI EXP1_08_PIN
#define FORCE_SOFT_SPI
#define LCD_BACKLIGHT_PIN -1
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
#define SDCARD_CONNECTION ONBOARD
#define BEEPER_PIN EXP1_01_PIN
#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 EXP2_03_PIN
#define BTN_EN2 EXP2_05_PIN
#define TFT_A0_PIN TFT_DC_PIN
#ifndef TFT_WIDTH
#define TFT_WIDTH 480
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#if ENABLED(BTT_TFT35_SPI_V1_0)
/**
* ------ ------
* BEEPER | 1 2 | LCD-BTN MISO | 1 2 | CLK
* T_MOSI | 3 4 | T_CS LCD-ENCA | 3 4 | TFTCS
* T_CLK | 5 6 T_MISO LCD-ENCB | 5 6 MOSI
* PENIRQ | 7 8 | F_CS RS | 7 8 | RESET
* GND | 9 10 | VCC GND | 9 10 | NC
* ------ ------
* EXP1 EXP2
*
* 480x320, 3.5", SPI Display with Rotary Encoder.
* Stock Display for the BIQU B1 SE Series.
* Schematic: https://github.com/bigtreetech/TFT35-SPI/blob/master/v1/Hardware/BTT%20TFT35-SPI%20V1-SCH.pdf
*/
#define TFT_CS_PIN EXP2_04_PIN
#define TFT_DC_PIN EXP2_07_PIN
#define TFT_SCK_PIN EXP2_02_PIN
#define TFT_MISO_PIN EXP2_01_PIN
#define TFT_MOSI_PIN EXP2_06_PIN
#define TOUCH_CS_PIN EXP1_04_PIN
#define TOUCH_SCK_PIN EXP1_05_PIN
#define TOUCH_MISO_PIN EXP1_06_PIN
#define TOUCH_MOSI_PIN EXP1_03_PIN
#define TOUCH_INT_PIN EXP1_07_PIN
#elif ENABLED(MKS_TS35_V2_0)
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! MKS_TS35_V2_0 requires wiring modifications. The SKR 1.4 EXP ports are rotated 180° from what the MKS_TS35_V2_0 expects. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this error.)"
#endif
/** ------ ------
* BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK
* TFT_BKL / LCD_EN | 3 4 | TFT_RESET / LCD_RS BTN_EN1 | 3 4 | SPI1_CS
* TOUCH_CS / LCD_D4 | 5 6 TOUCH_INT / LCD_D5 BTN_EN2 | 5 6 SPI1_MOSI
* SPI1_CS / LCD_D6 | 7 8 | SPI1_RS / LCD_D7 SPI1_RS | 7 8 | RESET
* GND | 9 10 | VCC GND | 9 10 | VCC
* ------ ------
* EXP1 EXP2
*/
#define TFT_CS_PIN EXP1_07_PIN
#define TFT_DC_PIN EXP1_08_PIN
#define TFT_RESET_PIN EXP1_04_PIN
#define TFT_BACKLIGHT_PIN EXP1_03_PIN
//#define TFT_RST_PIN EXP2_07_PIN
#define TFT_SCK_PIN EXP2_02_PIN
#define TFT_MISO_PIN EXP2_01_PIN
#define TFT_MOSI_PIN EXP2_06_PIN
#define LCD_USE_DMA_SPI
#define TFT_BUFFER_WORDS 2400
#define TOUCH_CS_PIN EXP1_05_PIN
#define TOUCH_INT_PIN EXP1_06_PIN
#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1
#endif
#if ENABLED(TFT_CLASSIC_UI)
#ifndef TOUCH_CALIBRATION_X
#define TOUCH_CALIBRATION_X -16794
#endif
#ifndef TOUCH_CALIBRATION_Y
#define TOUCH_CALIBRATION_Y 11000
#endif
#ifndef TOUCH_OFFSET_X
#define TOUCH_OFFSET_X 1024
#endif
#ifndef TOUCH_OFFSET_Y
#define TOUCH_OFFSET_Y -352
#endif
#elif ENABLED(TFT_COLOR_UI)
#ifndef TOUCH_CALIBRATION_X
#define TOUCH_CALIBRATION_X -16741
#endif
#ifndef TOUCH_CALIBRATION_Y
#define TOUCH_CALIBRATION_Y 11258
#endif
#ifndef TOUCH_OFFSET_X
#define TOUCH_OFFSET_X 1024
#endif
#ifndef TOUCH_OFFSET_Y
#define TOUCH_OFFSET_Y -367
#endif
#define TFT_BUFFER_WORDS 2400
#endif
#elif IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS EXP2_03_PIN
#endif
#define SD_DETECT_PIN EXP2_07_PIN
#else
#define BTN_ENC EXP1_02_PIN // (58) open-drain
#define LCD_PINS_RS EXP1_04_PIN
#define BTN_EN1 EXP2_03_PIN // (31) J3-2 & AUX-4
#define BTN_EN2 EXP2_05_PIN // (33) J3-4 & AUX-4
#define LCD_PINS_EN EXP1_03_PIN
#define LCD_PINS_D4 EXP1_05_PIN
#define LCD_SDSS EXP2_04_PIN // (16) J3-7 & AUX-4
#if ENABLED(FYSETC_MINI_12864)
#define DOGLCD_CS EXP1_03_PIN
#define DOGLCD_A0 EXP1_04_PIN
#define DOGLCD_SCK EXP2_02_PIN
#define DOGLCD_MOSI EXP2_06_PIN
#define LCD_BACKLIGHT_PIN -1
#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
// results in LCD soft SPI mode 3, SD soft SPI mode 0
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
#if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN EXP1_06_PIN
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN EXP1_07_PIN
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN EXP1_08_PIN
#endif
#elif ENABLED(FYSETC_MINI_12864_2_1)
#define NEOPIXEL_PIN EXP1_06_PIN
#endif
#else // !FYSETC_MINI_12864
#if ENABLED(MKS_MINI_12864)
#define DOGLCD_CS EXP1_06_PIN
#define DOGLCD_A0 EXP1_07_PIN
#define DOGLCD_SCK EXP2_02_PIN
#define DOGLCD_MOSI EXP2_06_PIN
#define FORCE_SOFT_SPI
#endif
#if IS_ULTIPANEL
#define LCD_PINS_D5 EXP1_06_PIN
#define LCD_PINS_D6 EXP1_07_PIN
#define LCD_PINS_D7 EXP1_08_PIN
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BTN_ENC_EN EXP1_08_PIN // Detect the presence of the encoder
#endif
#endif
#endif // !FYSETC_MINI_12864
#endif // HAS_MARLINUI_U8GLIB
#endif // HAS_WIRED_LCD
#if HAS_ADC_BUTTONS
#error "ADC BUTTONS do not work unmodified on SKR 1.4, The ADC ports cannot take more than 3.3v."
#endif
//
// NeoPixel LED
//
#ifndef NEOPIXEL_PIN
#define NEOPIXEL_PIN P1_24
#endif
/**
* Special pins
* P1_30 (37) (NOT 5V tolerant)
* P1_31 (49) (NOT 5V tolerant)
* P0_27 (57) (Open collector)
* P0_28 (58) (Open collector)
*/
//
// Include common SKR pins
//
#include "pins_BTT_SKR_common.h"

View File

@@ -0,0 +1,210 @@
/**
* 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
#include "env_validate.h"
// If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION
// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT
//#define BTT_MOTOR_EXPANSION
#if ALL(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION)
#if ANY(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
#define EXP_MOT_USE_EXP2_ONLY 1
#else
#error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time."
#endif
#endif
// Ignore temp readings during development.
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
//
// Steppers
//
#ifndef E1_STEP_PIN
#define E1_STEP_PIN P0_01
#endif
#ifndef E1_DIR_PIN
#define E1_DIR_PIN P0_00
#endif
#ifndef E1_ENABLE_PIN
#define E1_ENABLE_PIN P0_10
#endif
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#ifndef TEMP_0_PIN
#define TEMP_0_PIN P0_24_A1 // A1 (T1) - (68) - TEMP_0_PIN
#endif
#ifndef TEMP_1_PIN
#define TEMP_1_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_1_PIN
#endif
#ifndef TEMP_BED_PIN
#define TEMP_BED_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_BED_PIN
#endif
#if HOTENDS == 1 && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
#if TEMP_SENSOR_PROBE
#define TEMP_PROBE_PIN TEMP_1_PIN
#elif TEMP_SENSOR_CHAMBER
#define TEMP_CHAMBER_PIN TEMP_1_PIN
#endif
#endif
// CS, MISO, MOSI, and SCK for MAX Thermocouple SPI
#if HAS_MAX_TC
//#define TEMP_0_CS_PIN P...
//#define TEMP_0_MISO_PIN P...
//#define TEMP_0_MOSI_PIN P...
//#define TEMP_0_SCK_PIN P...
//#define TEMP_1_CS_PIN P...
//#define TEMP_1_MISO_PIN P...
//#define TEMP_1_MOSI_PIN P...
//#define TEMP_1_SCK_PIN P...
#endif
//
// Heaters / Fans
//
#ifndef HEATER_0_PIN
#define HEATER_0_PIN P2_07
#endif
#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
#ifndef FAN1_PIN
#define FAN1_PIN P2_04
#endif
#else
#ifndef HEATER_1_PIN
#define HEATER_1_PIN P2_04
#endif
#endif
#ifndef FAN0_PIN
#define FAN0_PIN P2_03
#endif
#ifndef HEATER_BED_PIN
#define HEATER_BED_PIN P2_05
#endif
//
// LCD / Controller
//
#if !defined(BEEPER_PIN) && HAS_WIRED_LCD && DISABLED(LCD_USE_I2C_BUZZER)
#define BEEPER_PIN P1_30 // (EXP1-1) Not 5V-tolerant
#endif
//
// SD Support
//
#ifndef SDCARD_CONNECTION
#if HAS_WIRED_LCD
#define SDCARD_CONNECTION LCD
#else
#define SDCARD_CONNECTION ONBOARD
#endif
#endif
#if SD_CONNECTION_IS(LCD) && ENABLED(SKR_USE_LCD_SD_CARD_PINS_FOR_CS)
#error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_SD_CARD_PINS_FOR_CS."
#endif
#if SD_CONNECTION_IS(LCD)
#define SD_SCK_PIN P0_15
#define SD_MISO_PIN P0_17
#define SD_MOSI_PIN P0_18
#define SD_SS_PIN EXP2_04_PIN
#define SD_DETECT_PIN EXP2_07_PIN
#elif SD_CONNECTION_IS(ONBOARD)
#undef SD_DETECT_PIN
#define SD_DETECT_PIN P0_27
#define SD_SCK_PIN P0_07
#define SD_MISO_PIN P0_08
#define SD_MOSI_PIN P0_09
#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
#define SD_SS_PIN ONBOARD_SD_CS_PIN
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
#error "No custom SD drive cable defined for this board."
#endif
#if ENABLED(BTT_MOTOR_EXPANSION)
/**
* ------ ------
* (M3STP) | 1 2 | (M3DIR) (M3DIAG) | 1 2 | (M3RX)
* (M2STP) | 3 4 | (M2DIR) (M2DIAG) | 3 4 | (M2RX)
* (M1DIR) 5 6 | (M1STP) (M1DIAG) 5 6 | (M1RX)
* (M1EN) | 7 8 | -- (M3EN) | 7 8 | (M2EN)
* GND | 9 10 | -- GND | 9 10 | --
* ------ ------
* EXP2 EXP1
*
* NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN
*/
// M1 on Driver Expansion Module
#define E2_STEP_PIN EXP2_06_PIN
#define E2_DIR_PIN EXP2_05_PIN
#define E2_ENABLE_PIN EXP2_07_PIN
#if !EXP_MOT_USE_EXP2_ONLY
#define E2_DIAG_PIN EXP1_05_PIN
#define E2_CS_PIN EXP1_06_PIN
#if HAS_TMC_UART
#define E2_SERIAL_TX_PIN EXP1_06_PIN
#define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
#endif
#endif
// M2 on Driver Expansion Module
#define E3_STEP_PIN EXP2_03_PIN
#define E3_DIR_PIN EXP2_04_PIN
#if !EXP_MOT_USE_EXP2_ONLY
#define E3_ENABLE_PIN EXP1_08_PIN
#define E3_DIAG_PIN EXP1_03_PIN
#define E3_CS_PIN EXP1_04_PIN
#if HAS_TMC_UART
#define E3_SERIAL_TX_PIN EXP1_04_PIN
#define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
#endif
#else
#define E3_ENABLE_PIN EXP2_07_PIN
#endif
// M3 on Driver Expansion Module
#define E4_STEP_PIN EXP2_01_PIN
#define E4_DIR_PIN EXP2_02_PIN
#if !EXP_MOT_USE_EXP2_ONLY
#define E4_ENABLE_PIN EXP1_07_PIN
#define E4_DIAG_PIN EXP1_01_PIN
#define E4_CS_PIN EXP1_02_PIN
#if HAS_TMC_UART
#define E4_SERIAL_TX_PIN EXP1_02_PIN
#define E4_SERIAL_RX_PIN E4_SERIAL_TX_PIN
#endif
#else
#define E4_ENABLE_PIN EXP2_07_PIN
#endif
#endif // BTT_MOTOR_EXPANSION

View File

@@ -0,0 +1,152 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 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
/**
* eMotion-Tech eMotronic pin assignments
* Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/eMotion-Tech%20eMotronic/eMotronic_brd_sources_1.0.4/eMotronic_sch.pdf
* Origin: https://data.emotion-tech.com/ftp/Datasheets_et_sources/Sources/eMotronic_brd_sources_1.0.4.zip
*
* Board pins<->features assignments are based on the
* Micro-Delta Rework printer default connections.
*/
#include "env_validate.h"
#define BOARD_INFO_NAME "eMotronic"
#define BOARD_WEBSITE_URL "www.reprap-france.com/article/lemotronic-quesaco"
//
// Limit Switches
//
#define X_STOP_PIN P1_22 // S0
#define Y_STOP_PIN P1_23 // S1
#define Z_STOP_PIN P1_24 // S2
#define I_STOP_PIN P1_25 // S3
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN P0_26 // S4 (opto)
#endif
//
// Steppers
//
#define X_STEP_PIN P2_02 // M3
#define X_DIR_PIN P4_28
#define X_ENABLE_PIN P4_29
#define Y_STEP_PIN P2_01 // M2
#define Y_DIR_PIN P0_22
#define Y_ENABLE_PIN P0_21
#define Z_STEP_PIN P2_00 // M1
#define Z_DIR_PIN P3_26
#define Z_ENABLE_PIN P3_25
#define E0_STEP_PIN P2_03 // M4
#define E0_DIR_PIN P0_04
#define E0_ENABLE_PIN P0_05 // Correct!
#define E1_STEP_PIN P2_08 // M5
#define E1_DIR_PIN P0_20
#define E1_ENABLE_PIN P0_19
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#define TEMP_0_PIN P0_24_A1 // A1 (TH1)
#define TEMP_1_PIN P0_23_A0 // A0 (TH0)
#define TEMP_BED_PIN P0_25_A2 // A2 (TH2)
//
// Heaters / Fans
//
#define _H0_PIN P2_04 // (H0: 15A)
#define HEATER_BED_PIN P2_05 // (H1: 10A shared)
#define HEATER_0_PIN P2_06 // (H2: 10A shared)
#define HEATER_1_PIN P2_07 // (H3: 10A shared)
#define FAN0_PIN P2_11 // (FAN0: 1A)
#define FAN1_PIN P2_13 // (FAN1: 1A)
//
// Extension ports
//
#define EXP1_01_PIN P0_03 // RX0
#define EXP1_02_PIN P0_02 // TX0
#define EXP1_03_PIN P1_30
#define EXP1_04_PIN P1_31
#define EXP1_05_PIN P0_17 // MISO0
#define EXP1_06_PIN P0_18 // MOSI0
#define EXP1_07_PIN P0_15 // SCK0
#define EXP1_08_PIN P0_16 // SSEL0
#define EXP1_09_PIN P0_27 // SDA0
#define EXP1_10_PIN P0_28 // SCL0
#define EXP2_01_PIN P0_10
#define EXP2_02_PIN P0_11
#define EXP2_03_PIN P0_00 // SDA1
#define EXP2_04_PIN P0_01 // SCL1
#define EXP2_05_PIN P1_28
#define EXP2_06_PIN P1_29
#define EXP2_07_PIN P1_26
#define EXP2_08_PIN P1_27
//
// SD Support
//
#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD
#endif
#if SD_CONNECTION_IS(ONBOARD)
#define SD_SCK_PIN P0_07
#define SD_MISO_PIN P0_08
#define SD_MOSI_PIN P0_09
#define SD_SS_PIN P0_06
#elif SD_CONNECTION_IS(LCD)
#define SD_SCK_PIN EXP1_07_PIN
#define SD_MISO_PIN EXP1_05_PIN
#define SD_MOSI_PIN EXP1_06_PIN
#define SD_SS_PIN EXP1_08_PIN
#define SD_DETECT_PIN EXP1_04_PIN
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
#error "No custom SD drive cable defined for this board."
#endif
//
// LCD / Controller
//
#if ENABLED(EMOTION_TECH_LCD)
#define BEEPER_PIN EXP2_01_PIN
#define DOGLCD_A0 EXP2_06_PIN
#define DOGLCD_CS EXP2_04_PIN
#define DOGLCD_SCK EXP1_07_PIN
#define DOGLCD_MOSI EXP1_06_PIN
#define BTN_EN1 EXP2_07_PIN
#define BTN_EN2 EXP2_05_PIN
#define BTN_ENC EXP2_02_PIN
#endif

View File

@@ -0,0 +1,178 @@
/**
* 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
/**
* GMARSH X6 Rev.1 pin assignments
* Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/GMARSH%20X6%20Rev.1/armprinter_2208_1heater.pdf
* Origin: https://github.com/gmarsh/gmarsh_x6/blob/master/armprinter_2208_1heater.pdf
*/
#include "env_validate.h"
#define BOARD_INFO_NAME "GMARSH X6 REV1"
// Ignore temp readings during development.
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
//
// Enable 12MHz clock output on P1.27 pin to sync TMC2208 chip clocks
//
#define LPC1768_ENABLE_CLKOUT_12M
//
// Servos
//
#define SERVO0_PIN P1_26 // PWM1[6]
#define SERVO1_PIN P1_18 // PWM1[1]
//
// Limit Switches
//
#define X_MIN_PIN P0_00
#define X_MAX_PIN P0_01
#define Y_MIN_PIN P0_10
#define Y_MAX_PIN P0_21
#define Z_MIN_PIN P2_13
#define Z_MAX_PIN P2_22
//
// Steppers
//
#define X_STEP_PIN P1_01
#define X_DIR_PIN P1_04
#define X_ENABLE_PIN P0_26
#define Y_STEP_PIN P1_10
#define Y_DIR_PIN P1_14
#define Y_ENABLE_PIN P1_08
#define Z_STEP_PIN P1_17
#define Z_DIR_PIN P4_29
#define Z_ENABLE_PIN P1_15
#define E0_STEP_PIN P0_05
#define E0_DIR_PIN P2_00
#define E0_ENABLE_PIN P4_28
#define E1_STEP_PIN P2_03
#define E1_DIR_PIN P2_04
#define E1_ENABLE_PIN P2_01
#define E2_STEP_PIN P2_07
#define E2_DIR_PIN P2_08
#define E2_ENABLE_PIN P2_05
//
// TMC2208 UART pins
//
#if HAS_TMC_UART
#define X_SERIAL_TX_PIN P1_00
#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
#define Y_SERIAL_TX_PIN P1_09
#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
#define Z_SERIAL_TX_PIN P1_16
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
#define E0_SERIAL_TX_PIN P0_04
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
#define E1_SERIAL_TX_PIN P2_02
#define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
#define E2_SERIAL_TX_PIN P2_06
#define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
// Reduce baud rate to improve software serial reliability
#ifndef TMC_BAUD_RATE
#define TMC_BAUD_RATE 19200
#endif
#else
#error "TMC2208 UART configuration is required for GMarsh X6."
#endif
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#define TEMP_0_PIN P0_24_A1 // AD0[0] on P0_23
#define TEMP_BED_PIN P0_23_A0 // AD0[1] on P0_24
//
// Heaters / Fans
//
#define HEATER_BED_PIN P1_19 // Not a PWM pin, software PWM required
#define HEATER_0_PIN P3_26 // PWM1[3]
#define FAN0_PIN P3_25 // Part cooling fan - connected to PWM1[2]
#define E0_AUTO_FAN_PIN P0_27 // Extruder cooling fan
//
// Misc. Functions
//
#define LED_PIN P1_31
#define POWER_MONITOR_VOLTAGE_PIN P0_25_A2
//
// LCD
//
#if IS_RRD_SC
#define BEEPER_PIN P0_19
#define BTN_EN1 P1_23
#define BTN_EN2 P1_24
#define BTN_ENC P1_25
#define LCD_PINS_RS P0_20
#define LCD_PINS_EN P0_21
#define LCD_PINS_D4 P2_11
#define LCD_PINS_D5 P0_22
#define LCD_PINS_D6 P1_29
#define LCD_PINS_D7 P1_28
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
#endif
#endif
//
// SD Support
//
#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION LCD
#endif
#if SD_CONNECTION_IS(LCD)
#define SD_SCK_PIN P0_15
#define SD_MISO_PIN P0_17
#define SD_MOSI_PIN P0_18
#define SD_SS_PIN P0_16
#define SD_DETECT_PIN P1_22
#elif SD_CONNECTION_IS(ONBOARD)
#define SD_SCK_PIN P0_07
#define SD_MISO_PIN P0_08
#define SD_MOSI_PIN P0_09
#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
#define SD_SS_PIN ONBOARD_SD_CS_PIN
#endif

View File

@@ -0,0 +1,393 @@
/**
* 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
/**
* Makerbase MKS SBASE pin assignments
* Schematic (V1.3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SBASE%20V1.3/MKS%20SBASE%20V1.3_002%20SCH.pdf
* Origin (V1.3): http://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SBASE%20V1.3/MKS%20SBASE%20V1.3_002%20SCH.pdf
*/
#include "env_validate.h"
#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "MKS SBASE"
#endif
#ifndef BOARD_WEBSITE_URL
#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SBASE"
#endif
#define LED_PIN P1_18 // Used as a status indicator
#define LED2_PIN P1_19
#define LED3_PIN P1_20
#define LED4_PIN P1_21
//
// Servos
//
#define SERVO0_PIN P1_23 // J8-3 (low jitter)
#define SERVO1_PIN P2_12 // J8-4
#define SERVO2_PIN P2_11 // J8-5
#define SERVO3_PIN P4_28 // J8-6
//
// Limit Switches - Not Interrupt Capable
//
#define X_MIN_PIN P1_24 // 10k pullup to 3.3V, 1K series
#define X_MAX_PIN P1_25 // 10k pullup to 3.3V, 1K series
#define Y_MIN_PIN P1_26 // 10k pullup to 3.3V, 1K series
#define Y_MAX_PIN P1_27 // 10k pullup to 3.3V, 1K series
#define Z_MIN_PIN P1_28 // The original Mks Sbase DIO19 has a 10k pullup to 3.3V or 5V, 1K series, so when using a Zprobe we must use DIO41 (J8 P1.22)
#define Z_MAX_PIN P1_29 // 10k pullup to 3.3V, 1K series
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN P4_28 // Connector J8
#endif
//
// Steppers
//
#define X_STEP_PIN P2_00
#define X_DIR_PIN P0_05
#define X_ENABLE_PIN P0_04
#define Y_STEP_PIN P2_01
#define Y_DIR_PIN P0_11
#define Y_ENABLE_PIN P0_10
#define Z_STEP_PIN P2_02
#define Z_DIR_PIN P0_20
#define Z_ENABLE_PIN P0_19
#define E0_STEP_PIN P2_03
#define E0_DIR_PIN P0_22
#define E0_ENABLE_PIN P0_21
#define E1_STEP_PIN P2_08
#define E1_DIR_PIN P2_13
#define E1_ENABLE_PIN P4_29
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#define TEMP_BED_PIN P0_23_A0 // A0 (TH1)
#define TEMP_0_PIN P0_24_A1 // A1 (TH2)
#define TEMP_1_PIN P0_25_A2 // A2 (TH3)
#define TEMP_2_PIN P0_26_A3 // A3 (TH4)
//
// Heaters / Fans
//
#define HEATER_BED_PIN P2_05
#define HEATER_0_PIN P2_07
#define HEATER_1_PIN P2_06
#ifndef FAN0_PIN
#define FAN0_PIN P2_04
#endif
//
// Connector J7
// Note: These pins are all digitally shared with the EXP1/EXP2 Connector.
// Using them with an LCD connected or configured will lead to hangs & crashes.
//
//#define PIN_P0_17 P0_17 // 5V
//#define PIN_P0_16 P0_16 // NC
//#define PIN_P0_15 P0_15 // GND
//
// Connector J8
//
#define PIN_P1_22 P1_22 // GND
#define PIN_P1_23 P1_23 // PWM-capable
#define PIN_P2_12 P2_12 // Interrupt-capable
#define PIN_P2_11 P2_11 // Interrupt-capable
//
// Průša i3 MMU1 (Multi Material Multiplexer) Support
//
#if HAS_PRUSA_MMU1
#define E_MUX0_PIN PIN_P1_23 // J8-3
#define E_MUX1_PIN PIN_P2_12 // J8-4
#define E_MUX2_PIN PIN_P2_11 // J8-5
#endif
//
// Power Supply Control
//
#if ENABLED(MKS_PWC)
#define PS_ON_PIN P0_25 // SERVO
#define KILL_PIN P1_29 // Z+
#define KILL_PIN_STATE HIGH
#endif
//
// Ethernet pins
//
#if !IS_ULTIPANEL
#define ENET_MDIO P1_17 // J12-4
#define ENET_RX_ER P1_14 // J12-6
#define ENET_RXD1 P1_10 // J12-8
#endif
#define ENET_MOC P1_16 // J12-3
#define REF_CLK P1_15 // J12-5
#define ENET_RXD0 P1_09 // J12-7
#define ENET_CRS P1_08 // J12-9
#define ENET_TX_EN P1_04 // J12-10
#define ENET_TXD0 P1_00 // J12-11
#define ENET_TXD1 P1_01 // J12-12
#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD
#endif
#if SD_CONNECTION_IS(CUSTOM_CABLE)
/**
* A custom cable is needed.
* See https://github.com/MarlinFirmware/Configurations/blob/release-2.1/config/examples/Mks/Sbase/README.md
* P0.27 is on EXP2 and the on-board SD card socket so it can't be used as SD_DETECT for the LCD SD card.
*
* The best solution is to use the custom cable to connect the LCD SD_DETECT to a pin NOT on EXP2.
*
* If you can't find a pin to use for the LCD SD_DETECT then comment out SD_DETECT_PIN and remove that wire
* from the the custom cable.
*/
#define SD_DETECT_PIN PIN_P2_11 // J8-5 (moved from EXP2 P0.27)
#define SD_SCK_PIN PIN_P1_22 // J8-2 (moved from EXP2 P0.7)
#define SD_MISO_PIN PIN_P1_23 // J8-3 (moved from EXP2 P0.8)
#define SD_MOSI_PIN PIN_P2_12 // J8-4 (moved from EXP2 P0.9)
#define SD_SS_PIN P0_28
#define SOFTWARE_SPI // With a custom cable we need software SPI because the
// selected pins are not on a hardware SPI controller
#elif SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD)
#define SD_SCK_PIN P0_07
#define SD_MISO_PIN P0_08
#define SD_MOSI_PIN P0_09
#if SD_CONNECTION_IS(LCD)
// Use standard cable and header, SPI and SD detect are shared with onboard SD card.
// Hardware SPI is used for both SD cards. The detect pin is shared between the
// LCD and onboard SD readers so we disable it.
#define SD_SS_PIN P0_28
#else
#define SD_DETECT_PIN P0_27
#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
#define SD_SS_PIN ONBOARD_SD_CS_PIN
#endif
#endif
/**
* ------ ------
* 1.31 | 1 2 | 1.30 0.08 | 1 2 | 0.07
* 0.18 | 3 4 | 0.16 3.25 | 3 4 | 0.28
* 0.15 | 5 6 -- 3.26 | 5 6 0.09
* -- | 7 8 | -- 0.27 | 7 8 | RESET
* GND | 9 10 | 5V GND | 9 10 | --
* ------ ------
* EXP1 EXP2
*/
#define EXP1_01_PIN P1_31
#define EXP1_02_PIN P1_30
#define EXP1_03_PIN P0_18
#define EXP1_04_PIN P0_16
#define EXP1_05_PIN P0_15
#define EXP2_01_PIN P0_08
#define EXP2_02_PIN P0_07
#define EXP2_03_PIN P3_25
#define EXP2_04_PIN P0_28
#define EXP2_05_PIN P3_26
#define EXP2_06_PIN P0_09
#define EXP2_07_PIN P0_27
//
// LCD / Controller
//
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS EXP2_03_PIN
#endif
#if SD_CONNECTION_IS(LCD)
#define SD_DETECT_PIN EXP2_04_PIN
#endif
#elif HAS_WIRED_LCD
#define BEEPER_PIN EXP1_01_PIN
#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 EXP2_05_PIN
#define BTN_EN2 EXP2_03_PIN
#define LCD_PINS_RS EXP1_04_PIN
#define LCD_SDSS EXP2_04_PIN
#define LCD_PINS_EN EXP1_03_PIN
#define LCD_PINS_D4 EXP1_05_PIN
#if ANY(VIKI2, miniVIKI)
#define DOGLCD_SCK SD_SCK_PIN
#define DOGLCD_MOSI SD_MOSI_PIN
#endif
#if ENABLED(FYSETC_MINI_12864)
/**
* The FYSETC display can NOT use the SCK and MOSI pins on EXP2, so a
* special cable is needed to go between EXP2 on the FYSETC and the
* controller board's EXP2 and J8. It also means that a software SPI
* is needed to drive those pins.
*
* The FYSETC requires mode 3 SPI interface.
*
* Pins 6, 7 & 8 on EXP2 are no connects. That means a second special
* cable will be needed if the RGB LEDs are to be active.
*/
#define DOGLCD_CS EXP1_03_PIN // LCD_EN
#define DOGLCD_A0 EXP1_04_PIN // LCD_A0
#define DOGLCD_SCK PIN_P2_11 // J8-5 (SCK on FYSETC schematic)
#define DOGLCD_MOSI P4_28 // J8-6 (MOSI on FYSETC schematic)
//#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
// results in LCD soft SPI mode 3, SD soft SPI mode 0
#if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN PIN_P2_12 // J8-4 (LCD_D6 on FYSETC schematic)
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN PIN_P1_23 // J8-3 (LCD_D5 on FYSETC schematic)
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN PIN_P1_22 // J8-2 (LCD_D7 on FYSETC schematic)
#endif
#elif ENABLED(FYSETC_MINI_12864_2_1)
#define NEOPIXEL_PIN PIN_P2_12
#endif
#elif ENABLED(MINIPANEL)
//#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270
#endif
#endif // HAS_WIRED_LCD
/**
* Example for trinamic drivers using the J8 connector on MKs Sbase.
* 2130s need 1 pin for each driver. 2208/2209s need 2 pins for serial control.
* This board does not have enough pins to use hardware serial.
*/
#if HAS_DRIVER(TMC2130)
// J8
#define X_CS_PIN PIN_P1_22
#define Y_CS_PIN PIN_P1_23
#define Z_CS_PIN PIN_P2_12
#define E0_CS_PIN PIN_P2_11
#define E1_CS_PIN P4_28
// Hardware SPI is on EXP2. See if you can make it work:
// https://github.com/makerbase-mks/MKS-SBASE/issues/25
#define TMC_USE_SW_SPI
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P0_03 // AUX1
#endif
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_02 // AUX1
#endif
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_26 // TH4
#endif
#endif
#if MB(MKS_SBASE) && HAS_TMC_UART
/**
* TMC2208/TMC2209 stepper drivers
*
* The shortage of pins becomes apparent.
* Worst case you may have to give up the LCD
* RX pins need to be interrupt capable
*/
#define X_SERIAL_TX_PIN PIN_P1_22 // J8-2
#define X_SERIAL_RX_PIN PIN_P2_12 // J8-4 Interrupt Capable
#define Y_SERIAL_TX_PIN PIN_P1_23 // J8-3
#define Y_SERIAL_RX_PIN PIN_P2_11 // J8-5 Interrupt Capable
#define Z_SERIAL_TX_PIN PIN_P2_12 // J8-4
#define Z_SERIAL_RX_PIN P0_25 // TH3
#define E0_SERIAL_TX_PIN P4_28 // J8-6
#define E0_SERIAL_RX_PIN P0_26 // TH4
// Reduce baud rate to improve software serial reliability
#ifndef TMC_BAUD_RATE
#define TMC_BAUD_RATE 19200
#endif
#endif // HAS_TMC_UART
// UNUSED
//#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0)
//#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0)
/**
* PWMs
*
* There are 6 PWMs. Each PWM can be assigned to one of two pins.
*
* SERVO2 does NOT have a PWM assigned to it.
*
* PWM1.1 P1_18 SERVO3_PIN FIL_RUNOUT_PIN 5V output, PWM
* PWM1.1 P2_00 E0_STEP_PIN
* PWM1.2 P1_20 SERVO0_PIN
* PWM1.2 P2_01 X_STEP_PIN
* PWM1.3 P1_21 SERVO1_PIN J5-1
* PWM1.3 P2_02 Y_STEP_PIN
* PWM1.4 P1_23 SDSS(SSEL0) J3-5 AUX-3
* PWM1.4 P2_03 Z_STEP_PIN
* PWM1.5 P1_24 X_MIN_PIN 10K PULLUP TO 3.3v, 1K SERIES
* PWM1.5 P2_04 MOSFET_B_PIN
* PWM1.6 P1_26 Y_MIN_PIN 10K PULLUP TO 3.3v, 1K SERIES
* PWM1.6 P2_05 MOSFET_A_PIN
*/
/**
* Special pins
* P1_30 - not 5V tolerant - EXP1
* P1_31 - not 5V tolerant - EXP1
* P0_27 - open collector - EXP2
* P0_28 - open collector - EXP2
*/
/**
* Serial Ports
* P0_00 - Port 3
* P0_01 - SD Card (Onboard)
* P0_10 - Port 2
* P0_11 - Y_EN/Y_DIR
* P0_15 - Port 1
* P0_16 - EXP1
* P0_02 - Port 0
* P0_03 - AUX1
* P0_29 - Port -1
* P0_30 - USB
*/

View File

@@ -0,0 +1,419 @@
/**
* 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
/**
* Makerbase MKS SGEN-L pin assignments
* Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS_GEN_L_V1_0/MKS%20Gen_L%20V1.0_008%20SCH.pdf
* Origin: https://github.com/makerbase-mks/SGEN_L/blob/master/Hardware/MKS%20SGEN_L%20V1.0_001/MKS%20SGEN_L%20V1.0_001%20SCH.pdf
*/
#include "env_validate.h"
#define BOARD_INFO_NAME "MKS SGen-L"
#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN_L"
#define USES_DIAG_JUMPERS
//
// Servos
//
#define SERVO0_PIN P1_23 // SERVO P1.23
#define SERVO1_PIN P2_00 // SERVO P2.0
//
// Trinamic Stallguard pins
//
#define X_DIAG_PIN P1_29 // X-
#define Y_DIAG_PIN P1_27 // Y-
#define Z_DIAG_PIN P1_25 // Z-
#define E0_DIAG_PIN P1_28 // X+
#define E1_DIAG_PIN P1_26 // Y+
//
// Limit Switches
//
#ifdef X_STALL_SENSITIVITY
#define X_STOP_PIN X_DIAG_PIN
#if X_HOME_TO_MIN
#define X_MAX_PIN P1_28 // X+
#else
#define X_MIN_PIN P1_28 // X+
#endif
#else
#define X_MIN_PIN P1_29 // X-
#define X_MAX_PIN P1_28 // X+
#endif
#ifdef Y_STALL_SENSITIVITY
#define Y_STOP_PIN Y_DIAG_PIN
#if Y_HOME_TO_MIN
#define Y_MAX_PIN P1_26 // Y+
#else
#define Y_MIN_PIN P1_26 // Y+
#endif
#else
#define Y_MIN_PIN P1_27 // Y-
#define Y_MAX_PIN P1_26 // Y+
#endif
#ifdef Z_STALL_SENSITIVITY
#define Z_STOP_PIN Z_DIAG_PIN
#if Z_HOME_TO_MIN
#define Z_MAX_PIN P1_24 // Z+
#else
#define Z_MIN_PIN P1_24 // Z+
#endif
#else
#define Z_MIN_PIN P1_25 // Z-
#define Z_MAX_PIN P1_24 // Z+
#endif
//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN P1_24
#endif
//
// Steppers
//
#define X_STEP_PIN P2_02
#define X_DIR_PIN P2_03
#define X_ENABLE_PIN P2_01
#ifndef X_CS_PIN
#define X_CS_PIN P1_01
#endif
#define Y_STEP_PIN P0_19
#define Y_DIR_PIN P0_20
#define Y_ENABLE_PIN P2_08
#ifndef Y_CS_PIN
#define Y_CS_PIN P1_08
#endif
#define Z_STEP_PIN P0_22
#define Z_DIR_PIN P2_11
#define Z_ENABLE_PIN P0_21
#ifndef Z_CS_PIN
#define Z_CS_PIN P1_10
#endif
#define E0_STEP_PIN P2_13
#define E0_DIR_PIN P0_11
#define E0_ENABLE_PIN P2_12
#ifndef E0_CS_PIN
#define E0_CS_PIN P1_15
#endif
#define E1_STEP_PIN P0_01
#define E1_DIR_PIN P0_00
#define E1_ENABLE_PIN P0_10
#ifndef E1_CS_PIN
#define E1_CS_PIN P1_17
#endif
//
// Default pins for TMC software SPI
//
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P4_28
#endif
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P0_05
#endif
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P0_04
#endif
#if HAS_TMC_UART
/**
* TMC2208/TMC2209 stepper drivers
*
* Hardware serial communication ports.
* If undefined software serial is used according to the pins below
*/
//#define X_HARDWARE_SERIAL Serial1
//#define X2_HARDWARE_SERIAL Serial1
//#define Y_HARDWARE_SERIAL Serial1
//#define Y2_HARDWARE_SERIAL Serial1
//#define Z_HARDWARE_SERIAL Serial1
//#define Z2_HARDWARE_SERIAL Serial1
//#define E0_HARDWARE_SERIAL Serial1
//#define E1_HARDWARE_SERIAL Serial1
//#define E2_HARDWARE_SERIAL Serial1
//#define E3_HARDWARE_SERIAL Serial1
//#define E4_HARDWARE_SERIAL Serial1
#define X_SERIAL_TX_PIN P1_04
#define X_SERIAL_RX_PIN P1_01
#define Y_SERIAL_TX_PIN P1_09
#define Y_SERIAL_RX_PIN P1_08
#define Z_SERIAL_TX_PIN P1_14
#define Z_SERIAL_RX_PIN P1_10
#define E0_SERIAL_TX_PIN P1_16
#define E0_SERIAL_RX_PIN P1_15
#define E1_SERIAL_TX_PIN P4_29
#define E1_SERIAL_RX_PIN P1_17
#define Z2_SERIAL_TX_PIN P4_29
#define Z2_SERIAL_RX_PIN P1_17
// Reduce baud rate to improve software serial reliability
#ifndef TMC_BAUD_RATE
#define TMC_BAUD_RATE 19200
#endif
#endif // HAS_TMC_UART
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#define TEMP_0_PIN P0_23_A0 // Analog Input A0 (TH1)
#define TEMP_BED_PIN P0_24_A1 // Analog Input A1 (TB)
#define TEMP_1_PIN P0_25_A2 // Analog Input A2 (TH2)
//
// Heaters / Fans
//
#define HEATER_BED_PIN P2_05
#define HEATER_0_PIN P2_07
#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
#ifndef FAN1_PIN
#define FAN1_PIN P2_06
#endif
#else
#ifndef HEATER_1_PIN
#define HEATER_1_PIN P2_06
#endif
#endif
#ifndef FAN0_PIN
#define FAN0_PIN P2_04
#endif
//
// Power Supply Control
//
#if ENABLED(MKS_PWC)
#define PS_ON_PIN P2_00 // SERVO1
#define KILL_PIN P1_24 // Z+
#define KILL_PIN_STATE HIGH
#endif
//
// Misc. Functions
//
#define LED_PIN P1_18 // Used as a status indicator
#define LED2_PIN P1_19
#define LED3_PIN P1_20
#define LED4_PIN P1_21
/** ------ ------
* (BEEPER) 1.31 | 1 2 | 1.30 (BTN_ENC) (MISO) 0.8 | 1 2 | 0.7 (SD_SCK)
* (LCD_EN) 0.18 | 3 4 | 0.16 (LCD_RS) (BTN_EN1) 3.25 | 3 4 | 0.28 (SD_CS2)
* (LCD_D4) 0.15 5 6 | 0.17 (LCD_D5) (BTN_EN2) 3.26 5 6 | 0.9 (SD_MOSI)
* (LCD_D6) 1.0 | 7 8 | 1.22 (LCD_D7) (SD_DETECT) 0.27 | 7 8 | RESET
* GND | 9 10 | 5V GND | 9 10 | --
* ------ ------
* EXP1 EXP2
*/
#define EXP1_01_PIN P1_31
#define EXP1_02_PIN P1_30
#define EXP1_03_PIN P0_18
#define EXP1_04_PIN P0_16
#define EXP1_05_PIN P0_15
#define EXP1_06_PIN P0_17
#define EXP1_07_PIN P1_00
#define EXP1_08_PIN P1_22
#define EXP2_01_PIN P0_08
#define EXP2_02_PIN P0_07
#define EXP2_03_PIN P3_25
#define EXP2_04_PIN P0_28
#define EXP2_05_PIN P3_26
#define EXP2_06_PIN P0_09
#define EXP2_07_PIN P0_27
#define EXP2_08_PIN -1 // RESET
#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD
#endif
#if SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD)
#define SD_DETECT_PIN EXP2_07_PIN
#define SD_SCK_PIN EXP2_02_PIN
#define SD_MISO_PIN EXP2_01_PIN
#define SD_MOSI_PIN EXP2_06_PIN
#if SD_CONNECTION_IS(ONBOARD)
#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
#define SD_SS_PIN ONBOARD_SD_CS_PIN
#else
#define SD_SS_PIN EXP2_04_PIN
#endif
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
#error "No custom SD drive cable defined for this board."
#endif
#if HAS_WIRED_LCD
#define BEEPER_PIN EXP1_01_PIN
#define BTN_ENC EXP1_02_PIN
#if ENABLED(CR10_STOCKDISPLAY)
#define LCD_PINS_RS EXP1_07_PIN
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN
#define LCD_PINS_EN EXP1_08_PIN
#define LCD_PINS_D4 EXP1_06_PIN
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
#define TFT_CS_PIN EXP1_07_PIN
#define TFT_DC_PIN EXP1_08_PIN
#define TFT_A0_PIN TFT_DC_PIN
#define TFT_MISO_PIN EXP2_01_PIN
#define TFT_BACKLIGHT_PIN EXP1_03_PIN
#define TFT_RESET_PIN EXP1_04_PIN
#define LCD_USE_DMA_SPI
#define TOUCH_INT_PIN EXP1_06_PIN
#define TOUCH_CS_PIN EXP1_05_PIN
#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2
// Disable any LCD related PINs config
#define LCD_PINS_EN -1
#define LCD_PINS_RS -1
#ifndef TFT_BUFFER_WORDS
#define TFT_BUFFER_WORDS 1200
#endif
#ifndef TFT_QUEUE_SIZE
#define TFT_QUEUE_SIZE 6144
#endif
#define BTN_EN1 EXP2_03_PIN
#define BTN_EN2 EXP2_05_PIN
#elif IS_TFTGLCD_PANEL
#undef BEEPER_PIN
#undef BTN_ENC
#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS EXP2_03_PIN
#endif
#else
#define BTN_EN1 EXP2_03_PIN
#define BTN_EN2 EXP2_05_PIN
#define LCD_SDSS EXP2_04_PIN
#if ENABLED(MKS_12864OLED_SSD1306)
#define LCD_PINS_DC EXP1_06_PIN
#define DOGLCD_CS EXP1_04_PIN
#define DOGLCD_A0 LCD_PINS_DC
#define DOGLCD_SCK EXP1_05_PIN
#define DOGLCD_MOSI EXP1_03_PIN
#define LCD_PINS_RS EXP1_07_PIN
#define LCD_PINS_D7 EXP1_08_PIN
#define KILL_PIN -1 // NC
#else // !MKS_12864OLED_SSD1306
#define LCD_PINS_RS EXP1_04_PIN
#define LCD_PINS_EN EXP1_03_PIN
#define LCD_PINS_D4 EXP1_05_PIN
#if ENABLED(FYSETC_MINI_12864)
#define DOGLCD_CS EXP1_03_PIN
#define DOGLCD_A0 EXP1_04_PIN
#define DOGLCD_SCK EXP2_02_PIN
#define DOGLCD_MOSI EXP2_06_PIN
#define LCD_BACKLIGHT_PIN -1
#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
// results in LCD soft SPI mode 3, SD soft SPI mode 0
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
#if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN EXP1_06_PIN
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN EXP1_07_PIN
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN EXP1_08_PIN
#endif
#elif ENABLED(FYSETC_MINI_12864_2_1)
#define NEOPIXEL_PIN EXP1_06_PIN
#endif
#else // !FYSETC_MINI_12864
#if ENABLED(MKS_MINI_12864)
#define DOGLCD_CS EXP1_06_PIN
#define DOGLCD_A0 EXP1_07_PIN
#endif
#if IS_ULTIPANEL
#define LCD_PINS_D5 EXP1_06_PIN
#define LCD_PINS_D6 EXP1_07_PIN
#define LCD_PINS_D7 EXP1_08_PIN
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
#endif
#endif
#endif // !FYSETC_MINI_12864
#endif // !MKS_12864OLED_SSD1306
#endif // !CR10_STOCKDISPLAY
#endif // HAS_WIRED_LCD
//
// Other Pins
//
//#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0)
//#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0)
//#define PS_ON_PIN P1_23 // SERVO0 P1.23

View File

@@ -0,0 +1,494 @@
/**
* 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
/**
* Re-ARM with RAMPS v1.4 pin assignments
* Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Re-ARM%20RAMPS%201.4/Re_ARM_Schematic.pdf
* Origin: https://reprap.org/mediawiki/images/f/fa/Re_ARM_Schematic.pdf
*
* Applies to the following boards:
*
* RAMPS_14_EFB (Hotend, Fan, Bed)
* RAMPS_14_EEB (Hotend0, Hotend1, Bed)
* RAMPS_14_EFF (Hotend, Fan0, Fan1)
* RAMPS_14_EEF (Hotend0, Hotend1, Fan)
* RAMPS_14_SF (Spindle, Controller Fan)
*/
// Numbers in parentheses () are the corresponding mega2560 pin numbers
#include "env_validate.h"
#define BOARD_INFO_NAME "Re-ARM RAMPS 1.4"
//
// Servos
//
#define SERVO0_PIN P1_20 // (11)
#define SERVO1_PIN P1_21 // ( 6) also on J5-1
#define SERVO2_PIN P1_19 // ( 5)
#define SERVO3_PIN P1_18 // ( 4) 5V output
//
// Limit Switches
//
#define X_MIN_PIN P1_24 // ( 3) 10k pullup to 3.3V, 1K series
#define X_MAX_PIN P1_25 // ( 2) 10k pullup to 3.3V, 1K series
#define Y_MIN_PIN P1_26 // (14) 10k pullup to 3.3V, 1K series
#define Y_MAX_PIN P1_27 // (15) 10k pullup to 3.3V, 1K series
#define Z_MIN_PIN P1_29 // (18) 10k pullup to 3.3V, 1K series
#define Z_MAX_PIN P1_28 // (19) 10k pullup to 3.3V, 1K series
#define ONBOARD_ENDSTOPPULLUPS // Board has built-in pullups
//
// Steppers
//
#define X_STEP_PIN P2_01 // (54)
#define X_DIR_PIN P0_11 // (55)
#define X_ENABLE_PIN P0_10 // (38)
#ifndef X_CS_PIN
#define X_CS_PIN P1_01 // ETH
#endif
#define Y_STEP_PIN P2_02 // (60)
#define Y_DIR_PIN P0_20 // (61)
#define Y_ENABLE_PIN P0_19 // (56)
#ifndef Y_CS_PIN
#define Y_CS_PIN P1_04 // ETH
#endif
#define Z_STEP_PIN P2_03 // (46)
#define Z_DIR_PIN P0_22 // (48)
#define Z_ENABLE_PIN P0_21 // (62)
#ifndef Z_CS_PIN
#define Z_CS_PIN P1_10 // ETH
#endif
#define E0_STEP_PIN P2_00 // (26)
#define E0_DIR_PIN P0_05 // (28)
#define E0_ENABLE_PIN P0_04 // (24)
#ifndef E0_CS_PIN
#define E0_CS_PIN P1_14 // ETH
#endif
#define E1_STEP_PIN P2_08 // (36)
#define E1_DIR_PIN P2_13 // (34)
#define E1_ENABLE_PIN P4_29 // (30)
#ifndef E1_CS_PIN
#define E1_CS_PIN -1
#endif
//
// Default pins for TMC software SPI
//
#ifndef TMC_SPI_MOSI
#define TMC_SPI_MOSI P1_00 // ETH
#endif
#ifndef TMC_SPI_MISO
#define TMC_SPI_MISO P1_08 // ETH
#endif
#ifndef TMC_SPI_SCK
#define TMC_SPI_SCK P1_09 // ETH
#endif
#if HAS_TMC_UART
/**
* TMC2208/TMC2209 stepper drivers
*
* Hardware serial communication ports.
* If undefined software serial is used according to the pins below
*/
// P2_08 E1-Step
// P2_13 E1-Dir
#ifndef X_SERIAL_TX_PIN
#define X_SERIAL_TX_PIN P0_01
#endif
#ifndef X_SERIAL_RX_PIN
#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
#endif
#ifndef Y_SERIAL_TX_PIN
#define Y_SERIAL_TX_PIN P0_00
#endif
#ifndef Y_SERIAL_RX_PIN
#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
#endif
#ifndef Z_SERIAL_TX_PIN
#define Z_SERIAL_TX_PIN P2_13
#endif
#ifndef Z_SERIAL_RX_PIN
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
#endif
#ifndef E0_SERIAL_TX_PIN
#define E0_SERIAL_TX_PIN P2_08
#endif
#ifndef E0_SERIAL_RX_PIN
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
#endif
// Reduce baud rate to improve software serial reliability
#ifndef TMC_BAUD_RATE
#define TMC_BAUD_RATE 19200
#endif
#endif // HAS_TMC_UART
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#define TEMP_0_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_0_PIN
#define TEMP_BED_PIN P0_24_A1 // A1 (T1) - (68) - TEMP_BED_PIN
#define TEMP_1_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_1_PIN
#define TEMP_2_PIN P0_26_A3 // A3 - (63) - J5-3 & AUX-2
#define TEMP_3_PIN P1_30_A4 // A4 - (37) - BUZZER_PIN
//#define TEMP_4_PIN P1_31_A5 // A5 - (49) - SD_DETECT_PIN
//#define PIN_P0_03 P0_03_A6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1
#define FILWIDTH_PIN P0_02_A7 // A7 - ( 1) - TXD0 - J4-5 & AUX-1
//
// Heaters / Fans
//
#ifndef MOSFET_A_PIN
#define MOSFET_A_PIN P2_05
#endif
#ifndef MOSFET_B_PIN
#define MOSFET_B_PIN P2_04
#endif
#ifndef MOSFET_C_PIN
#define MOSFET_C_PIN P2_07
#endif
#ifndef MOSFET_D_PIN
#define MOSFET_D_PIN -1
#endif
#define HEATER_0_PIN MOSFET_A_PIN
#if FET_ORDER_EFB // Hotend, Fan, Bed
#define HEATER_BED_PIN MOSFET_C_PIN
#elif FET_ORDER_EEF // Hotend, Hotend, Fan
#define HEATER_1_PIN MOSFET_B_PIN
#elif FET_ORDER_EEB // Hotend, Hotend, Bed
#define HEATER_1_PIN MOSFET_B_PIN
#define HEATER_BED_PIN MOSFET_C_PIN
#elif FET_ORDER_EFF // Hotend, Fan, Fan
#define FAN1_PIN MOSFET_C_PIN
#elif DISABLED(FET_ORDER_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE")
#define HEATER_BED_PIN MOSFET_C_PIN
#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
#define FAN1_PIN MOSFET_D_PIN
#else
#define HEATER_1_PIN MOSFET_D_PIN
#endif
#endif
#ifndef FAN0_PIN
#if ANY(FET_ORDER_EFB, FET_ORDER_EFF) // Hotend, Fan, Bed or Hotend, Fan, Fan
#define FAN0_PIN MOSFET_B_PIN
#elif ANY(FET_ORDER_EEF, FET_ORDER_SF) // Hotend, Hotend, Fan or Spindle, Fan
#define FAN0_PIN MOSFET_C_PIN
#elif FET_ORDER_EEB // Hotend, Hotend, Bed
#define FAN0_PIN P1_18 // (4) IO pin. Buffer needed
#else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
#define FAN0_PIN MOSFET_B_PIN
#endif
#endif
//
// Misc. Functions
//
#define LED_PIN P4_28 // (13)
// define digital pin 5 for the filament runout sensor. Use the RAMPS 1.4 digital input 5 on the servos connector
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN P1_19 // (5)
#endif
#define PS_ON_PIN P2_12 // (12)
#if !defined(TEMP_0_CS_PIN) && !(HAS_Z_AXIS && Z_HOME_DIR)
#define TEMP_0_CS_PIN P1_28
#endif
#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENA_PIN)
#if !defined(NUM_SERVOS) || NUM_SERVOS < 4 // Try to use servo connector
#define CASE_LIGHT_PIN P1_18 // (4) MUST BE HARDWARE PWM
#endif
#endif
//
// M3/M4/M5 - Spindle/Laser Control
// Use servo pins, if available
//
#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA)
#if NUM_SERVOS > 1
#if ENABLED(SPINDLE_FEATURE)
#error "SPINDLE_FEATURE requires 3 free servo pins."
#else
#error "LASER_FEATURE requires 3 free servo pins."
#endif
#endif
#define SPINDLE_LASER_PWM_PIN SERVO3_PIN // (4) MUST BE HARDWARE PWM
#define SPINDLE_LASER_ENA_PIN SERVO1_PIN // (6) Pin should have a pullup/pulldown!
#define SPINDLE_DIR_PIN SERVO2_PIN // (5)
#endif
//
// Průša i3 MK2 Multiplexer Support
//
#if HAS_PRUSA_MMU1
#if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0
#define E_MUX0_PIN P0_03 // ( 0) Z_CS_PIN
#define E_MUX1_PIN P0_02 // ( 1) E0_CS_PIN
#endif
#define E_MUX2_PIN P0_26 // (63) E1_CS_PIN
#endif
/**
* LCD / Controller
*
* All controllers can use J3 and J5 on the Re-ARM board. Custom cabling will be required.
*
* - https://github.com/wolfmanjm/universal-panel-adapter
* - https://panucattdevices.freshdesk.com/support/solutions/articles/1000243195-lcd-display-installation
*/
/**
* Smart LCD adapter
*
* The Smart LCD adapter can be used for the two 10 pin LCD controllers such as
* REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use
* DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable
* is needed to pick up 5V for the EXP1 connection.
*
* SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines
* on the LCD display during accesses of the SD card. The menus/code has been arranged so
* that the garbage/lines are erased immediately after the SD card accesses are completed.
*/
#if ENABLED(CR10_STOCKDISPLAY)
// Re-Arm can support Creality stock display without SD card reader and single cable on EXP3.
// Re-Arm J3 pins 1 (P1.31) & 2 (P3.26) are not used. Stock cable will need to have one
// 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3.
#define BEEPER_PIN P2_11 // J3-3 & AUX-4
#define BTN_EN1 P1_23 // J3-5 & AUX-4
#define BTN_EN2 P0_16 // J3-7 & AUX-4
#define BTN_ENC P3_25 // J3-4 & AUX-4
#define LCD_PINS_RS P0_15 // J3-9 & AUX-4 (CS)
#define LCD_PINS_EN P0_18 // J3-10 & AUX-3 (SID, MOSI)
#define LCD_PINS_D4 P2_06 // J3-8 & AUX-3 (SCK, CLK)
#elif ENABLED(ZONESTAR_LCD)
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! ZONESTAR_LCD on REARM requires wiring modifications. NB. ADCs are not 5V tolerant. See 'pins_RAMPS_RE_ARM.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#endif
#elif IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS P3_26 // (31) J3-2 & AUX-4
#endif
#define SD_DETECT_PIN P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant)
#define KILL_PIN P1_22 // (41) J5-4 & AUX-4
#elif HAS_WIRED_LCD
#if ENABLED(FYSETC_MINI_12864)
#define BEEPER_PIN P1_01 // (79) J12-12
#define BTN_ENC P1_04 // (77) J12-10
#else
#define BEEPER_PIN P1_30 // (37) not 5V tolerant
#define BTN_ENC P2_11 // (35) J3-3 & AUX-4
#endif
#define BTN_EN1 P3_26 // (31) J3-2 & AUX-4
#define BTN_EN2 P3_25 // (33) J3-4 & AUX-4
#define SD_DETECT_PIN P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant)
#define KILL_PIN P1_22 // (41) J5-4 & AUX-4
#define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4
#define LCD_SDSS P1_23 // (53) J3-5 & AUX-3
#if IS_NEWPANEL
#if IS_RRW_KEYPAD
#define SHIFT_OUT_PIN P0_18 // (51) (MOSI) J3-10 & AUX-3
#define SHIFT_CLK_PIN P0_15 // (52) (SCK) J3-9 & AUX-3
#define SHIFT_LD_PIN P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant)
#endif
#else
//#define SHIFT_CLK_PIN P3_26 // (31) J3-2 & AUX-4
//#define SHIFT_LD_PIN P3_25 // (33) J3-4 & AUX-4
//#define SHIFT_OUT_PIN P2_11 // (35) J3-3 & AUX-4
//#define SHIFT_EN_PIN P1_22 // (41) J5-4 & AUX-4
#endif
#if ANY(VIKI2, miniVIKI)
#define DOGLCD_CS P0_16 // (16)
#define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2
#define DOGLCD_SCK P0_15 // (52) (SCK) J3-9 & AUX-3
#define DOGLCD_MOSI P0_18 // (51) (MOSI) J3-10 & AUX-3
#define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes
#define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes
//#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270
#else
#if ENABLED(FYSETC_MINI_12864)
#define DOGLCD_SCK P0_15 // (52) (SCK) J3-9 & AUX-3
#define DOGLCD_MOSI P0_18 // (51) (MOSI) J3-10 & AUX-3
// EXP1 on LCD adapter is not usable - using Ethernet connector instead
#define DOGLCD_CS P1_09 // (74) J12-7
#define DOGLCD_A0 P1_14 // (73) J12-6
//#define FORCE_SOFT_SPI // Use this if Hardware SPI causes display problems.
// Results in LCD Software SPI mode 3, SD Software SPI mode 0.
#define LCD_RESET_PIN P0_16 // Must be high or open for LCD to operate normally.
#if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN P1_00
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN P1_01
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN P1_08
#endif
#elif ENABLED(FYSETC_MINI_12864_2_1)
#define NEOPIXEL_PIN P1_00
#endif
#else
#define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2
#define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2
#endif
#define LCD_BACKLIGHT_PIN P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers
#define LCD_PINS_EN P0_18 // (51) (MOSI) J3-10 & AUX-3
#define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3
#if IS_ULTIPANEL
#define LCD_PINS_D5 P1_17 // (71) ENET_MDIO
#define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER
#define LCD_PINS_D7 P1_10 // (75) ENET_RXD1
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
#endif
#endif
#endif
#if ENABLED(MINIPANEL)
//#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270
#endif
#endif // HAS_WIRED_LCD
//
// Ethernet pins
//
#if !IS_ULTIPANEL
#define ENET_MDIO P1_17 // (71) J12-4
#define ENET_RX_ER P1_14 // (73) J12-6
#define ENET_RXD1 P1_10 // (75) J12-8
#endif
#define ENET_MOC P1_16 // (70) J12-3
#define REF_CLK P1_15 // (72) J12-5
#define ENET_RXD0 P1_09 // (74) J12-7
#define ENET_CRS P1_08 // (76) J12-9
#define ENET_TX_EN P1_04 // (77) J12-10
#define ENET_TXD0 P1_00 // (78) J12-11
#define ENET_TXD1 P1_01 // (79) J12-12
//
// SD Support
//
#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD
#endif
#if SD_CONNECTION_IS(LCD)
#define SD_SCK_PIN P0_15 // (52) System-defined J3-9 & AUX-3
#define SD_MISO_PIN P0_17 // (50) System-defined J3-10 & AUX-3
#define SD_MOSI_PIN P0_18 // (51) System-defined J3-10 & AUX-3
#define SD_SS_PIN P1_23 // (53) System-defined J3-5 & AUX-3 (aka SDSS, CS)
#elif SD_CONNECTION_IS(ONBOARD)
#undef SD_DETECT_PIN
#define SD_SCK_PIN P0_07
#define SD_MISO_PIN P0_08
#define SD_MOSI_PIN P0_09
#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
#define SD_SS_PIN ONBOARD_SD_CS_PIN
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
#error "No custom SD drive cable defined for this board."
#endif
/**
* Fast PWMs
*
* The LPC1768's hardware PWM controller has 6 channels. Each channel
* can be setup to either control a dedicated pin directly or to generate
* an interrupt. The direct method's duty cycle is accurate to within a
* a microsecond. The interrupt method's average duty cycle has the
* the same accuracy but the individual cycles can vary because of higher
* priority interrupts.
*
* All Fast PWMs have a 50Hz rate.
*
* The following pins/signals use the direct method. All other pins use the
* the interrupt method. Note that SERVO2_PIN and MOSFET_C_PIN use the
* interrupt method.
*
* P1_20 (11) SERVO0_PIN
* P1_21 ( 6) SERVO1_PIN J5-1
* P0_18 ( 4) SERVO3_PIN 5V output
* *P2_04 ( 9) MOSFET_B_PIN
* *P2_05 (10) MOSFET_A_PIN
*
* * - If used as a heater driver then a Fast PWM is NOT assigned. If used as
* a fan driver then enabling FAST_PWM_FAN assigns a Fast PWM to it.
*/
/**
* Special pins
* P1_30 (37) (NOT 5V tolerant)
* P1_31 (49) (NOT 5V tolerant)
* P0_27 (57) (Open collector)
* P0_28 (58) (Open collector)
*/
/**
* The following mega2560 pins are NOT available in a Re-ARM system:
*
* 7, 17, 22, 23, 25, 27, 29, 32, 39, 40, 42, 43, 44, 45, 47, 64, 65, 66
*/

View File

@@ -0,0 +1,118 @@
/**
* 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
/**
* Selena Compact pin assignments
* Pinout: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Selena%20Compact/Compact%20Pinout.pdf
* Origin: https://github.com/f61/Selena/blob/master/Compact%20Pinout.pdf
*/
#include "env_validate.h"
#define BOARD_INFO_NAME "Selena Compact"
#define BOARD_WEBSITE_URL "github.com/Ales2-k/Selena"
//
// Servos
//
#define SERVO0_PIN P1_23
//
// Limit Switches
//
#define X_MIN_PIN P1_28
#define X_MAX_PIN P1_25
#define Y_STOP_PIN P2_11
#define Z_STOP_PIN P1_27
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN P1_22
#endif
//
// Steppers
//
#define X_STEP_PIN P2_00
#define X_DIR_PIN P0_05
#define X_ENABLE_PIN P0_04
#define Y_STEP_PIN P2_01
#define Y_DIR_PIN P0_11
#define Y_ENABLE_PIN P0_10
#define Z_STEP_PIN P2_02
#define Z_DIR_PIN P0_20
#define Z_ENABLE_PIN P0_19
#define E0_STEP_PIN P2_03
#define E0_DIR_PIN P0_22
#define E0_ENABLE_PIN P0_21
#define E1_STEP_PIN P2_08
#define E1_DIR_PIN P2_13
#define E1_ENABLE_PIN P4_29
//
// Temperature Sensors
// 3.3V max when defined as an analog input
//
#define TEMP_BED_PIN P0_23_A0 // A0 (TH1)
#define TEMP_0_PIN P0_24_A1 // A1 (TH2)
#define TEMP_1_PIN P0_25_A2 // A2 (TH3)
//
// Heaters / Fans
//
#define HEATER_BED_PIN P2_05
#define HEATER_BED2_PIN P2_04
#define HEATER_0_PIN P2_07
#define HEATER_1_PIN P2_06
#ifndef FAN0_PIN
#define FAN0_PIN P1_24
#endif
#define FAN1_PIN P1_26
//
// Display
//
#if IS_RRD_FG_SC
#define LCD_PINS_RS P0_16
#define LCD_PINS_EN P0_18
#define LCD_PINS_D4 P0_15
#define LCD_PINS_D5 P1_00
#define LCD_PINS_D6 P1_01
#define LCD_PINS_D7 P1_04
#define BEEPER_PIN P1_31
#define BTN_EN1 P3_25
#define BTN_EN2 P3_26
#define BTN_ENC P1_30
#define SD_DETECT_PIN -1
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
#endif
#endif // IS_RRD_FG_SC