|
| 1 | +/** |
| 2 | + * Marlin 3D Printer Firmware |
| 3 | + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] |
| 4 | + * |
| 5 | + * Based on Sprinter and grbl. |
| 6 | + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm |
| 7 | + * |
| 8 | + * This program is free software: you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU General Public License as published by |
| 10 | + * the Free Software Foundation, either version 3 of the License, or |
| 11 | + * (at your option) any later version. |
| 12 | + * |
| 13 | + * This program is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU General Public License for more details. |
| 17 | + * |
| 18 | + * You should have received a copy of the GNU General Public License |
| 19 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 20 | + * |
| 21 | + */ |
| 22 | +#pragma once |
| 23 | + |
| 24 | +/** |
| 25 | + * Sovol 1.3.1 (GD32F103RET6) board pin assignments |
| 26 | + */ |
| 27 | + |
| 28 | +#include "env_validate.h" |
| 29 | + |
| 30 | +#if HOTENDS > 1 || E_STEPPERS > 1 |
| 31 | + #error "SOVOL V131 only supports 1 hotend / E-stepper." |
| 32 | +#endif |
| 33 | + |
| 34 | +#ifndef BOARD_INFO_NAME |
| 35 | + #define BOARD_INFO_NAME "Sovol V131" |
| 36 | +#endif |
| 37 | +#ifndef DEFAULT_MACHINE_NAME |
| 38 | + #define DEFAULT_MACHINE_NAME "Sovol SV06" |
| 39 | +#endif |
| 40 | + |
| 41 | +//#define BOARD_NO_NATIVE_USB |
| 42 | + |
| 43 | +// |
| 44 | +// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role |
| 45 | +// |
| 46 | +#ifndef DISABLE_DEBUG |
| 47 | + #define DISABLE_DEBUG |
| 48 | +#endif |
| 49 | + |
| 50 | +// |
| 51 | +// EEPROM |
| 52 | +// |
| 53 | +#if NO_EEPROM_SELECTED |
| 54 | + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 |
| 55 | + //#define SDCARD_EEPROM_EMULATION |
| 56 | + #undef NO_EEPROM_SELECTED |
| 57 | +#endif |
| 58 | + |
| 59 | +#if ENABLED(IIC_BL24CXX_EEPROM) |
| 60 | + #define IIC_EEPROM_SDA PA11 |
| 61 | + #define IIC_EEPROM_SCL PA12 |
| 62 | + #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16) |
| 63 | +#elif ENABLED(SDCARD_EEPROM_EMULATION) |
| 64 | + #define MARLIN_EEPROM_SIZE 0x800 // 2K |
| 65 | +#endif |
| 66 | + |
| 67 | +// |
| 68 | +// Servos |
| 69 | +// |
| 70 | +#ifndef SERVO0_PIN |
| 71 | + #ifndef HAS_PIN_27_BOARD |
| 72 | + #define SERVO0_PIN PB0 // BLTouch OUT |
| 73 | + #else |
| 74 | + #define SERVO0_PIN PC6 |
| 75 | + #endif |
| 76 | +#endif |
| 77 | + |
| 78 | +// |
| 79 | +// Limit Switches |
| 80 | +// |
| 81 | +#ifndef X_STOP_PIN |
| 82 | + #define X_STOP_PIN PA5 |
| 83 | +#endif |
| 84 | +#ifndef Y_STOP_PIN |
| 85 | + #define Y_STOP_PIN PA6 |
| 86 | +#endif |
| 87 | +#ifndef Z_STOP_PIN |
| 88 | + #define Z_STOP_PIN PA7 |
| 89 | +#endif |
| 90 | + |
| 91 | +#ifndef Z_MIN_PROBE_PIN |
| 92 | + #define Z_MIN_PROBE_PIN PB1 // BLTouch IN |
| 93 | +#endif |
| 94 | + |
| 95 | +// |
| 96 | +// Filament Runout Sensor |
| 97 | +// |
| 98 | +#ifndef FIL_RUNOUT_PIN |
| 99 | + #define FIL_RUNOUT_PIN PA4 // "Pulled-high" |
| 100 | +#endif |
| 101 | + |
| 102 | +// |
| 103 | +// Steppers |
| 104 | +// |
| 105 | +#ifndef X_STEP_PIN |
| 106 | + #define X_STEP_PIN PC2 |
| 107 | +#endif |
| 108 | +#ifndef X_DIR_PIN |
| 109 | + #define X_DIR_PIN PB9 |
| 110 | +#endif |
| 111 | +#define X_ENABLE_PIN PC3 // Shared |
| 112 | + |
| 113 | +#ifndef Y_STEP_PIN |
| 114 | + #define Y_STEP_PIN PB8 |
| 115 | +#endif |
| 116 | +#ifndef Y_DIR_PIN |
| 117 | + #define Y_DIR_PIN PB7 |
| 118 | +#endif |
| 119 | +#define Y_ENABLE_PIN X_ENABLE_PIN |
| 120 | + |
| 121 | +#ifndef Z_STEP_PIN |
| 122 | + #define Z_STEP_PIN PB6 |
| 123 | +#endif |
| 124 | +#ifndef Z_DIR_PIN |
| 125 | + #define Z_DIR_PIN PB5 |
| 126 | +#endif |
| 127 | +#define Z_ENABLE_PIN X_ENABLE_PIN |
| 128 | + |
| 129 | +#ifndef E0_STEP_PIN |
| 130 | + #define E0_STEP_PIN PB4 |
| 131 | +#endif |
| 132 | +#ifndef E0_DIR_PIN |
| 133 | + #define E0_DIR_PIN PB3 |
| 134 | +#endif |
| 135 | +#define E0_ENABLE_PIN X_ENABLE_PIN |
| 136 | + |
| 137 | +#if HAS_TMC_UART |
| 138 | + |
| 139 | + /** |
| 140 | + * TMC2208/TMC2209 stepper drivers |
| 141 | + * |
| 142 | + * Hardware serial communication ports. |
| 143 | + * If undefined software serial is used according to the pins below |
| 144 | + */ |
| 145 | + |
| 146 | + #define X_SERIAL_TX_PIN PC1 |
| 147 | + #define X_SERIAL_RX_PIN PC1 |
| 148 | + |
| 149 | + #define Y_SERIAL_TX_PIN PC0 |
| 150 | + #define Y_SERIAL_RX_PIN PC0 |
| 151 | + |
| 152 | + #define Z_SERIAL_TX_PIN PA15 |
| 153 | + #define Z_SERIAL_RX_PIN PA15 |
| 154 | + |
| 155 | + #define E0_SERIAL_TX_PIN PC14 |
| 156 | + #define E0_SERIAL_RX_PIN PC14 |
| 157 | + |
| 158 | + // Reduce baud rate to improve software serial reliability |
| 159 | + #define TMC_BAUD_RATE 19200 |
| 160 | + |
| 161 | +#endif // HAS_TMC_UART |
| 162 | + |
| 163 | +// |
| 164 | +// Temperature Sensors |
| 165 | +// |
| 166 | +#define TEMP_0_PIN PC5 // TH1 |
| 167 | +#define TEMP_BED_PIN PC4 // TB1 |
| 168 | + |
| 169 | +// |
| 170 | +// Heaters / Fans |
| 171 | +// |
| 172 | +#ifndef HEATER_0_PIN |
| 173 | + #define HEATER_0_PIN PA1 // HEATER1 |
| 174 | +#endif |
| 175 | +#ifndef HEATER_BED_PIN |
| 176 | + #define HEATER_BED_PIN PA2 // HOT BED |
| 177 | +#endif |
| 178 | +#ifndef FAN_PIN |
| 179 | + #define FAN_PIN PA0 // FAN |
| 180 | +#endif |
| 181 | +#define FAN_SOFT_PWM_REQUIRED |
| 182 | + |
| 183 | +// |
| 184 | +// SD Card |
| 185 | +// |
| 186 | +#define SD_DETECT_PIN PC7 |
| 187 | +#define SDCARD_CONNECTION ONBOARD |
| 188 | +#define ONBOARD_SPI_DEVICE 1 |
| 189 | +#define ONBOARD_SD_CS_PIN PA4 // SDSS |
| 190 | +#define SDIO_SUPPORT |
| 191 | +#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer |
| 192 | + |
| 193 | +#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI) |
| 194 | + /** |
| 195 | + * RET6 12864 LCD |
| 196 | + * ------ |
| 197 | + * PC6 | 1 2 | PB2 |
| 198 | + * PB10 | 3 4 | PB11 |
| 199 | + * PB14 5 6 | PB13 |
| 200 | + * PB12 | 7 8 | PB15 |
| 201 | + * GND | 9 10 | 5V |
| 202 | + * ------ |
| 203 | + */ |
| 204 | + #define EXP3_01_PIN PC6 |
| 205 | + #define EXP3_02_PIN PB2 |
| 206 | + #define EXP3_03_PIN PB10 |
| 207 | + #define EXP3_04_PIN PB11 |
| 208 | + #define EXP3_05_PIN PB14 |
| 209 | + #define EXP3_06_PIN PB13 |
| 210 | + #define EXP3_07_PIN PB12 |
| 211 | + #define EXP3_08_PIN PB15 |
| 212 | +#endif |
| 213 | + |
| 214 | +#if ENABLED(CR10_STOCKDISPLAY) |
| 215 | + |
| 216 | + #if ENABLED(RET6_12864_LCD) |
| 217 | + |
| 218 | + #define LCD_PINS_RS EXP3_07_PIN |
| 219 | + #define LCD_PINS_ENABLE EXP3_08_PIN |
| 220 | + #define LCD_PINS_D4 EXP3_06_PIN |
| 221 | + |
| 222 | + #define BTN_ENC EXP3_02_PIN |
| 223 | + #define BTN_EN1 EXP3_03_PIN |
| 224 | + #define BTN_EN2 EXP3_05_PIN |
| 225 | + |
| 226 | + #ifndef HAS_PIN_27_BOARD |
| 227 | + #define BEEPER_PIN EXP3_01_PIN |
| 228 | + #endif |
| 229 | + |
| 230 | + #else |
| 231 | + |
| 232 | + #error "Only the RET6_12864_LCD variant of CR10_STOCKDISPLAY is supported." |
| 233 | + |
| 234 | + #endif |
| 235 | + |
| 236 | +#endif |
0 commit comments