Browse Source

FYSETC E4 board support (#20032)

George Fu 4 years ago
parent
commit
4785b04aa1
No account linked to committer's email address
4 changed files with 134 additions and 0 deletions
  1. 1
    0
      Marlin/src/core/boards.h
  2. 126
    0
      Marlin/src/pins/esp32/pins_FYSETC_E4.h
  3. 2
    0
      Marlin/src/pins/pins.h
  4. 5
    0
      platformio.ini

+ 1
- 0
Marlin/src/core/boards.h View File

@@ -378,6 +378,7 @@
378 378
 #define BOARD_MRR_ESPA                6001  // MRR ESPA board based on ESP32 (native pins only)
379 379
 #define BOARD_MRR_ESPE                6002  // MRR ESPE board based on ESP32 (with I2S stepper stream)
380 380
 #define BOARD_E4D_BOX                 6003  // E4d@BOX
381
+#define BOARD_FYSETC_E4               6004  // FYSETC E4
381 382
 
382 383
 //
383 384
 // SAMD51 ARM Cortex M4

+ 126
- 0
Marlin/src/pins/esp32/pins_FYSETC_E4.h View File

@@ -0,0 +1,126 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 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
+ * FYSETC E4 pin assignments
26
+ * FYSETC E4 is a 3D printer control board based on the ESP32 microcontroller.
27
+ * Supports 4 stepper drivers, heated bed, single hotend.
28
+ */
29
+
30
+#ifndef ARDUINO_ARCH_ESP32
31
+  #error "Oops! Select an ESP32 board in 'Tools > Board.'"
32
+#elif EXTRUDERS > 1 || E_STEPPERS > 1
33
+  #error "FYSETC E4 only supports one E Stepper. Comment out this line to continue."
34
+#elif HOTENDS > 1
35
+  #error "FYSETC E4 currently supports only one hotend. Comment out this line to continue."
36
+#endif
37
+
38
+#define BOARD_INFO_NAME       "FYSETC_E4"
39
+#define DEFAULT_MACHINE_NAME  BOARD_INFO_NAME
40
+
41
+//
42
+// Disable I2S stepper stream
43
+//
44
+#undef I2S_STEPPER_STREAM
45
+#define I2S_WS                                -1
46
+#define I2S_BCK                               -1
47
+#define I2S_DATA                              -1
48
+
49
+//
50
+// Limit Switches
51
+//
52
+#define X_STOP_PIN                            34
53
+#define Y_STOP_PIN                            35
54
+#define Z_STOP_PIN                            15
55
+
56
+//
57
+// Steppers
58
+//
59
+#define X_STEP_PIN                            27
60
+#define X_DIR_PIN                             26
61
+#define X_ENABLE_PIN                          25
62
+
63
+#define Y_STEP_PIN                            33
64
+#define Y_DIR_PIN                             32
65
+#define Y_ENABLE_PIN                X_ENABLE_PIN
66
+
67
+#define Z_STEP_PIN                            14
68
+#define Z_DIR_PIN                             12
69
+#define Z_ENABLE_PIN                X_ENABLE_PIN
70
+
71
+#define E0_STEP_PIN                           16
72
+#define E0_DIR_PIN                            17
73
+#define E0_ENABLE_PIN               X_ENABLE_PIN
74
+
75
+#if HAS_TMC_UART
76
+  //
77
+  // TMC2209 stepper drivers
78
+  //
79
+
80
+  //
81
+  // Hardware serial 1
82
+  //
83
+  #define X_HARDWARE_SERIAL              Serial1
84
+  #define Y_HARDWARE_SERIAL              Serial1
85
+  #define Z_HARDWARE_SERIAL              Serial1
86
+  #define E0_HARDWARE_SERIAL             Serial1
87
+
88
+  #define TMC_BAUD_RATE 115200
89
+#endif
90
+
91
+//
92
+// Temperature Sensors
93
+//
94
+#define TEMP_0_PIN                            36  // Analog Input
95
+#define TEMP_BED_PIN                          39  // Analog Input
96
+
97
+//
98
+// Heaters / Fans
99
+//
100
+#define HEATER_0_PIN                           2
101
+#define FAN_PIN                               13
102
+#define HEATER_BED_PIN                         4
103
+
104
+//
105
+// MicroSD card
106
+//
107
+#define MOSI_PIN                              23
108
+#define MISO_PIN                              19
109
+#define SCK_PIN                               18
110
+#define SDSS                                   5
111
+#define USES_SHARED_SPI                           // SPI is shared by SD card with TMC SPI drivers
112
+
113
+/**
114
+ * Hardware serial pins
115
+ *
116
+ * Override these pins in Configuration.h or Configuration_adv.h if needed.
117
+ *
118
+ * Note: Serial2 can be defined using HARDWARE_SERIAL2_RX and HARDWARE_SERIAL2_TX
119
+ *       but MRR ESPA does not have enough spare pins for such reassignment.
120
+ */
121
+#ifndef HARDWARE_SERIAL1_RX
122
+  #define HARDWARE_SERIAL1_RX                 21
123
+#endif
124
+#ifndef HARDWARE_SERIAL1_TX
125
+  #define HARDWARE_SERIAL1_TX                 22
126
+#endif

+ 2
- 0
Marlin/src/pins/pins.h View File

@@ -665,6 +665,8 @@
665 665
   #include "esp32/pins_MRR_ESPE.h"              // ESP32                                  env:esp32
666 666
 #elif MB(E4D_BOX)
667 667
   #include "esp32/pins_E4D.h"                   // ESP32                                  env:esp32
668
+#elif MB(FYSETC_E4)
669
+  #include "esp32/pins_FYSETC_E4.h"             // ESP32                                  env:FYSETC_E4
668 670
 
669 671
 //
670 672
 // Adafruit Grand Central M4 (SAMD51 ARM Cortex-M4)

+ 5
- 0
platformio.ini View File

@@ -1363,6 +1363,11 @@ upload_speed  = 115200
1363 1363
 #upload_port   = marlinesp.local
1364 1364
 #board_build.flash_mode = qio
1365 1365
 
1366
+[env:FYSETC_E4]
1367
+platform               = espressif32@1.11.2
1368
+extends                = env:esp32
1369
+board_build.partitions = default_16MB.csv
1370
+
1366 1371
 #
1367 1372
 # Teensy 3.1 / 3.2 (ARM Cortex-M4)
1368 1373
 #

Loading…
Cancel
Save