Browse Source

✨ BigTreeTech TFT35 SPI V1.0 (#22986)

Keith Bennett 3 years ago
parent
commit
9a19ea50d8
No account linked to committer's email address

+ 13
- 8
Marlin/Configuration.h View File

2642
  */
2642
  */
2643
 
2643
 
2644
 //
2644
 //
2645
-// 480x320, 3.5", SPI Display From MKS
2646
-// Normally used in MKS Robin Nano V2
2645
+// 480x320, 3.5", SPI Display with Rotary Encoder from MKS
2646
+// Usually paired with MKS Robin Nano V2 & V3
2647
 //
2647
 //
2648
 //#define MKS_TS35_V2_0
2648
 //#define MKS_TS35_V2_0
2649
 
2649
 
2650
 //
2650
 //
2651
 // 320x240, 2.4", FSMC Display From MKS
2651
 // 320x240, 2.4", FSMC Display From MKS
2652
-// Normally used in MKS Robin Nano V1.2
2652
+// Usually paired with MKS Robin Nano V1.2
2653
 //
2653
 //
2654
 //#define MKS_ROBIN_TFT24
2654
 //#define MKS_ROBIN_TFT24
2655
 
2655
 
2656
 //
2656
 //
2657
 // 320x240, 2.8", FSMC Display From MKS
2657
 // 320x240, 2.8", FSMC Display From MKS
2658
-// Normally used in MKS Robin Nano V1.2
2658
+// Usually paired with MKS Robin Nano V1.2
2659
 //
2659
 //
2660
 //#define MKS_ROBIN_TFT28
2660
 //#define MKS_ROBIN_TFT28
2661
 
2661
 
2662
 //
2662
 //
2663
 // 320x240, 3.2", FSMC Display From MKS
2663
 // 320x240, 3.2", FSMC Display From MKS
2664
-// Normally used in MKS Robin Nano V1.2
2664
+// Usually paired with MKS Robin Nano V1.2
2665
 //
2665
 //
2666
 //#define MKS_ROBIN_TFT32
2666
 //#define MKS_ROBIN_TFT32
2667
 
2667
 
2668
 //
2668
 //
2669
 // 480x320, 3.5", FSMC Display From MKS
2669
 // 480x320, 3.5", FSMC Display From MKS
2670
-// Normally used in MKS Robin Nano V1.2
2670
+// Usually paired with MKS Robin Nano V1.2
2671
 //
2671
 //
2672
 //#define MKS_ROBIN_TFT35
2672
 //#define MKS_ROBIN_TFT35
2673
 
2673
 
2678
 
2678
 
2679
 //
2679
 //
2680
 // 320x240, 3.2", FSMC Display From MKS
2680
 // 320x240, 3.2", FSMC Display From MKS
2681
-// Normally used in MKS Robin
2681
+// Usually paired with MKS Robin
2682
 //
2682
 //
2683
 //#define MKS_ROBIN_TFT_V1_1R
2683
 //#define MKS_ROBIN_TFT_V1_1R
2684
 
2684
 
2708
 //#define ANET_ET5_TFT35
2708
 //#define ANET_ET5_TFT35
2709
 
2709
 
2710
 //
2710
 //
2711
-// 1024x600, 7", RGB Stock Display from BIQU-BX
2711
+// 1024x600, 7", RGB Stock Display with Rotary Encoder from BIQU-BX
2712
 //
2712
 //
2713
 //#define BIQU_BX_TFT70
2713
 //#define BIQU_BX_TFT70
2714
 
2714
 
2715
 //
2715
 //
2716
+// 480x320, 3.5", SPI Stock Display with Rotary Encoder from BIQU B1 SE Series
2717
+//
2718
+//#define BTT_TFT35_SPI_V1_0
2719
+
2720
+//
2716
 // Generic TFT with detailed options
2721
 // Generic TFT with detailed options
2717
 //
2722
 //
2718
 //#define TFT_GENERIC
2723
 //#define TFT_GENERIC

+ 31
- 1
Marlin/src/core/macros.h View File

160
 
160
 
161
 #endif
161
 #endif
162
 
162
 
163
-// Macros to chain up to 14 conditions
163
+// Macros to chain up to 40 conditions
164
 #define _DO_1(W,C,A)       (_##W##_1(A))
164
 #define _DO_1(W,C,A)       (_##W##_1(A))
165
 #define _DO_2(W,C,A,B)     (_##W##_1(A) C _##W##_1(B))
165
 #define _DO_2(W,C,A,B)     (_##W##_1(A) C _##W##_1(B))
166
 #define _DO_3(W,C,A,V...)  (_##W##_1(A) C _DO_2(W,C,V))
166
 #define _DO_3(W,C,A,V...)  (_##W##_1(A) C _DO_2(W,C,V))
176
 #define _DO_13(W,C,A,V...) (_##W##_1(A) C _DO_12(W,C,V))
176
 #define _DO_13(W,C,A,V...) (_##W##_1(A) C _DO_12(W,C,V))
177
 #define _DO_14(W,C,A,V...) (_##W##_1(A) C _DO_13(W,C,V))
177
 #define _DO_14(W,C,A,V...) (_##W##_1(A) C _DO_13(W,C,V))
178
 #define _DO_15(W,C,A,V...) (_##W##_1(A) C _DO_14(W,C,V))
178
 #define _DO_15(W,C,A,V...) (_##W##_1(A) C _DO_14(W,C,V))
179
+#define _DO_16(W,C,A,V...) (_##W##_1(A) C _DO_15(W,C,V))
180
+#define _DO_17(W,C,A,V...) (_##W##_1(A) C _DO_16(W,C,V))
181
+#define _DO_18(W,C,A,V...) (_##W##_1(A) C _DO_17(W,C,V))
182
+#define _DO_19(W,C,A,V...) (_##W##_1(A) C _DO_18(W,C,V))
183
+#define _DO_20(W,C,A,V...) (_##W##_1(A) C _DO_19(W,C,V))
184
+#define _DO_21(W,C,A,V...) (_##W##_1(A) C _DO_20(W,C,V))
185
+#define _DO_22(W,C,A,V...) (_##W##_1(A) C _DO_21(W,C,V))
186
+#define _DO_23(W,C,A,V...) (_##W##_1(A) C _DO_22(W,C,V))
187
+#define _DO_24(W,C,A,V...) (_##W##_1(A) C _DO_23(W,C,V))
188
+#define _DO_25(W,C,A,V...) (_##W##_1(A) C _DO_24(W,C,V))
189
+#define _DO_26(W,C,A,V...) (_##W##_1(A) C _DO_25(W,C,V))
190
+#define _DO_27(W,C,A,V...) (_##W##_1(A) C _DO_26(W,C,V))
191
+#define _DO_28(W,C,A,V...) (_##W##_1(A) C _DO_27(W,C,V))
192
+#define _DO_29(W,C,A,V...) (_##W##_1(A) C _DO_28(W,C,V))
193
+#define _DO_30(W,C,A,V...) (_##W##_1(A) C _DO_29(W,C,V))
194
+#define _DO_31(W,C,A,V...) (_##W##_1(A) C _DO_30(W,C,V))
195
+#define _DO_32(W,C,A,V...) (_##W##_1(A) C _DO_31(W,C,V))
196
+#define _DO_33(W,C,A,V...) (_##W##_1(A) C _DO_32(W,C,V))
197
+#define _DO_34(W,C,A,V...) (_##W##_1(A) C _DO_33(W,C,V))
198
+#define _DO_35(W,C,A,V...) (_##W##_1(A) C _DO_34(W,C,V))
199
+#define _DO_36(W,C,A,V...) (_##W##_1(A) C _DO_35(W,C,V))
200
+#define _DO_37(W,C,A,V...) (_##W##_1(A) C _DO_36(W,C,V))
201
+#define _DO_38(W,C,A,V...) (_##W##_1(A) C _DO_37(W,C,V))
202
+#define _DO_39(W,C,A,V...) (_##W##_1(A) C _DO_38(W,C,V))
203
+#define _DO_40(W,C,A,V...) (_##W##_1(A) C _DO_39(W,C,V))
179
 #define __DO_N(W,C,N,V...) _DO_##N(W,C,V)
204
 #define __DO_N(W,C,N,V...) _DO_##N(W,C,V)
180
 #define _DO_N(W,C,N,V...)  __DO_N(W,C,N,V)
205
 #define _DO_N(W,C,N,V...)  __DO_N(W,C,N,V)
181
 #define DO(W,C,V...)       (_DO_N(W,C,NUM_ARGS(V),V))
206
 #define DO(W,C,V...)       (_DO_N(W,C,NUM_ARGS(V),V))
251
     memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \
276
     memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \
252
   }while(0)
277
   }while(0)
253
 
278
 
279
+#define CODE_16( A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) A; B; C; D; E; F; G; H; I; J; K; L; M; N; O; P
280
+#define CODE_15( A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) A; B; C; D; E; F; G; H; I; J; K; L; M; N; O
281
+#define CODE_14( A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) A; B; C; D; E; F; G; H; I; J; K; L; M; N
282
+#define CODE_13( A,B,C,D,E,F,G,H,I,J,K,L,M,...) A; B; C; D; E; F; G; H; I; J; K; L; M
283
+#define CODE_12( A,B,C,D,E,F,G,H,I,J,K,L,...) A; B; C; D; E; F; G; H; I; J; K; L
254
 #define CODE_11( A,B,C,D,E,F,G,H,I,J,K,...) A; B; C; D; E; F; G; H; I; J; K
284
 #define CODE_11( A,B,C,D,E,F,G,H,I,J,K,...) A; B; C; D; E; F; G; H; I; J; K
255
 #define CODE_10( A,B,C,D,E,F,G,H,I,J,...) A; B; C; D; E; F; G; H; I; J
285
 #define CODE_10( A,B,C,D,E,F,G,H,I,J,...) A; B; C; D; E; F; G; H; I; J
256
 #define CODE_9( A,B,C,D,E,F,G,H,I,...) A; B; C; D; E; F; G; H; I
286
 #define CODE_9( A,B,C,D,E,F,G,H,I,...) A; B; C; D; E; F; G; H; I

+ 6
- 6
Marlin/src/inc/Conditionals_LCD.h View File

1244
  *  - TFT_COLOR
1244
  *  - TFT_COLOR
1245
  *  - GRAPHICAL_TFT_UPSCALE
1245
  *  - GRAPHICAL_TFT_UPSCALE
1246
  */
1246
  */
1247
-#if ENABLED(MKS_TS35_V2_0)          // ST7796
1247
+#if EITHER(MKS_TS35_V2_0, BTT_TFT35_SPI_V1_0)                                 // ST7796
1248
   #define TFT_DEFAULT_DRIVER ST7796
1248
   #define TFT_DEFAULT_DRIVER ST7796
1249
   #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
1249
   #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
1250
   #define TFT_RES_480x320
1250
   #define TFT_RES_480x320
1251
   #define TFT_INTERFACE_SPI
1251
   #define TFT_INTERFACE_SPI
1252
-#elif EITHER(LERDGE_TFT35, ANET_ET5_TFT35) // ST7796
1252
+#elif EITHER(LERDGE_TFT35, ANET_ET5_TFT35)                                    // ST7796
1253
   #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
1253
   #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
1254
   #define TFT_RES_480x320
1254
   #define TFT_RES_480x320
1255
   #define TFT_INTERFACE_FSMC
1255
   #define TFT_INTERFACE_FSMC
1256
-#elif ANY(ANET_ET4_TFT28, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32) // ST7789
1256
+#elif ANY(ANET_ET4_TFT28, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32)  // ST7789
1257
   #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
1257
   #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_Y)
1258
   #define TFT_RES_320x240
1258
   #define TFT_RES_320x240
1259
   #define TFT_INTERFACE_FSMC
1259
   #define TFT_INTERFACE_FSMC
1260
-#elif ANY(MKS_ROBIN_TFT35, TFT_TRONXY_X5SA, ANYCUBIC_TFT35) // ILI9488
1260
+#elif ANY(MKS_ROBIN_TFT35, TFT_TRONXY_X5SA, ANYCUBIC_TFT35)                   // ILI9488
1261
   #define TFT_DRIVER ILI9488
1261
   #define TFT_DRIVER ILI9488
1262
   #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
1262
   #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
1263
   #define TFT_RES_480x320
1263
   #define TFT_RES_480x320
1267
   #define TFT_DEFAULT_ORIENTATION 0
1267
   #define TFT_DEFAULT_ORIENTATION 0
1268
   #define TFT_RES_480x272
1268
   #define TFT_RES_480x272
1269
   #define TFT_INTERFACE_FSMC
1269
   #define TFT_INTERFACE_FSMC
1270
-#elif ANY(MKS_ROBIN_TFT_V1_1R, LONGER_LK_TFT28)  // ILI9328 or R61505
1270
+#elif ANY(MKS_ROBIN_TFT_V1_1R, LONGER_LK_TFT28)                               // ILI9328 or R61505
1271
   #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
1271
   #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
1272
   #define TFT_RES_320x240
1272
   #define TFT_RES_320x240
1273
   #define TFT_INTERFACE_FSMC
1273
   #define TFT_INTERFACE_FSMC
1274
-#elif ENABLED(BIQU_BX_TFT70)        // RGB
1274
+#elif ENABLED(BIQU_BX_TFT70)                                                  // RGB
1275
   #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
1275
   #define TFT_DEFAULT_ORIENTATION TFT_EXCHANGE_XY
1276
   #define TFT_RES_1024x600
1276
   #define TFT_RES_1024x600
1277
   #define TFT_INTERFACE_LTDC
1277
   #define TFT_INTERFACE_LTDC

+ 6
- 2
Marlin/src/inc/SanityCheck.h View File

2619
   + COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) \
2619
   + COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) \
2620
   + COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
2620
   + COUNT_ENABLED(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) \
2621
   + COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \
2621
   + COUNT_ENABLED(MKS_12864OLED, MKS_12864OLED_SSD1306) \
2622
-  + COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, ANET_ET4_TFT28, ANET_ET5_TFT35) \
2622
+  + COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, ANET_ET4_TFT28, ANET_ET5_TFT35, BIQU_BX_TFT70, BTT_TFT35_SPI_V1_0) \
2623
   + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \
2623
   + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \
2624
   + COUNT_ENABLED(VIKI2, miniVIKI) \
2624
   + COUNT_ENABLED(VIKI2, miniVIKI) \
2625
   + ENABLED(WYH_L12864) \
2625
   + ENABLED(WYH_L12864) \
2670
 #undef IS_U8GLIB_SSD1306
2670
 #undef IS_U8GLIB_SSD1306
2671
 #undef IS_EXTUI
2671
 #undef IS_EXTUI
2672
 
2672
 
2673
-#if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28, ANET_ET4_TFT28, ANET_ET5_TFT35, BIQU_BX_TFT70)
2673
+#if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28, ANET_ET4_TFT28, ANET_ET5_TFT35, BIQU_BX_TFT70, BTT_TFT35_SPI_V1_0)
2674
   #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
2674
   #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
2675
     #error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one."
2675
     #error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one."
2676
   #elif MANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
2676
   #elif MANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
2712
   #error "Please select only one of CHIRON_TFT_STANDARD or CHIRON_TFT_NEW."
2712
   #error "Please select only one of CHIRON_TFT_STANDARD or CHIRON_TFT_NEW."
2713
 #endif
2713
 #endif
2714
 
2714
 
2715
+#if EITHER(MKS_TS35_V2_0, BTT_TFT35_SPI_V1_0) && SD_CONNECTION_IS(LCD)
2716
+  #error "SDCARD_CONNECTION cannot be set to LCD for the enabled TFT. No available SD card reader."
2717
+#endif
2718
+
2715
 /**
2719
 /**
2716
  * Ender 3 V2 controller has some limitations
2720
  * Ender 3 V2 controller has some limitations
2717
  */
2721
  */

+ 8
- 6
Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp View File

78
   #include "../marlinui.h"
78
   #include "../marlinui.h"
79
 #endif
79
 #endif
80
 
80
 
81
-#if HAS_TOUCH_BUTTONS
82
-  #include "../touch/touch_buttons.h"
83
-  #if HAS_TOUCH_SLEEP
84
-    #define HAS_TOUCH_BUTTONS_SLEEP 1
85
-  #endif
81
+#if HAS_TOUCH_BUTTONS && HAS_TOUCH_SLEEP
82
+  #define HAS_TOUCH_BUTTONS_SLEEP 1
86
 #endif
83
 #endif
87
 
84
 
85
+#include "../touch/touch_buttons.h"
86
+#include "../scaled_tft.h"
87
+
88
 #define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1)
88
 #define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1)
89
 #define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 1)
89
 #define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 1)
90
 
90
 
325
 static uint8_t page;
325
 static uint8_t page;
326
 
326
 
327
 #if HAS_TOUCH_BUTTONS
327
 #if HAS_TOUCH_BUTTONS
328
+
328
   static bool redrawTouchButtons = true;
329
   static bool redrawTouchButtons = true;
329
   static void drawTouchButtons(u8g_t *u8g, u8g_dev_t *dev) {
330
   static void drawTouchButtons(u8g_t *u8g, u8g_dev_t *dev) {
330
     if (!redrawTouchButtons) return;
331
     if (!redrawTouchButtons) return;
343
     setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO, BUTTONC_X_HI, BUTTON_Y_HI);
344
     setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO, BUTTONC_X_HI, BUTTON_Y_HI);
344
     drawImage(buttonC, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTOKMENU_COLOR);
345
     drawImage(buttonC, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTOKMENU_COLOR);
345
   }
346
   }
347
+
346
 #endif // HAS_TOUCH_BUTTONS
348
 #endif // HAS_TOUCH_BUTTONS
347
 
349
 
348
 static void u8g_upscale_clear_lcd(u8g_t *u8g, u8g_dev_t *dev, uint16_t *buffer) {
350
 static void u8g_upscale_clear_lcd(u8g_t *u8g, u8g_dev_t *dev, uint16_t *buffer) {
395
           if (!sleepCleared) {
397
           if (!sleepCleared) {
396
             sleepCleared = true;
398
             sleepCleared = true;
397
             u8g_upscale_clear_lcd(u8g, dev, buffer);
399
             u8g_upscale_clear_lcd(u8g, dev, buffer);
398
-            IF_ENABLED(HAS_TOUCH_BUTTONS, redrawTouchButtons = true);
400
+            TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true);
399
           }
401
           }
400
           break;
402
           break;
401
         }
403
         }

+ 28
- 0
Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h View File

255
   #define _DO_10(W,C,A,V...) (_##W##_1(A) C _DO_9(W,C,V))
255
   #define _DO_10(W,C,A,V...) (_##W##_1(A) C _DO_9(W,C,V))
256
   #define _DO_11(W,C,A,V...) (_##W##_1(A) C _DO_10(W,C,V))
256
   #define _DO_11(W,C,A,V...) (_##W##_1(A) C _DO_10(W,C,V))
257
   #define _DO_12(W,C,A,V...) (_##W##_1(A) C _DO_11(W,C,V))
257
   #define _DO_12(W,C,A,V...) (_##W##_1(A) C _DO_11(W,C,V))
258
+  #define _DO_13(W,C,A,V...) (_##W##_1(A) C _DO_12(W,C,V))
259
+  #define _DO_14(W,C,A,V...) (_##W##_1(A) C _DO_13(W,C,V))
260
+  #define _DO_15(W,C,A,V...) (_##W##_1(A) C _DO_14(W,C,V))
261
+  #define _DO_16(W,C,A,V...) (_##W##_1(A) C _DO_15(W,C,V))
262
+  #define _DO_17(W,C,A,V...) (_##W##_1(A) C _DO_16(W,C,V))
263
+  #define _DO_18(W,C,A,V...) (_##W##_1(A) C _DO_17(W,C,V))
264
+  #define _DO_19(W,C,A,V...) (_##W##_1(A) C _DO_18(W,C,V))
265
+  #define _DO_20(W,C,A,V...) (_##W##_1(A) C _DO_19(W,C,V))
266
+  #define _DO_21(W,C,A,V...) (_##W##_1(A) C _DO_20(W,C,V))
267
+  #define _DO_22(W,C,A,V...) (_##W##_1(A) C _DO_21(W,C,V))
268
+  #define _DO_23(W,C,A,V...) (_##W##_1(A) C _DO_22(W,C,V))
269
+  #define _DO_24(W,C,A,V...) (_##W##_1(A) C _DO_23(W,C,V))
270
+  #define _DO_25(W,C,A,V...) (_##W##_1(A) C _DO_24(W,C,V))
271
+  #define _DO_26(W,C,A,V...) (_##W##_1(A) C _DO_25(W,C,V))
272
+  #define _DO_27(W,C,A,V...) (_##W##_1(A) C _DO_26(W,C,V))
273
+  #define _DO_28(W,C,A,V...) (_##W##_1(A) C _DO_27(W,C,V))
274
+  #define _DO_29(W,C,A,V...) (_##W##_1(A) C _DO_28(W,C,V))
275
+  #define _DO_30(W,C,A,V...) (_##W##_1(A) C _DO_29(W,C,V))
276
+  #define _DO_31(W,C,A,V...) (_##W##_1(A) C _DO_30(W,C,V))
277
+  #define _DO_32(W,C,A,V...) (_##W##_1(A) C _DO_31(W,C,V))
278
+  #define _DO_33(W,C,A,V...) (_##W##_1(A) C _DO_32(W,C,V))
279
+  #define _DO_34(W,C,A,V...) (_##W##_1(A) C _DO_33(W,C,V))
280
+  #define _DO_35(W,C,A,V...) (_##W##_1(A) C _DO_34(W,C,V))
281
+  #define _DO_36(W,C,A,V...) (_##W##_1(A) C _DO_35(W,C,V))
282
+  #define _DO_37(W,C,A,V...) (_##W##_1(A) C _DO_36(W,C,V))
283
+  #define _DO_38(W,C,A,V...) (_##W##_1(A) C _DO_37(W,C,V))
284
+  #define _DO_39(W,C,A,V...) (_##W##_1(A) C _DO_38(W,C,V))
285
+  #define _DO_40(W,C,A,V...) (_##W##_1(A) C _DO_39(W,C,V))
258
   #define __DO_N(W,C,N,V...) _DO_##N(W,C,V)
286
   #define __DO_N(W,C,N,V...) _DO_##N(W,C,V)
259
   #define _DO_N(W,C,N,V...)  __DO_N(W,C,N,V)
287
   #define _DO_N(W,C,N,V...)  __DO_N(W,C,N,V)
260
   #define DO(W,C,V...)       _DO_N(W,C,NUM_ARGS(V),V)
288
   #define DO(W,C,V...)       _DO_N(W,C,NUM_ARGS(V),V)

+ 4
- 0
Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp View File

27
 #include "../../../inc/MarlinConfig.h"
27
 #include "../../../inc/MarlinConfig.h"
28
 #include "SPIFlashStorage.h"
28
 #include "SPIFlashStorage.h"
29
 
29
 
30
+#if !HAS_SPI_FLASH
31
+  #error "HAS_SPI_FLASH is required with TFT_LVGL_UI."
32
+#endif
33
+
30
 extern W25QXXFlash W25QXX;
34
 extern W25QXXFlash W25QXX;
31
 
35
 
32
 uint8_t SPIFlashStorage::m_pageData[SPI_FLASH_PageSize];
36
 uint8_t SPIFlashStorage::m_pageData[SPI_FLASH_PageSize];

+ 1
- 2
Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h View File

69
 
69
 
70
 // SPI Flash
70
 // SPI Flash
71
 #define HAS_SPI_FLASH                          1
71
 #define HAS_SPI_FLASH                          1
72
-#define SPI_FLASH_SIZE                 0x1000000  // 16MB
73
-
74
 #if HAS_SPI_FLASH
72
 #if HAS_SPI_FLASH
75
   // SPI 2
73
   // SPI 2
76
   #define SPI_FLASH_CS_PIN                  PB12  // SPI2_NSS / Flash chip-select
74
   #define SPI_FLASH_CS_PIN                  PB12  // SPI2_NSS / Flash chip-select
77
   #define SPI_FLASH_MOSI_PIN                PB15
75
   #define SPI_FLASH_MOSI_PIN                PB15
78
   #define SPI_FLASH_MISO_PIN                PB14
76
   #define SPI_FLASH_MISO_PIN                PB14
79
   #define SPI_FLASH_SCK_PIN                 PB13
77
   #define SPI_FLASH_SCK_PIN                 PB13
78
+  #define SPI_FLASH_SIZE               0x1000000  // 16MB
80
 #endif
79
 #endif
81
 
80
 
82
 //
81
 //

+ 21
- 0
Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h View File

495
   #endif
495
   #endif
496
 #endif
496
 #endif
497
 
497
 
498
+#if HAS_SPI_TFT
499
+  //
500
+  // e.g., BTT_TFT35_SPI_V1_0 (480x320, 3.5", SPI Stock Display with Rotary Encoder in BIQU B1 SE)
501
+  //
502
+  #define TFT_CS_PIN                 EXP2_07_PIN
503
+  #define TFT_A0_PIN                 EXP2_04_PIN
504
+  #define TFT_SCK_PIN                EXP2_09_PIN
505
+  #define TFT_MISO_PIN               EXP2_10_PIN
506
+  #define TFT_MOSI_PIN               EXP2_05_PIN
507
+
508
+  #define TOUCH_INT_PIN              EXP1_04_PIN
509
+  #define TOUCH_MISO_PIN             EXP1_05_PIN
510
+  #define TOUCH_MOSI_PIN             EXP1_08_PIN
511
+  #define TOUCH_SCK_PIN              EXP1_06_PIN
512
+  #define TOUCH_CS_PIN               EXP1_07_PIN
513
+
514
+  #define BTN_EN1                    EXP2_08_PIN
515
+  #define BTN_EN2                    EXP2_06_PIN
516
+  #define BTN_ENC                    EXP1_09_PIN
517
+#endif
518
+
498
 //
519
 //
499
 // NeoPixel LED
520
 // NeoPixel LED
500
 //
521
 //

Loading…
Cancel
Save