Browse Source

🔨 Enhance Lerdge pins, TFTs, and variants (#22658)

Tanguy Pruvot 3 years ago
parent
commit
71a2a95885
No account linked to committer's email address
28 changed files with 232 additions and 221 deletions
  1. 1
    0
      Marlin/Configuration.h
  2. 8
    28
      Marlin/src/inc/Conditionals_LCD.h
  3. 5
    33
      Marlin/src/lcd/tft_io/st7796s.h
  4. 0
    1
      Marlin/src/lcd/tft_io/tft_ids.h
  5. 0
    4
      Marlin/src/lcd/tft_io/tft_io.cpp
  6. 2
    2
      Marlin/src/pins/linux/pins_RAMPS_LINUX.h
  7. 45
    29
      Marlin/src/pins/stm32f4/pins_LERDGE_K.h
  8. 43
    28
      Marlin/src/pins/stm32f4/pins_LERDGE_S.h
  9. 41
    27
      Marlin/src/pins/stm32f4/pins_LERDGE_X.h
  10. 3
    2
      buildroot/share/PlatformIO/scripts/lerdge.py
  11. 2
    1
      buildroot/share/PlatformIO/scripts/offset_and_rename.py
  12. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/hal_conf_extra.h
  13. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h
  14. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h
  15. 0
    2
      buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/PeripheralPins.c
  16. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/hal_conf_extra.h
  17. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/hal_conf_extra.h
  18. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h
  19. 8
    15
      buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h
  20. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h
  21. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h
  22. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h
  23. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h
  24. 18
    0
      buildroot/share/PlatformIO/variants/MARLIN_LERDGE/PeripheralPins.c
  25. 28
    21
      buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h
  26. 1
    1
      buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/hal_conf_custom.h
  27. 13
    12
      buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_LITE_V2/hal_conf_extra.h
  28. 4
    5
      ini/stm32f4.ini

+ 1
- 0
Marlin/Configuration.h View File

@@ -2710,6 +2710,7 @@
2710 2710
   //#define TFT_RES_320x240
2711 2711
   //#define TFT_RES_480x272
2712 2712
   //#define TFT_RES_480x320
2713
+  //#define TFT_RES_1024x600
2713 2714
 #endif
2714 2715
 
2715 2716
 /**

+ 8
- 28
Marlin/src/inc/Conditionals_LCD.h View File

@@ -1219,30 +1219,19 @@
1219 1219
  */
1220 1220
 #if ENABLED(MKS_TS35_V2_0)          // ST7796
1221 1221
   #define TFT_DEFAULT_DRIVER ST7796
1222
-  #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY)
1222
+  #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
1223 1223
   #define TFT_RES_480x320
1224 1224
   #define TFT_INTERFACE_SPI
1225
-#elif ENABLED(ANET_ET5_TFT35)       // ST7796
1226
-  #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY)
1225
+#elif EITHER(LERDGE_TFT35, ANET_ET5_TFT35) // ST7796
1226
+  #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
1227 1227
   #define TFT_RES_480x320
1228 1228
   #define TFT_INTERFACE_FSMC
1229
-#elif ENABLED(ANET_ET4_TFT28)       // ST7789
1229
+#elif ANY(ANET_ET4_TFT28, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32) // ST7789
1230 1230
   #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
1231 1231
   #define TFT_RES_320x240
1232 1232
   #define TFT_INTERFACE_FSMC
1233
-#elif ENABLED(MKS_ROBIN_TFT24)      // ST7789
1234
-  #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
1235
-  #define TFT_RES_320x240
1236
-  #define TFT_INTERFACE_FSMC
1237
-#elif ENABLED(MKS_ROBIN_TFT28)      // ST7789
1238
-  #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
1239
-  #define TFT_RES_320x240
1240
-  #define TFT_INTERFACE_FSMC
1241
-#elif ENABLED(MKS_ROBIN_TFT32)      // ST7789
1242
-  #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
1243
-  #define TFT_RES_320x240
1244
-  #define TFT_INTERFACE_FSMC
1245
-#elif ENABLED(MKS_ROBIN_TFT35)      // ILI9488
1233
+#elif ANY(MKS_ROBIN_TFT35, TFT_TRONXY_X5SA, ANYCUBIC_TFT35) // ILI9488
1234
+  #define TFT_DRIVER ILI9488
1246 1235
   #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
1247 1236
   #define TFT_RES_480x320
1248 1237
   #define TFT_INTERFACE_FSMC
@@ -1251,21 +1240,12 @@
1251 1240
   #define TFT_DEFAULT_ORIENTATION 0
1252 1241
   #define TFT_RES_480x272
1253 1242
   #define TFT_INTERFACE_FSMC
1254
-#elif ENABLED(MKS_ROBIN_TFT_V1_1R)  // ILI9328 or R61505
1255
-  #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
1256
-  #define TFT_RES_320x240
1257
-  #define TFT_INTERFACE_FSMC
1258
-#elif EITHER(TFT_TRONXY_X5SA, ANYCUBIC_TFT35) // ILI9488
1259
-  #define TFT_DRIVER ILI9488
1260
-  #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
1261
-  #define TFT_RES_480x320
1262
-  #define TFT_INTERFACE_FSMC
1263
-#elif ENABLED(LONGER_LK_TFT28)
1243
+#elif ANY(MKS_ROBIN_TFT_V1_1R, LONGER_LK_TFT28)  // ILI9328 or R61505
1264 1244
   #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
1265 1245
   #define TFT_RES_320x240
1266 1246
   #define TFT_INTERFACE_FSMC
1267 1247
 #elif ENABLED(BIQU_BX_TFT70)        // RGB
1268
-  #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY)
1248
+  #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
1269 1249
   #define TFT_RES_1024x600
1270 1250
   #define TFT_INTERFACE_LTDC
1271 1251
   #if ENABLED(TOUCH_SCREEN)

+ 5
- 33
Marlin/src/lcd/tft_io/st7796s.h View File

@@ -144,39 +144,11 @@ static const uint16_t st7796s_init[] = {
144 144
   ESC_REG(ST7796S_PGC), 0x00F0, 0x0004, 0x0008, 0x0009, 0x0008, 0x0015, 0x002F, 0x0042, 0x0046, 0x0028, 0x0015, 0x0016, 0x0029, 0x002D,
145 145
   ESC_REG(ST7796S_NGC), 0x00F0, 0x0004, 0x0009, 0x0009, 0x0008, 0x0015, 0x002E, 0x0046, 0x0046, 0x0028, 0x0015, 0x0015, 0x0029, 0x002D,
146 146
 
147
-  ESC_REG(ST7796S_NORON),
148
-  ESC_REG(ST7796S_WRCTRLD), 0x0024,
149
-  ESC_REG(ST7796S_CSCON), 0x003C,  // disable command 2 part I
150
-  ESC_REG(ST7796S_CSCON), 0x0069,  // disable command 2 part II
151
-  ESC_REG(ST7796S_DISPON),
152
-  ESC_END
153
-};
154
-
155
-static const uint16_t lerdge_st7796s_init[] = {
156
-  DATASIZE_8BIT,
157
-  ESC_REG(ST7796S_SWRESET), ESC_DELAY(100),
158
-  ESC_REG(ST7796S_SLPOUT), ESC_DELAY(20),
159
-
160
-  ESC_REG(ST7796S_CSCON), 0x00C3,  // enable command 2 part I
161
-  ESC_REG(ST7796S_CSCON), 0x0096,  // enable command 2 part II
162
-
163
-  ESC_REG(ST7796S_MADCTL), ST7796S_MADCTL_DATA,
164
-  ESC_REG(ST7796S_COLMOD), 0x0055,
165
-
166
-  ESC_REG(ST7796S_DIC), 0x0001,  // 1-dot inversion
167
-  ESC_REG(ST7796S_EM), 0x00C6,
168
-
169
-  ESC_REG(ST7796S_PWR2), 0x0015,
170
-  ESC_REG(ST7796S_PWR3), 0x00AF,
171
-  ESC_REG(ST7796S_VCMPCTL), 0x0022,
172
-  ESC_REG(ST7796S_VCMOST), 0x0000,
173
-  ESC_REG(ST7796S_DOCA), 0x0040, 0x008A, 0x0000, 0x0000, 0x0029, 0x0019, 0x00A5, 0x0033,
174
-
175
-  /* Gamma Correction. */
176
-  ESC_REG(ST7796S_PGC), 0x00F0, 0x0004, 0x0008, 0x0009, 0x0008, 0x0015, 0x002F, 0x0042, 0x0046, 0x0028, 0x0015, 0x0016, 0x0029, 0x002D,
177
-  ESC_REG(ST7796S_NGC), 0x00F0, 0x0004, 0x0009, 0x0009, 0x0008, 0x0015, 0x002E, 0x0046, 0x0046, 0x0028, 0x0015, 0x0015, 0x0029, 0x002D,
178
-
179
-  ESC_REG(ST7796S_INVON),      // Display inversion ON
147
+  #if ENABLED(ST7796S_INVERTED)
148
+    ESC_REG(ST7796S_INVON),    // Display inversion ON
149
+  #else
150
+    ESC_REG(ST7796S_NORON),
151
+  #endif
180 152
   ESC_REG(ST7796S_WRCTRLD), 0x0024,
181 153
   ESC_REG(ST7796S_CSCON), 0x003C,  // disable command 2 part I
182 154
   ESC_REG(ST7796S_CSCON), 0x0069,  // disable command 2 part II

+ 0
- 1
Marlin/src/lcd/tft_io/tft_ids.h View File

@@ -31,5 +31,4 @@
31 31
 #define ILI9341         0x9341
32 32
 #define ILI9488         0x9488
33 33
 #define ILI9488_ID1     0x8066 // Some ILI9488 have 0x8066 in the 0x04
34
-#define LERDGE_ST7796   0xFFFE
35 34
 #define AUTO            0xFFFF

+ 0
- 4
Marlin/src/lcd/tft_io/tft_io.cpp View File

@@ -97,10 +97,6 @@ if (lcd_id != 0xFFFFFFFF) return;
97 97
     write_esc_sequence(ili9341_init);
98 98
   #elif TFT_DRIVER == ILI9488
99 99
     write_esc_sequence(ili9488_init);
100
-  #elif TFT_DRIVER == LERDGE_ST7796
101
-    lcd_id = ST7796;
102
-    write_esc_sequence(lerdge_st7796s_init);
103
-
104 100
   #elif TFT_DRIVER == AUTO // autodetect
105 101
 
106 102
     lcd_id = io.GetID() & 0xFFFF;

+ 2
- 2
Marlin/src/pins/linux/pins_RAMPS_LINUX.h View File

@@ -427,10 +427,10 @@
427 427
     #define TFT_DRIVER                    ST7796
428 428
   #endif
429 429
   #ifndef XPT2046_X_CALIBRATION
430
-    #define XPT2046_X_CALIBRATION            63934
430
+    #define XPT2046_X_CALIBRATION          63934
431 431
   #endif
432 432
   #ifndef XPT2046_Y_CALIBRATION
433
-    #define XPT2046_Y_CALIBRATION            63598
433
+    #define XPT2046_Y_CALIBRATION          63598
434 434
   #endif
435 435
   #ifndef XPT2046_X_OFFSET
436 436
     #define XPT2046_X_OFFSET                  -1

+ 45
- 29
Marlin/src/pins/stm32f4/pins_LERDGE_K.h View File

@@ -72,42 +72,43 @@
72 72
 #define X_DIR_PIN                           PB10
73 73
 #define X_ENABLE_PIN                        PG0
74 74
 //#ifndef X_CS_PIN
75
-//  #define X_CS_PIN                        PE0
75
+//  #define X_CS_PIN                        PB2
76 76
 //#endif
77 77
 
78 78
 #define Y_STEP_PIN                          PF14
79 79
 #define Y_DIR_PIN                           PF15
80 80
 #define Y_ENABLE_PIN                        PF13
81 81
 //#ifndef Y_CS_PIN
82
-//  #define Y_CS_PIN                        PE1
82
+//  #define Y_CS_PIN                        PE2
83 83
 //#endif
84 84
 
85 85
 #define Z_STEP_PIN                          PF11
86 86
 #define Z_DIR_PIN                           PF12
87 87
 #define Z_ENABLE_PIN                        PC5
88 88
 //#ifndef Z_CS_PIN
89
-//  #define Z_CS_PIN                        PE2
89
+//  #define Z_CS_PIN                        PE3
90 90
 //#endif
91 91
 
92 92
 #define E0_STEP_PIN                         PC14
93 93
 #define E0_DIR_PIN                          PC13
94 94
 #define E0_ENABLE_PIN                       PC15
95 95
 //#ifndef E0_CS_PIN
96
-//  #define E0_CS_PIN                       PE3
96
+//  #define E0_CS_PIN                       PE4
97 97
 //#endif
98 98
 
99 99
 #define E1_STEP_PIN                         PF1
100 100
 #define E1_DIR_PIN                          PF0
101 101
 #define E1_ENABLE_PIN                       PF2
102 102
 //#ifndef E1_CS_PIN
103
-//  #define E1_CS_PIN                       PE4
103
+//  #define E1_CS_PIN                       PE1
104 104
 //#endif
105 105
 
106
-//#define E2_STEP_PIN                       PF4  // best guess
107
-//#define E2_DIR_PIN                        PF3  // best guess
108
-//#define E2_ENABLE_PIN                     PF5  // best guess
109
-//#ifndef E2_CS_PIN
110
-//  #define E2_CS_PIN                       PB2  // best guess
106
+//#define Z2_STEP_PIN                       PF4
107
+//#define Z2_DIR_PIN                        PF3
108
+//#define Z2_ENABLE_PIN                     PF5
109
+//#define Z2_STOP_PIN                       PG2
110
+//#ifndef Z2_CS_PIN
111
+//  #define Z2_CS_PIN                       PE0
111 112
 //#endif
112 113
 
113 114
 #if HAS_TMC_UART
@@ -144,12 +145,17 @@
144 145
   #ifndef E1_SERIAL_RX_PIN
145 146
     #define E1_SERIAL_RX_PIN    E1_SERIAL_TX_PIN
146 147
   #endif
148
+  // Ex-motor can be any... X2/Y2/Z2 or E2
147 149
   #ifndef EX_SERIAL_TX_PIN
148
-    #define E2_SERIAL_TX_PIN                PE0
150
+    #define EX_SERIAL_TX_PIN                PE0
149 151
   #endif
150 152
   #ifndef EX_SERIAL_RX_PIN
151
-    #define E2_SERIAL_RX_PIN    E2_SERIAL_TX_PIN
153
+    #define EX_SERIAL_RX_PIN    EX_SERIAL_TX_PIN
152 154
   #endif
155
+  //#define Z2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
156
+  //#define Z2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
157
+  //#define E2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
158
+  //#define E2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
153 159
   // Reduce baud rate to improve software serial reliability
154 160
   #define TMC_BAUD_RATE                    19200
155 161
 #endif
@@ -193,8 +199,8 @@
193 199
 //
194 200
 // LED / Lighting
195 201
 //
196
-//#define CASE_LIGHT_PIN_CI                 -1
197
-//#define CASE_LIGHT_PIN_DO                 -1
202
+#define LED_PIN                             PA15  // Status LED
203
+//#define CASE_LIGHT_PIN                    PB6   // LED Ribbon Connector (PWM TIM4_CH1)
198 204
 //#define NEOPIXEL_PIN                      -1
199 205
 #ifndef RGB_LED_R_PIN
200 206
   #define RGB_LED_R_PIN                     PB8   // swap R and G pin for compatibility with real wires
@@ -211,44 +217,54 @@
211 217
 //
212 218
 #define SDIO_SUPPORT
213 219
 #define SDIO_CLOCK                       4800000
220
+#define SD_DETECT_PIN                       PA8
221
+#if DISABLED(SDIO_SUPPORT)
222
+  #define SOFTWARE_SPI
223
+  #define SD_SCK_PIN                        PC12
224
+  #define SD_MISO_PIN                       PC8
225
+  #define SD_MOSI_PIN                       PD2
226
+  #define SD_SS_PIN                         PC11
227
+  #define SDSS                              PC11
228
+#endif
214 229
 
215 230
 //
216 231
 // Misc. Functions
217 232
 //
218
-#define SDSS                                PC11
219
-#define LED_PIN                             PA15  // Alive
220 233
 #define PS_ON_PIN                           PA4
221 234
 #define KILL_PIN                            -1
222 235
 #define POWER_LOSS_PIN                      PA4   // Power-loss / nAC_FAULT
223 236
 
224
-#define SD_SCK_PIN                          PC12
225
-#define SD_MISO_PIN                         PC8
226
-#define SD_MOSI_PIN                         PD2
227
-#define SD_SS_PIN                           PC11
228
-
229
-#define SD_DETECT_PIN                       PA8
230
-#define BEEPER_PIN                          PC7
231
-
232 237
 //
233 238
 // TFT with FSMC interface
234 239
 //
235 240
 #if HAS_FSMC_TFT
236
-  //#define TFT_DRIVER             LERDGE_ST7796
241
+  #ifndef TFT_DRIVER
242
+    #define TFT_DRIVER                    ST7796
243
+  #endif
244
+  #define ST7796S_INVERTED
237 245
 
238 246
   #define TFT_RESET_PIN                     PD6
239 247
   #define TFT_BACKLIGHT_PIN                 PD3
240 248
 
241
-  #define TFT_CS_PIN                        PD7
242
-  #define TFT_RS_PIN                        PD11
249
+  #define FSMC_CS_PIN                       PD7
250
+  #define FSMC_RS_PIN                       PD11
251
+
252
+  #define TFT_CS_PIN                 FSMC_CS_PIN
253
+  #define TFT_RS_PIN                 FSMC_RS_PIN
243 254
 
244 255
   #define TOUCH_CS_PIN                      PG15
245 256
   #define TOUCH_SCK_PIN                     PB3
246 257
   #define TOUCH_MOSI_PIN                    PB5
247 258
   #define TOUCH_MISO_PIN                    PB4
259
+  #define TOUCH_INT_PIN                     PG12
248 260
 #endif
249 261
 
250 262
 #if IS_NEWPANEL
251
-  #define BTN_EN1                           PG10
252
-  #define BTN_EN2                           PG11
263
+  #define BEEPER_PIN                        PC7
264
+  #define BTN_EN1                           PG11
265
+  #define BTN_EN2                           PG10
253 266
   #define BTN_ENC                           PG9
267
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
268
+    #define ENCODER_STEPS_PER_MENU_ITEM 2
269
+  #endif
254 270
 #endif

+ 43
- 28
Marlin/src/pins/stm32f4/pins_LERDGE_S.h View File

@@ -31,8 +31,6 @@
31 31
 #define STEP_TIMER                             4
32 32
 #define TEMP_TIMER                             2
33 33
 
34
-//#define I2C_EEPROM
35
-
36 34
 // USB Flash Drive support
37 35
 #define HAS_OTG_USB_HOST_SUPPORT
38 36
 
@@ -150,7 +148,6 @@
150 148
 //
151 149
 // Misc. Functions
152 150
 //
153
-#define SDSS                                PC11  // SD is working using SDIO, not sure if this definition is needed?
154 151
 #define LED_PIN                             PC6   // Mainboard soldered green LED
155 152
 #define PS_ON_PIN                           PB2   // Board has a power module connector
156 153
 #define KILL_PIN                            -1    // There is no reset button on the LCD
@@ -161,23 +158,25 @@
161 158
 //
162 159
 #define SDIO_SUPPORT
163 160
 #define SDIO_CLOCK                       4800000
164
-
165
-#define SD_SCK_PIN                          PC12
166
-#define SD_MISO_PIN                         PC8
167
-#define SD_MOSI_PIN                         PD2
168
-#define SD_SS_PIN                           PC11
169
-
170 161
 #define SD_DETECT_PIN                       PG15
162
+#if DISABLED(SDIO_SUPPORT)
163
+  #define SOFTWARE_SPI
164
+  #define SD_SCK_PIN                        PC12
165
+  #define SD_MISO_PIN                       PC8
166
+  #define SD_MOSI_PIN                       PD2
167
+  #define SD_SS_PIN                         PC11
168
+  #define SDSS                              PC11
169
+#endif
171 170
 
172 171
 //
173 172
 // Persistent Storage
174 173
 // If no option is selected below the SD Card will be used
175
-// (this section modelled after pins_LONGER3D_LK.h)
176
-// Warning: Not tested yet! Pins traced with multimeter, mistakes are possible
174
+// Prefer the I2C option (F-RAM) to store Marlin settings, SPI option is not working yet
175
+
177 176
 //#define SPI_EEPROM
177
+//#define I2C_EEPROM
178 178
 
179
-#if ENABLED(SPI_EEPROM)
180
-  // Lerdge has an SPI EEPROM Winbond W25Q128 (128Mbits) https://www.pjrc.com/teensy/W25Q128FV.pdf
179
+#if ENABLED(SPI_EEPROM)                           // SPI EEPROM Winbond W25Q128 (128Mbits) https://www.pjrc.com/teensy/W25Q128FV.pdf
181 180
   #define SPI_CHAN_EEPROM1                     1
182 181
   #define SPI_EEPROM1_CS_PIN                PB12  // datasheet: /CS pin, found with multimeter, not tested
183 182
   #define EEPROM_SCK_PIN                    PB13  // datasheet: CLK pin, found with multimeter, not tested
@@ -185,29 +184,45 @@
185 184
   #define EEPROM_MOSI_PIN                   PB15  // datasheet: DI pin, found with multimeter, not tested
186 185
   #define EEPROM_PAGE_SIZE               0x1000U  // 4KB (from datasheet)
187 186
   #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE)   // Limit to 64KB for now...
187
+#elif ENABLED(I2C_EEPROM)                         // FM24CL64BG (CYP1813) 64Kbit F-RAM
188
+  #define SOFT_I2C_EEPROM                         // Force the use of Software I2C
189
+  #define I2C_SDA_PIN                       PG13
190
+  #define I2C_SCL_PIN                       PG14  // To be confirmed on the Lerdge S, but probably same as the K
191
+  #define MARLIN_EEPROM_SIZE             0x10000
188 192
 #else
189 193
   #define MARLIN_EEPROM_SIZE              0x800U  // On SD, Limit to 2KB, require this amount of RAM
190 194
 #endif
191 195
 
192 196
 //
193
-// LCD / Controller
197
+// TFT with FSMC interface
194 198
 //
199
+#if HAS_FSMC_TFT
200
+  #ifndef TFT_DRIVER
201
+    #define TFT_DRIVER                    ST7796
202
+  #endif
203
+  #define ST7796S_INVERTED
195 204
 
196
-// The LCD is initialized in FSMC mode
197
-#define BEEPER_PIN                          PD13
205
+  #define TFT_RESET_PIN                     PD6
206
+  #define TFT_BACKLIGHT_PIN                 PD3
198 207
 
199
-#define BTN_EN1                             PC14
200
-#define BTN_EN2                             PC15
201
-#define BTN_ENC                             PC13
208
+  #define FSMC_CS_PIN                       PD7
209
+  #define FSMC_RS_PIN                       PD11
202 210
 
203
-#define TFT_RESET_PIN                       PD6
204
-#define TFT_BACKLIGHT_PIN                   PD3
211
+  #define TFT_CS_PIN                 FSMC_CS_PIN
212
+  #define TFT_RS_PIN                 FSMC_RS_PIN
205 213
 
206
-#define TFT_CS_PIN                          PD7   // TFT works
207
-#define TFT_RS_PIN                          PD11  // TFT works
214
+  #define TOUCH_CS_PIN                      PB6
215
+  #define TOUCH_SCK_PIN                     PB3
216
+  #define TOUCH_MOSI_PIN                    PB5
217
+  #define TOUCH_MISO_PIN                    PB4
218
+#endif
208 219
 
209
-// There is touch, but calibration is off
210
-#define TOUCH_CS_PIN                        PB6
211
-#define TOUCH_SCK_PIN                       PB3
212
-#define TOUCH_MOSI_PIN                      PB5
213
-#define TOUCH_MISO_PIN                      PB4
220
+#if IS_NEWPANEL
221
+  #define BEEPER_PIN                        PD13
222
+  #define BTN_EN1                           PC15
223
+  #define BTN_EN2                           PC14
224
+  #define BTN_ENC                           PC13
225
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
226
+    #define ENCODER_STEPS_PER_MENU_ITEM 2
227
+  #endif
228
+#endif

+ 41
- 27
Marlin/src/pins/stm32f4/pins_LERDGE_X.h View File

@@ -114,9 +114,23 @@
114 114
 //#define NEOPIXEL_PIN                      -1
115 115
 
116 116
 //
117
+// SD support (On board)
118
+//
119
+#define SDIO_SUPPORT
120
+#define SD_DETECT_PIN                       PA8
121
+#define SDIO_CLOCK                       4800000
122
+#if DISABLED(SDIO_SUPPORT)
123
+  #define SOFTWARE_SPI
124
+  #define SD_SCK_PIN                        PC12
125
+  #define SD_MISO_PIN                       PC8
126
+  #define SD_MOSI_PIN                       PD2
127
+  #define SD_SS_PIN                         PC11
128
+  #define SDSS                              PC11
129
+#endif
130
+
131
+//
117 132
 // Misc. Functions
118 133
 //
119
-#define SDSS                                PC11
120 134
 #define LED_PIN                             PC7   // Alive
121 135
 #define PS_ON_PIN                           -1
122 136
 #define KILL_PIN                            -1
@@ -124,36 +138,36 @@
124 138
 // Lerdge supports auto-power off and power loss sense through a single pin.
125 139
 #define POWER_LOSS_PIN                      PC14  // Power-loss / nAC_FAULT
126 140
 
127
-#define SD_SCK_PIN                          PC12
128
-#define SD_MISO_PIN                         PC8
129
-#define SD_MOSI_PIN                         PD2
130
-#define SD_SS_PIN                           PC11
131
-
132 141
 //
133
-// SD support
134
-//
135
-#define SDIO_SUPPORT
136
-#define SD_DETECT_PIN                       PA8
137
-#define SDIO_CLOCK                       4800000
138
-
139
-//
140
-// LCD / Controller
142
+// TFT with FSMC interface
141 143
 //
144
+#if HAS_FSMC_TFT
145
+  #ifndef TFT_DRIVER
146
+    #define TFT_DRIVER                    ST7796
147
+  #endif
148
+  #define ST7796S_INVERTED
142 149
 
143
-// The LCD is initialized in FSMC mode
144
-#define BEEPER_PIN                          PD12
150
+  #define FSMC_CS_PIN                       PD7
151
+  #define FSMC_RS_PIN                       PD11
145 152
 
146
-#define BTN_EN1                             PE3
147
-#define BTN_EN2                             PE4
148
-#define BTN_ENC                             PE2
153
+  #define TFT_RESET_PIN                     PD6
154
+  #define TFT_BACKLIGHT_PIN                 PD3
149 155
 
150
-#define TFT_RESET_PIN                       PD6
151
-#define TFT_BACKLIGHT_PIN                   PD3
156
+  #define TFT_CS_PIN                 FSMC_CS_PIN
157
+  #define TFT_RS_PIN                 FSMC_RS_PIN
152 158
 
153
-#define TFT_CS_PIN                          PD7
154
-#define TFT_RS_PIN                          PD11
159
+  #define TOUCH_CS_PIN                      PB6
160
+  #define TOUCH_SCK_PIN                     PB3
161
+  #define TOUCH_MOSI_PIN                    PB5
162
+  #define TOUCH_MISO_PIN                    PB4
163
+#endif
155 164
 
156
-#define TOUCH_CS_PIN                        PB6
157
-#define TOUCH_SCK_PIN                       PB3
158
-#define TOUCH_MOSI_PIN                      PB5
159
-#define TOUCH_MISO_PIN                      PB4
165
+#if IS_NEWPANEL
166
+  #define BEEPER_PIN                        PD12
167
+  #define BTN_EN1                           PE4
168
+  #define BTN_EN2                           PE3
169
+  #define BTN_ENC                           PE2
170
+  #ifndef ENCODER_STEPS_PER_MENU_ITEM
171
+    #define ENCODER_STEPS_PER_MENU_ITEM 2
172
+  #endif
173
+#endif

+ 3
- 2
buildroot/share/PlatformIO/scripts/lerdge.py View File

@@ -41,7 +41,8 @@ def encrypt(source, target, env):
41 41
     renamed.close()
42 42
 
43 43
 if 'encrypt' in board.get("build").keys():
44
-    marlin.add_post_action(encrypt);
44
+    if board.get("build.encrypt") != "":
45
+        marlin.add_post_action(encrypt)
45 46
 else:
46 47
     print("LERDGE builds require output file via board_build.encrypt = 'filename' parameter")
47
-    exit(1);
48
+    exit(1)

+ 2
- 1
buildroot/share/PlatformIO/scripts/offset_and_rename.py View File

@@ -45,7 +45,8 @@ if 'encrypt' in board_keys:
45 45
 	def encrypt(source, target, env):
46 46
 		marlin.encrypt_mks(source, target, env, board.get("build.encrypt"))
47 47
 
48
-	marlin.add_post_action(encrypt);
48
+	if board.get("build.encrypt") != "":
49
+		marlin.add_post_action(encrypt)
49 50
 
50 51
 #
51 52
 # For build.rename simply rename the firmware file.

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_BTT002/hal_conf_extra.h View File

@@ -4,6 +4,7 @@
4 4
 #define HAL_ADC_MODULE_ENABLED
5 5
 #define HAL_CRC_MODULE_ENABLED
6 6
 #define HAL_DMA_MODULE_ENABLED
7
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
7 8
 #define HAL_GPIO_MODULE_ENABLED
8 9
 #define HAL_I2C_MODULE_ENABLED
9 10
 #define HAL_PWR_MODULE_ENABLED
@@ -32,7 +33,6 @@
32 33
 //#define HAL_SRAM_MODULE_ENABLED
33 34
 //#define HAL_SDRAM_MODULE_ENABLED
34 35
 //#define HAL_HASH_MODULE_ENABLED
35
-//#define HAL_EXTI_MODULE_ENABLED
36 36
 //#define HAL_SMBUS_MODULE_ENABLED
37 37
 //#define HAL_I2S_MODULE_ENABLED
38 38
 //#define HAL_IWDG_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_E3_RRF/hal_conf_extra.h View File

@@ -4,6 +4,7 @@
4 4
 #define HAL_ADC_MODULE_ENABLED
5 5
 #define HAL_CRC_MODULE_ENABLED
6 6
 #define HAL_DMA_MODULE_ENABLED
7
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
7 8
 #define HAL_GPIO_MODULE_ENABLED
8 9
 #define HAL_I2C_MODULE_ENABLED
9 10
 #define HAL_PWR_MODULE_ENABLED
@@ -32,7 +33,6 @@
32 33
 #undef HAL_SRAM_MODULE_ENABLED
33 34
 #undef HAL_SDRAM_MODULE_ENABLED
34 35
 #undef HAL_HASH_MODULE_ENABLED
35
-#undef HAL_EXTI_MODULE_ENABLED
36 36
 #undef HAL_SMBUS_MODULE_ENABLED
37 37
 #undef HAL_I2S_MODULE_ENABLED
38 38
 #undef HAL_IWDG_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_GTR_V1/hal_conf_extra.h View File

@@ -4,6 +4,7 @@
4 4
 #define HAL_ADC_MODULE_ENABLED
5 5
 #define HAL_CRC_MODULE_ENABLED
6 6
 #define HAL_DMA_MODULE_ENABLED
7
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
7 8
 #define HAL_GPIO_MODULE_ENABLED
8 9
 #define HAL_I2C_MODULE_ENABLED
9 10
 #define HAL_PWR_MODULE_ENABLED
@@ -32,7 +33,6 @@
32 33
 //#define HAL_SRAM_MODULE_ENABLED
33 34
 //#define HAL_SDRAM_MODULE_ENABLED
34 35
 //#define HAL_HASH_MODULE_ENABLED
35
-//#define HAL_EXTI_MODULE_ENABLED
36 36
 //#define HAL_SMBUS_MODULE_ENABLED
37 37
 //#define HAL_I2S_MODULE_ENABLED
38 38
 //#define HAL_IWDG_MODULE_ENABLED

+ 0
- 2
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/PeripheralPins.c View File

@@ -392,9 +392,7 @@ const PinMap PinMap_USB_OTG_FS[] = {
392 392
   {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
393 393
   {NC,    NP,    0}
394 394
 };
395
-#endif
396 395
 
397
-#ifdef HAL_PCD_MODULE_ENABLED
398 396
 const PinMap PinMap_USB_OTG_HS[] = {
399 397
     //{PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_ID
400 398
     //{PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_V1/hal_conf_extra.h View File

@@ -4,6 +4,7 @@
4 4
 #define HAL_ADC_MODULE_ENABLED
5 5
 #define HAL_CRC_MODULE_ENABLED
6 6
 #define HAL_DMA_MODULE_ENABLED
7
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
7 8
 #define HAL_GPIO_MODULE_ENABLED
8 9
 #define HAL_I2C_MODULE_ENABLED
9 10
 #define HAL_PWR_MODULE_ENABLED
@@ -33,7 +34,6 @@
33 34
 #undef HAL_SRAM_MODULE_ENABLED
34 35
 #undef HAL_SDRAM_MODULE_ENABLED
35 36
 #undef HAL_HASH_MODULE_ENABLED
36
-#undef HAL_EXTI_MODULE_ENABLED
37 37
 #undef HAL_SMBUS_MODULE_ENABLED
38 38
 #undef HAL_I2S_MODULE_ENABLED
39 39
 #undef HAL_IWDG_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_SKR_PRO_11/hal_conf_extra.h View File

@@ -4,6 +4,7 @@
4 4
 #define HAL_ADC_MODULE_ENABLED
5 5
 #define HAL_CRC_MODULE_ENABLED
6 6
 #define HAL_DMA_MODULE_ENABLED
7
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
7 8
 #define HAL_GPIO_MODULE_ENABLED
8 9
 #define HAL_I2C_MODULE_ENABLED
9 10
 #define HAL_PWR_MODULE_ENABLED
@@ -32,7 +33,6 @@
32 33
 //#define HAL_SRAM_MODULE_ENABLED
33 34
 //#define HAL_SDRAM_MODULE_ENABLED
34 35
 //#define HAL_HASH_MODULE_ENABLED
35
-//#define HAL_EXTI_MODULE_ENABLED
36 36
 //#define HAL_SMBUS_MODULE_ENABLED
37 37
 //#define HAL_I2S_MODULE_ENABLED
38 38
 //#define HAL_IWDG_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/hal_conf_extra.h View File

@@ -51,7 +51,7 @@ extern "C" {
51 51
 #define HAL_DMA2D_MODULE_ENABLED
52 52
 #define HAL_DSI_MODULE_ENABLED
53 53
 #define HAL_ETH_MODULE_ENABLED
54
-#define HAL_EXTI_MODULE_ENABLED
54
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
55 55
 #define HAL_FDCAN_MODULE_ENABLED
56 56
 #define HAL_FLASH_MODULE_ENABLED
57 57
 #define HAL_GPIO_MODULE_ENABLED

+ 8
- 15
buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h View File

@@ -20,11 +20,6 @@ extern "C" {
20 20
   */
21 21
 #include "stm32yyxx_hal_conf.h"
22 22
 
23
-#undef HAL_PWR_MODULE_ENABLED
24
-#define HAL_PWR_MODULE_ONLY   // disable low power & PA0 wakeup pin (its T°c pin)
25
-
26
-#define HAL_IWDG_MODULE_ENABLED // USE_WATCHDOG
27
-
28 23
 #ifdef HAL_PCD_MODULE_ENABLED
29 24
   #warning "No direct STM32 USB pins on Longer3D board"
30 25
   #undef HAL_PCD_MODULE_ENABLED // USB Device
@@ -35,20 +30,20 @@ extern "C" {
35 30
   #undef HAL_HCD_MODULE_ENABLED // USB Host
36 31
 #endif
37 32
 
38
-#ifndef HAL_USART_MODULE_ENABLED
39
-  //#define HAL_USART_MODULE_ENABLED // Useless.... UART_MODULE do it
40
-#endif
33
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
34
+#define HAL_IWDG_MODULE_ENABLED // USE_WATCHDOG
35
+
36
+#undef HAL_PWR_MODULE_ENABLED
37
+#define HAL_PWR_MODULE_ONLY   // disable low power & PA0 wakeup pin (its T°c pin)
41 38
 
42 39
 #undef HAL_CAN_LEGACY_MODULE_ENABLED
43 40
 #undef HAL_CAN_MODULE_ENABLED
44 41
 #undef HAL_DAC_MODULE_ENABLED
45 42
 #undef HAL_RTC_MODULE_ENABLED
46 43
 
47
-#define HAL_EXTI_MODULE_ENABLED // for ENDSTOP_INTERRUPTS_FEATURE
48
-
49 44
 /**
50
-  * @brief List of modules in the framework (first ones enabled by default)
51
-  */
45
+ * @brief List of modules in the framework (first ones enabled by default)
46
+ */
52 47
 //#define HAL_MODULE_ENABLED
53 48
 //#define HAL_ADC_MODULE_ENABLED
54 49
 //#define HAL_CORTEX_MODULE_ENABLED
@@ -66,13 +61,11 @@ extern "C" {
66 61
 //#define HAL_SRAM_MODULE_ENABLED
67 62
 //#define HAL_TIM_MODULE_ENABLED
68 63
 //#define HAL_UART_MODULE_ENABLED
69
-
70 64
 //#define HAL_CAN_MODULE_ENABLED
71 65
 //#define HAL_CAN_LEGACY_MODULE_ENABLED
72 66
 //#define HAL_CEC_MODULE_ENABLED
73 67
 //#define HAL_CRC_MODULE_ENABLED
74 68
 //#define HAL_ETH_MODULE_ENABLED
75
-//#define HAL_EXTI_MODULE_ENABLED
76 69
 //#define HAL_HCD_MODULE_ENABLED
77 70
 //#define HAL_I2S_MODULE_ENABLED
78 71
 //#define HAL_IRDA_MODULE_ENABLED
@@ -81,7 +74,7 @@ extern "C" {
81 74
 //#define HAL_NOR_MODULE_ENABLED
82 75
 //#define HAL_PCCARD_MODULE_ENABLED
83 76
 //#define HAL_SMARTCARD_MODULE_ENABLED
84
-//#define HAL_USART_MODULE_ENABLED
77
+//#define HAL_USART_MODULE_ENABLED // Useless.... UART_MODULE does it
85 78
 //#define HAL_WWDG_MODULE_ENABLED
86 79
 //#define HAL_MMC_MODULE_ENABLED
87 80
 

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_F103Zx/hal_conf_custom.h View File

@@ -41,7 +41,7 @@ extern "C" {
41 41
 #define HAL_ADC_MODULE_ENABLED
42 42
 #define HAL_CRC_MODULE_ENABLED
43 43
 #define HAL_DMA_MODULE_ENABLED
44
-#define HAL_EXTI_MODULE_ENABLED
44
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
45 45
 #define HAL_FLASH_MODULE_ENABLED
46 46
 #define HAL_GPIO_MODULE_ENABLED
47 47
 #define HAL_I2C_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_F407VE/hal_conf_custom.h View File

@@ -36,6 +36,7 @@ extern "C" {
36 36
 #define HAL_CRC_MODULE_ENABLED
37 37
 #define HAL_DAC_MODULE_ENABLED
38 38
 #define HAL_DMA_MODULE_ENABLED
39
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
39 40
 #define HAL_FLASH_MODULE_ENABLED
40 41
 #define HAL_GPIO_MODULE_ENABLED
41 42
 #define HAL_I2C_MODULE_ENABLED
@@ -61,7 +62,6 @@ extern "C" {
61 62
 //#define HAL_SRAM_MODULE_ENABLED
62 63
 //#define HAL_SDRAM_MODULE_ENABLED
63 64
 //#define HAL_HASH_MODULE_ENABLED
64
-//#define HAL_EXTI_MODULE_ENABLED
65 65
 //#define HAL_SMBUS_MODULE_ENABLED
66 66
 //#define HAL_I2S_MODULE_ENABLED
67 67
 //#define HAL_IWDG_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/hal_conf_extra.h View File

@@ -40,6 +40,7 @@
40 40
 #define HAL_CRC_MODULE_ENABLED
41 41
 #define HAL_DAC_MODULE_ENABLED
42 42
 #define HAL_DMA_MODULE_ENABLED
43
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
43 44
 #define HAL_GPIO_MODULE_ENABLED
44 45
 #define HAL_I2C_MODULE_ENABLED
45 46
 #define HAL_PWR_MODULE_ENABLED
@@ -64,7 +65,6 @@
64 65
 //#define HAL_SRAM_MODULE_ENABLED
65 66
 //#define HAL_SDRAM_MODULE_ENABLED
66 67
 //#define HAL_HASH_MODULE_ENABLED
67
-//#define HAL_EXTI_MODULE_ENABLED
68 68
 //#define HAL_SMBUS_MODULE_ENABLED
69 69
 //#define HAL_I2S_MODULE_ENABLED
70 70
 //#define HAL_IWDG_MODULE_ENABLED

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/hal_conf_custom.h View File

@@ -35,6 +35,7 @@ extern "C" {
35 35
 #define HAL_ADC_MODULE_ENABLED
36 36
 #define HAL_CRC_MODULE_ENABLED
37 37
 #define HAL_DMA_MODULE_ENABLED
38
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
38 39
 #define HAL_FLASH_MODULE_ENABLED
39 40
 #define HAL_GPIO_MODULE_ENABLED
40 41
 #define HAL_I2C_MODULE_ENABLED
@@ -61,7 +62,6 @@ extern "C" {
61 62
 //#define HAL_SRAM_MODULE_ENABLED
62 63
 //#define HAL_SDRAM_MODULE_ENABLED
63 64
 //#define HAL_HASH_MODULE_ENABLED
64
-//#define HAL_EXTI_MODULE_ENABLED
65 65
 //#define HAL_SMBUS_MODULE_ENABLED
66 66
 //#define HAL_I2S_MODULE_ENABLED
67 67
 //#define HAL_LTDC_MODULE_ENABLED

+ 18
- 0
buildroot/share/PlatformIO/variants/MARLIN_LERDGE/PeripheralPins.c View File

@@ -398,3 +398,21 @@ const PinMap PinMap_USB_OTG_HS[] = {
398 398
   {NC,    NP,    0}
399 399
 };
400 400
 #endif
401
+
402
+//*** SD ***
403
+
404
+#ifdef HAL_SD_MODULE_ENABLED
405
+WEAK const PinMap PinMap_SD[] = {
406
+//{PB_8,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D4
407
+//{PB_9,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D5
408
+//{PC_6,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D6
409
+//{PC_7,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D7
410
+  {PC_8,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D0
411
+  {PC_9,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D1
412
+  {PC_10, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D2
413
+  {PC_11, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D3
414
+  {PC_12, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CK
415
+  {PD_2,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CMD
416
+  {NC,    NP,    0}
417
+};
418
+#endif

+ 28
- 21
buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h View File

@@ -163,32 +163,37 @@ extern "C" {
163 163
 // Below SPI and I2C definitions already done in the core
164 164
 // Could be redefined here if differs from the default one
165 165
 // SPI Definitions
166
-#define PIN_SPI_SS              PF11
167
-#define PIN_SPI_MOSI            PB15
168
-#define PIN_SPI_MISO            PB14
169
-#define PIN_SPI_SCK             PB13
170 166
 
167
+// SPI1 (Winbond on the Lerdge-K)
168
+//#define PIN_SPI_SS            PC4
169
+//#define PIN_SPI_SCK           PA5
170
+//#define PIN_SPI_MISO          PA6
171
+//#define PIN_SPI_MOSI          PA7
171 172
 
173
+// SPI2 (Winbond on the Lerdge-S)
174
+//#define PIN_SPI_SS            PB12
175
+//#define PIN_SPI_SCK           PB13
176
+//#define PIN_SPI_MISO          PB14
177
+//#define PIN_SPI_MOSI          PB15
172 178
 
173
-//max6675
174
-//#define PIN_SPI_SS              PA4
175
-//#define PIN_SPI_SCK             PA5
176
-//#define PIN_SPI_MISO            PA6
177
-//#define PIN_SPI_MOSI            PA7
178
-
179
-
180
-
181
-
182
-// I2C Definitions
183
-#define PIN_WIRE_SDA            PB7
184
-#define PIN_WIRE_SCL            PB6
179
+// I2C Definitions (Software I2C)
180
+//#define PIN_WIRE_SDA          PG13
181
+//#define PIN_WIRE_SCL          PG14
185 182
 
186 183
 // Timer Definitions
187
-//Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c
188
-#define TIMER_TONE              TIM6
189
-
190
-// Do not use basic timer: OC is required
191
-#define TIMER_SERVO             TIM1  //TODO: advanced-control timers don't work
184
+// Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c
185
+// FANs may require PWM timers 3 10 11 13
186
+// The LED/RGB connectors timer 4
187
+// Beware: STEP_TIMER default is 6 and TEMP_TIMER 14 for the F407
188
+#ifndef TIMER_TONE
189
+  #define TIMER_TONE            TIM8  // TIM3 or TIM8 for SPEAKER compat on the lerdge K (PC6)
190
+#endif                                // TIM4 for that on the Lerdge S (PD11)
191
+#ifndef TIMER_SERVO
192
+  #define TIMER_SERVO           TIM1  // Ideally TIM2 for Hardware PWM (PB11)
193
+#endif                                // TIM4 on the S (PD12)
194
+#ifndef TIMER_SERIAL
195
+  #define TIMER_SERIAL          TIM7  // Default used in SoftwareSerial lib
196
+#endif
192 197
 
193 198
 // UART Definitions
194 199
 // Define here Serial instance number to map on Serial generic name
@@ -208,6 +213,8 @@ extern "C" {
208 213
 /* Extra HAL modules */
209 214
 //#define HAL_DAC_MODULE_ENABLED
210 215
 #define HAL_SD_MODULE_ENABLED
216
+#define HAL_SRAM_MODULE_ENABLED
217
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
211 218
 
212 219
 #ifdef __cplusplus
213 220
 } // extern "C"

+ 1
- 1
buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/hal_conf_custom.h View File

@@ -35,6 +35,7 @@ extern "C" {
35 35
 #define HAL_ADC_MODULE_ENABLED
36 36
 #define HAL_CRC_MODULE_ENABLED
37 37
 #define HAL_DMA_MODULE_ENABLED
38
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
38 39
 #define HAL_FLASH_MODULE_ENABLED
39 40
 #define HAL_GPIO_MODULE_ENABLED
40 41
 #define HAL_I2C_MODULE_ENABLED
@@ -62,7 +63,6 @@ extern "C" {
62 63
 //#define HAL_SRAM_MODULE_ENABLED
63 64
 //#define HAL_SDRAM_MODULE_ENABLED
64 65
 //#define HAL_HASH_MODULE_ENABLED
65
-//#define HAL_EXTI_MODULE_ENABLED
66 66
 //#define HAL_SMBUS_MODULE_ENABLED
67 67
 //#define HAL_I2S_MODULE_ENABLED
68 68
 //#define HAL_LTDC_MODULE_ENABLED

+ 13
- 12
buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_LITE_V2/hal_conf_extra.h View File

@@ -36,6 +36,19 @@
36 36
   */
37 37
 #define HAL_MODULE_ENABLED
38 38
 #define HAL_ADC_MODULE_ENABLED
39
+#define HAL_DMA_MODULE_ENABLED
40
+#define HAL_FLASH_MODULE_ENABLED
41
+#define HAL_GPIO_MODULE_ENABLED
42
+#define HAL_EXTI_MODULE_ENABLED   // Needed for Endstop (and other external) Interrupts
43
+#define HAL_PWR_MODULE_ENABLED
44
+#define HAL_RCC_MODULE_ENABLED
45
+#define HAL_SPI_MODULE_ENABLED
46
+#define HAL_TIM_MODULE_ENABLED
47
+#define HAL_USART_MODULE_ENABLED
48
+#define HAL_CORTEX_MODULE_ENABLED
49
+#define HAL_PCD_MODULE_ENABLED
50
+//#define HAL_UART_MODULE_ENABLED // by default
51
+
39 52
 //#define HAL_CAN_MODULE_ENABLED
40 53
 //#define HAL_CAN_LEGACY_MODULE_ENABLED
41 54
 //#define HAL_CRC_MODULE_ENABLED
@@ -43,40 +56,28 @@
43 56
 //#define HAL_CRYP_MODULE_ENABLED
44 57
 //#define HAL_DAC_MODULE_ENABLED
45 58
 //#define HAL_DCMI_MODULE_ENABLED
46
-#define HAL_DMA_MODULE_ENABLED
47 59
 //#define HAL_DMA2D_MODULE_ENABLED
48 60
 //#define HAL_ETH_MODULE_ENABLED
49
-#define HAL_FLASH_MODULE_ENABLED
50 61
 //#define HAL_NAND_MODULE_ENABLED
51 62
 //#define HAL_NOR_MODULE_ENABLED
52 63
 //#define HAL_PCCARD_MODULE_ENABLED
53 64
 //#define HAL_SRAM_MODULE_ENABLED
54 65
 //#define HAL_SDRAM_MODULE_ENABLED
55 66
 //#define HAL_HASH_MODULE_ENABLED
56
-#define HAL_GPIO_MODULE_ENABLED
57
-//#define HAL_EXTI_MODULE_ENABLED
58 67
 //#define HAL_I2C_MODULE_ENABLED
59 68
 //#define HAL_SMBUS_MODULE_ENABLED
60 69
 //#define HAL_I2S_MODULE_ENABLED
61 70
 //#define HAL_IWDG_MODULE_ENABLED
62 71
 //#define HAL_LTDC_MODULE_ENABLED
63 72
 //#define HAL_DSI_MODULE_ENABLED
64
-#define HAL_PWR_MODULE_ENABLED
65 73
 //#define HAL_QSPI_MODULE_ENABLED
66
-#define HAL_RCC_MODULE_ENABLED
67 74
 //#define HAL_RNG_MODULE_ENABLED
68 75
 //#define HAL_RTC_MODULE_ENABLED
69 76
 //#define HAL_SAI_MODULE_ENABLED
70 77
 //#define HAL_SD_MODULE_ENABLED
71
-#define HAL_SPI_MODULE_ENABLED
72
-#define HAL_TIM_MODULE_ENABLED
73
-//#define HAL_UART_MODULE_ENABLED // by default
74
-#define HAL_USART_MODULE_ENABLED
75 78
 //#define HAL_IRDA_MODULE_ENABLED
76 79
 //#define HAL_SMARTCARD_MODULE_ENABLED
77 80
 //#define HAL_WWDG_MODULE_ENABLED
78
-#define HAL_CORTEX_MODULE_ENABLED
79
-#define HAL_PCD_MODULE_ENABLED
80 81
 //#define HAL_HCD_MODULE_ENABLED
81 82
 //#define HAL_FMPI2C_MODULE_ENABLED
82 83
 //#define HAL_SPDIFRX_MODULE_ENABLED

+ 4
- 5
ini/stm32f4.ini View File

@@ -255,14 +255,13 @@ board_build.encrypt = firmware.bin
255 255
 board_build.offset  = 0x10000
256 256
 build_flags         = ${stm32_variant.build_flags}
257 257
                       -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4
258
-                      -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DARDUINO_LERDGE
259
-                      -DHAL_SRAM_MODULE_ENABLED
258
+                      -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DLERDGE_TFT35
260 259
 build_unflags       = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483
261 260
 extra_scripts       = ${stm32_variant.extra_scripts}
262 261
                       buildroot/share/PlatformIO/scripts/lerdge.py
263 262
 
264 263
 #
265
-# Lerdge X
264
+# Lerdge X (STM32F407VE)
266 265
 #
267 266
 [env:LERDGEX]
268 267
 platform            = ${lerdge_common.platform}
@@ -279,7 +278,7 @@ platform_packages = ${stm_flash_drive.platform_packages}
279 278
 build_flags       = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags}
280 279
 
281 280
 #
282
-# Lerdge S
281
+# Lerdge S (STM32F407ZG)
283 282
 #
284 283
 [env:LERDGES]
285 284
 platform            = ${lerdge_common.platform}
@@ -296,7 +295,7 @@ platform_packages = ${stm_flash_drive.platform_packages}
296 295
 build_flags       = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags}
297 296
 
298 297
 #
299
-# Lerdge K
298
+# Lerdge K (STM32F407ZG)
300 299
 #
301 300
 [env:LERDGEK]
302 301
 platform            = ${lerdge_common.platform}

Loading…
Cancel
Save