2019-11-20 07:06:26 +01:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
2020-02-03 15:00:57 +01:00
|
|
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2019-11-20 07:06:26 +01:00
|
|
|
*
|
|
|
|
* 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
|
2020-07-23 05:20:14 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2019-11-20 07:06:26 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2021-03-05 11:30:52 +01:00
|
|
|
#include "env_validate.h"
|
2019-11-20 07:06:26 +01:00
|
|
|
|
2021-05-09 10:52:53 +02:00
|
|
|
// If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION
|
2020-11-11 03:06:42 +01:00
|
|
|
// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT
|
2021-05-09 10:52:53 +02:00
|
|
|
//#define BTT_MOTOR_EXPANSION
|
2020-11-11 03:06:42 +01:00
|
|
|
|
2021-05-09 10:52:53 +02:00
|
|
|
#if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION)
|
2020-12-09 03:17:55 +01:00
|
|
|
#if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
|
2020-12-09 03:22:30 +01:00
|
|
|
#define EXP_MOT_USE_EXP2_ONLY 1
|
2020-12-07 21:57:00 +01:00
|
|
|
#else
|
2020-12-09 03:22:30 +01:00
|
|
|
#error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time."
|
2020-12-07 21:57:00 +01:00
|
|
|
#endif
|
2020-11-11 03:06:42 +01:00
|
|
|
#endif
|
|
|
|
|
2019-11-20 07:06:26 +01:00
|
|
|
// Ignore temp readings during development.
|
2020-08-22 08:22:14 +02:00
|
|
|
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
|
2019-11-20 07:06:26 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// Steppers
|
|
|
|
//
|
2019-12-19 09:41:35 +01:00
|
|
|
#ifndef E1_STEP_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define E1_STEP_PIN P0_01
|
2019-12-19 09:41:35 +01:00
|
|
|
#endif
|
|
|
|
#ifndef E1_DIR_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define E1_DIR_PIN P0_00
|
2019-12-19 09:41:35 +01:00
|
|
|
#endif
|
|
|
|
#ifndef E1_ENABLE_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define E1_ENABLE_PIN P0_10
|
2019-12-19 09:41:35 +01:00
|
|
|
#endif
|
2019-11-20 07:06:26 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// Temperature Sensors
|
|
|
|
// 3.3V max when defined as an analog input
|
|
|
|
//
|
2019-12-19 09:41:35 +01:00
|
|
|
#ifndef TEMP_0_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define TEMP_0_PIN P0_24_A1 // A1 (T1) - (68) - TEMP_0_PIN
|
2019-12-19 09:41:35 +01:00
|
|
|
#endif
|
|
|
|
#ifndef TEMP_1_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define TEMP_1_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_1_PIN
|
2019-12-19 09:41:35 +01:00
|
|
|
#endif
|
|
|
|
#ifndef TEMP_BED_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define TEMP_BED_PIN P0_23_A0 // A0 (T0) - (67) - TEMP_BED_PIN
|
2019-12-19 09:41:35 +01:00
|
|
|
#endif
|
2020-03-03 21:52:10 +01:00
|
|
|
|
2021-08-19 03:12:41 +02:00
|
|
|
#if HOTENDS == 1 && !REDUNDANT_TEMP_MATCH(SOURCE, E1)
|
2020-06-19 21:01:15 +02:00
|
|
|
#if TEMP_SENSOR_PROBE
|
|
|
|
#define TEMP_PROBE_PIN TEMP_1_PIN
|
|
|
|
#elif TEMP_SENSOR_CHAMBER
|
|
|
|
#define TEMP_CHAMBER_PIN TEMP_1_PIN
|
|
|
|
#endif
|
2020-01-18 00:16:45 +01:00
|
|
|
#endif
|
2019-11-20 07:06:26 +01:00
|
|
|
|
2021-07-07 02:36:41 +02:00
|
|
|
// 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
|
|
|
|
|
2019-11-20 07:06:26 +01:00
|
|
|
//
|
|
|
|
// Heaters / Fans
|
|
|
|
//
|
|
|
|
#ifndef HEATER_0_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define HEATER_0_PIN P2_07
|
2019-11-20 07:06:26 +01:00
|
|
|
#endif
|
2021-07-08 06:41:33 +02:00
|
|
|
#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
|
2019-11-20 07:06:26 +01:00
|
|
|
#ifndef FAN1_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define FAN1_PIN P2_04
|
2019-11-20 07:06:26 +01:00
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#ifndef HEATER_1_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define HEATER_1_PIN P2_04
|
2019-11-20 07:06:26 +01:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifndef FAN_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define FAN_PIN P2_03
|
2019-11-20 07:06:26 +01:00
|
|
|
#endif
|
|
|
|
#ifndef HEATER_BED_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define HEATER_BED_PIN P2_05
|
2019-11-20 07:06:26 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// LCD / Controller
|
|
|
|
//
|
2020-12-23 08:21:02 +01:00
|
|
|
#if !defined(BEEPER_PIN) && HAS_WIRED_LCD && DISABLED(LCD_USE_I2C_BUZZER)
|
2020-03-22 03:13:19 +01:00
|
|
|
#define BEEPER_PIN P1_30 // (37) not 5V tolerant
|
2019-11-20 07:06:26 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// SD Support
|
|
|
|
//
|
2021-05-01 06:15:16 +02:00
|
|
|
#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)
|
2021-08-07 23:06:51 +02:00
|
|
|
#error "SDCARD_CONNECTION must not be 'LCD' with SKR_USE_LCD_SD_CARD_PINS_FOR_CS."
|
2021-05-01 06:15:16 +02:00
|
|
|
#endif
|
|
|
|
|
2019-11-20 07:06:26 +01:00
|
|
|
#if SD_CONNECTION_IS(LCD)
|
2021-01-01 21:31:15 +01:00
|
|
|
#define SD_SCK_PIN P0_15
|
|
|
|
#define SD_MISO_PIN P0_17
|
|
|
|
#define SD_MOSI_PIN P0_18
|
2022-07-16 23:26:36 +02:00
|
|
|
#define SD_SS_PIN EXP2_04_PIN
|
|
|
|
#define SD_DETECT_PIN EXP2_07_PIN
|
2021-05-01 06:15:16 +02:00
|
|
|
|
2019-11-20 07:06:26 +01:00
|
|
|
#elif SD_CONNECTION_IS(ONBOARD)
|
|
|
|
#undef SD_DETECT_PIN
|
2020-03-22 03:13:19 +01:00
|
|
|
#define SD_DETECT_PIN P0_27
|
2021-01-01 21:31:15 +01:00
|
|
|
#define SD_SCK_PIN P0_07
|
|
|
|
#define SD_MISO_PIN P0_08
|
|
|
|
#define SD_MOSI_PIN P0_09
|
2021-08-25 01:07:41 +02:00
|
|
|
#define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card
|
2021-01-01 21:31:15 +01:00
|
|
|
#define SD_SS_PIN ONBOARD_SD_CS_PIN
|
2019-11-20 07:06:26 +01:00
|
|
|
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
|
|
|
|
#error "No custom SD drive cable defined for this board."
|
|
|
|
#endif
|
2020-11-11 03:06:42 +01:00
|
|
|
|
2021-05-09 10:52:53 +02:00
|
|
|
#if ENABLED(BTT_MOTOR_EXPANSION)
|
2021-12-28 03:52:43 +01:00
|
|
|
/**
|
|
|
|
* ------ ------
|
2022-07-16 23:26:36 +02:00
|
|
|
* (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 | --
|
2021-12-28 03:52:43 +01:00
|
|
|
* ------ ------
|
|
|
|
* EXP2 EXP1
|
2020-12-09 03:17:55 +01:00
|
|
|
*
|
|
|
|
* NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN
|
|
|
|
*/
|
2020-11-11 03:06:42 +01:00
|
|
|
|
|
|
|
// M1 on Driver Expansion Module
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E2_STEP_PIN EXP2_06_PIN
|
|
|
|
#define E2_DIR_PIN EXP2_05_PIN
|
|
|
|
#define E2_ENABLE_PIN EXP2_07_PIN
|
2020-12-09 03:22:30 +01:00
|
|
|
#if !EXP_MOT_USE_EXP2_ONLY
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E2_DIAG_PIN EXP1_05_PIN
|
|
|
|
#define E2_CS_PIN EXP1_06_PIN
|
2020-12-07 21:57:00 +01:00
|
|
|
#if HAS_TMC_UART
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E2_SERIAL_TX_PIN EXP1_06_PIN
|
2021-08-21 22:07:52 +02:00
|
|
|
#define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
|
2020-12-07 21:57:00 +01:00
|
|
|
#endif
|
2020-11-11 03:06:42 +01:00
|
|
|
#endif
|
2020-12-09 03:17:55 +01:00
|
|
|
|
2020-11-11 03:06:42 +01:00
|
|
|
// M2 on Driver Expansion Module
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E3_STEP_PIN EXP2_03_PIN
|
|
|
|
#define E3_DIR_PIN EXP2_04_PIN
|
2020-12-09 03:22:30 +01:00
|
|
|
#if !EXP_MOT_USE_EXP2_ONLY
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E3_ENABLE_PIN EXP1_08_PIN
|
|
|
|
#define E3_DIAG_PIN EXP1_03_PIN
|
|
|
|
#define E3_CS_PIN EXP1_04_PIN
|
2020-12-07 21:57:00 +01:00
|
|
|
#if HAS_TMC_UART
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E3_SERIAL_TX_PIN EXP1_04_PIN
|
2021-08-21 22:07:52 +02:00
|
|
|
#define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
|
2020-12-07 21:57:00 +01:00
|
|
|
#endif
|
|
|
|
#else
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E3_ENABLE_PIN EXP2_07_PIN
|
2020-11-11 03:06:42 +01:00
|
|
|
#endif
|
2020-12-09 03:17:55 +01:00
|
|
|
|
2020-11-11 03:06:42 +01:00
|
|
|
// M3 on Driver Expansion Module
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E4_STEP_PIN EXP2_01_PIN
|
|
|
|
#define E4_DIR_PIN EXP2_02_PIN
|
2020-12-09 03:22:30 +01:00
|
|
|
#if !EXP_MOT_USE_EXP2_ONLY
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E4_ENABLE_PIN EXP1_07_PIN
|
|
|
|
#define E4_DIAG_PIN EXP1_01_PIN
|
|
|
|
#define E4_CS_PIN EXP1_02_PIN
|
2020-12-07 21:57:00 +01:00
|
|
|
#if HAS_TMC_UART
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E4_SERIAL_TX_PIN EXP1_02_PIN
|
2021-08-21 22:07:52 +02:00
|
|
|
#define E4_SERIAL_RX_PIN E4_SERIAL_TX_PIN
|
2020-12-07 21:57:00 +01:00
|
|
|
#endif
|
|
|
|
#else
|
2022-07-16 23:26:36 +02:00
|
|
|
#define E4_ENABLE_PIN EXP2_07_PIN
|
2020-11-11 03:06:42 +01:00
|
|
|
#endif
|
2020-12-09 03:17:55 +01:00
|
|
|
|
2021-05-09 10:52:53 +02:00
|
|
|
#endif // BTT_MOTOR_EXPANSION
|