Skip to content

Commit 7307f6d

Browse files
thisiskeithbthinkyhead
authored andcommitted
🩹 Fix SPI TFT build on SKR V2 & V3/EZ (MarlinFirmware#26041)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
1 parent 945347a commit 7307f6d

File tree

6 files changed

+115
-19
lines changed

6 files changed

+115
-19
lines changed

Marlin/src/pins/linux/pins_RAMPS_LINUX.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,9 @@
377377

378378
#if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
379379

380-
#define TFT_A0_PIN 43
381380
#define TFT_CS_PIN 49
382381
#define TFT_DC_PIN 43
382+
#define TFT_A0_PIN TFT_DC_PIN
383383
#define TFT_SCK_PIN SD_SCK_PIN
384384
#define TFT_MISO_PIN SD_MISO_PIN
385385
#define TFT_MOSI_PIN SD_MOSI_PIN

Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h

+27-5
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
#define BTN_EN1 EXP2_03_PIN
320320
#define BTN_EN2 EXP2_05_PIN
321321

322-
#define TFT_DC_PIN TFT_A0_PIN
322+
#define TFT_A0_PIN TFT_DC_PIN
323323

324324
#ifndef TFT_WIDTH
325325
#define TFT_WIDTH 480
@@ -329,10 +329,23 @@
329329
#endif
330330

331331
#if ENABLED(BTT_TFT35_SPI_V1_0)
332-
// 480x320, 3.5", SPI Display with Rotary Encoder.
333-
// Stock Display for the BIQU B1 SE.
332+
333+
/**
334+
* ------ ------
335+
* BEEPER | 1 2 | LCD-BTN MISO | 1 2 | CLK
336+
* T_MOSI | 3 4 | T_CS LCD-ENCA | 3 4 | TFTCS
337+
* T_CLK | 5 6 T_MISO LCD-ENCB | 5 6 MOSI
338+
* PENIRQ | 7 8 | F_CS RS | 7 8 | RESET
339+
* GND | 9 10 | VCC GND | 9 10 | NC
340+
* ------ ------
341+
* EXP1 EXP2
342+
*
343+
* 480x320, 3.5", SPI Display with Rotary Encoder.
344+
* Stock Display for the BIQU B1 SE Series.
345+
* Schematic: https://github.com/bigtreetech/TFT35-SPI/blob/master/v1/Hardware/BTT%20TFT35-SPI%20V1-SCH.pdf
346+
*/
334347
#define TFT_CS_PIN EXP2_04_PIN
335-
#define TFT_A0_PIN EXP2_07_PIN
348+
#define TFT_DC_PIN EXP2_07_PIN
336349

337350
#define TOUCH_CS_PIN EXP1_04_PIN
338351
#define TOUCH_SCK_PIN EXP1_05_PIN
@@ -342,8 +355,17 @@
342355

343356
#elif ENABLED(MKS_TS35_V2_0)
344357

358+
/** ------ ------
359+
* BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK
360+
* TFT_BKL / LCD_EN | 3 4 | TFT_RESET / LCD_RS BTN_EN1 | 3 4 | SPI1_CS
361+
* TOUCH_CS / LCD_D4 | 5 6 TOUCH_INT / LCD_D5 BTN_EN2 | 5 6 SPI1_MOSI
362+
* SPI1_CS / LCD_D6 | 7 8 | SPI1_RS / LCD_D7 SPI1_RS | 7 8 | RESET
363+
* GND | 9 10 | VCC GND | 9 10 | VCC
364+
* ------ ------
365+
* EXP1 EXP2
366+
*/
345367
#define TFT_CS_PIN EXP1_07_PIN
346-
#define TFT_A0_PIN EXP1_08_PIN
368+
#define TFT_DC_PIN EXP1_08_PIN
347369

348370
#define TFT_RESET_PIN EXP1_04_PIN
349371

Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@
396396

397397
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
398398
#define TFT_CS_PIN EXP1_07_PIN
399-
#define TFT_A0_PIN EXP1_08_PIN
400399
#define TFT_DC_PIN EXP1_08_PIN
400+
#define TFT_A0_PIN TFT_DC_PIN
401401
#define TFT_MISO_PIN EXP2_01_PIN
402402
#define TFT_BACKLIGHT_PIN EXP1_03_PIN
403403
#define TFT_RESET_PIN EXP1_04_PIN

Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@
295295

296296
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
297297
#define TFT_CS_PIN EXP1_07_PIN
298-
#define TFT_A0_PIN EXP1_08_PIN
299298
#define TFT_DC_PIN EXP1_08_PIN
299+
#define TFT_A0_PIN TFT_DC_PIN
300300
#define TFT_MISO_PIN EXP2_01_PIN
301301
#define TFT_BACKLIGHT_PIN EXP1_03_PIN
302302
#define TFT_RESET_PIN EXP1_04_PIN

Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h

+62-5
Original file line numberDiff line numberDiff line change
@@ -514,22 +514,63 @@
514514

515515
#if HAS_SPI_TFT
516516

517+
#define TFT_SCK_PIN EXP2_02_PIN
518+
#define TFT_MISO_PIN EXP2_01_PIN
519+
#define TFT_MOSI_PIN EXP2_06_PIN
520+
517521
#define BTN_ENC EXP1_02_PIN
518522
#define BTN_EN1 EXP2_03_PIN
519523
#define BTN_EN2 EXP2_05_PIN
520524

525+
#ifndef TFT_WIDTH
526+
#define TFT_WIDTH 480
527+
#endif
528+
#ifndef TFT_HEIGHT
529+
#define TFT_HEIGHT 320
530+
#endif
531+
521532
#if ENABLED(BTT_TFT35_SPI_V1_0)
522-
// 480x320, 3.5", SPI Display with Rotary Encoder.
523-
// Stock Display for the BIQU B1 SE.
533+
534+
/**
535+
* ------ ------
536+
* BEEPER | 1 2 | LCD-BTN MISO | 1 2 | CLK
537+
* T_MOSI | 3 4 | T_CS LCD-ENCA | 3 4 | TFTCS
538+
* T_CLK | 5 6 T_MISO LCD-ENCB | 5 6 MOSI
539+
* PENIRQ | 7 8 | F_CS RS | 7 8 | RESET
540+
* GND | 9 10 | VCC GND | 9 10 | NC
541+
* ------ ------
542+
* EXP1 EXP2
543+
*
544+
* 480x320, 3.5", SPI Display with Rotary Encoder.
545+
* Stock Display for the BIQU B1 SE Series.
546+
* Schematic: https://github.com/bigtreetech/TFT35-SPI/blob/master/v1/Hardware/BTT%20TFT35-SPI%20V1-SCH.pdf
547+
*/
524548
#define TFT_CS_PIN EXP2_04_PIN
525-
#define TFT_A0_PIN EXP2_07_PIN
549+
#define TFT_DC_PIN EXP2_07_PIN
550+
#define TFT_A0_PIN TFT_DC_PIN
526551

527552
#define TOUCH_CS_PIN EXP1_04_PIN
528553
#define TOUCH_SCK_PIN EXP1_05_PIN
529554
#define TOUCH_MISO_PIN EXP1_06_PIN
530555
#define TOUCH_MOSI_PIN EXP1_03_PIN
531556
#define TOUCH_INT_PIN EXP1_07_PIN
532557

558+
#ifndef TOUCH_CALIBRATION_X
559+
#define TOUCH_CALIBRATION_X 17540
560+
#endif
561+
#ifndef TOUCH_CALIBRATION_Y
562+
#define TOUCH_CALIBRATION_Y -11388
563+
#endif
564+
#ifndef TOUCH_OFFSET_X
565+
#define TOUCH_OFFSET_X -21
566+
#endif
567+
#ifndef TOUCH_OFFSET_Y
568+
#define TOUCH_OFFSET_Y 337
569+
#endif
570+
#ifndef TOUCH_ORIENTATION
571+
#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
572+
#endif
573+
533574
#elif ENABLED(MKS_TS35_V2_0)
534575

535576
/** ------ ------
@@ -542,8 +583,8 @@
542583
* EXP1 EXP2
543584
*/
544585
#define TFT_CS_PIN EXP1_07_PIN // SPI1_CS
545-
#define TFT_A0_PIN EXP1_08_PIN // SPI1_RS
546-
#define TFT_DC_PIN TFT_DC_PIN
586+
#define TFT_DC_PIN EXP1_08_PIN // SPI1_RS
587+
#define TFT_A0_PIN TFT_DC_PIN
547588

548589
#define TFT_RESET_PIN EXP1_04_PIN
549590

@@ -563,6 +604,22 @@
563604

564605
#define TFT_BUFFER_SIZE 14400
565606

607+
#ifndef TOUCH_CALIBRATION_X
608+
#define TOUCH_CALIBRATION_X -17253
609+
#endif
610+
#ifndef TOUCH_CALIBRATION_Y
611+
#define TOUCH_CALIBRATION_Y 11579
612+
#endif
613+
#ifndef TOUCH_OFFSET_X
614+
#define TOUCH_OFFSET_X 514
615+
#endif
616+
#ifndef TOUCH_OFFSET_Y
617+
#define TOUCH_OFFSET_Y -24
618+
#endif
619+
#ifndef TOUCH_ORIENTATION
620+
#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
621+
#endif
622+
566623
#endif
567624

568625
#endif // HAS_SPI_TFT

Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h

+23-6
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,13 @@
459459

460460
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
461461

462+
#define TFT_SCK_PIN EXP2_02_PIN
463+
#define TFT_MISO_PIN EXP2_01_PIN
464+
#define TFT_MOSI_PIN EXP2_06_PIN
465+
462466
#define BTN_EN1 EXP2_03_PIN
463467
#define BTN_EN2 EXP2_05_PIN
464468

465-
#define TFT_DC_PIN TFT_A0_PIN
466-
467469
#ifndef TFT_WIDTH
468470
#define TFT_WIDTH 480
469471
#endif
@@ -472,10 +474,24 @@
472474
#endif
473475

474476
#if ENABLED(BTT_TFT35_SPI_V1_0)
475-
// 480x320, 3.5", SPI Display with Rotary Encoder.
476-
// Stock Display for the BIQU B1 SE.
477+
478+
/**
479+
* ------ ------
480+
* BEEPER | 1 2 | LCD-BTN MISO | 1 2 | CLK
481+
* T_MOSI | 3 4 | T_CS LCD-ENCA | 3 4 | TFTCS
482+
* T_CLK | 5 6 T_MISO LCD-ENCB | 5 6 MOSI
483+
* PENIRQ | 7 8 | F_CS RS | 7 8 | RESET
484+
* GND | 9 10 | VCC GND | 9 10 | NC
485+
* ------ ------
486+
* EXP1 EXP2
487+
*
488+
* 480x320, 3.5", SPI Display with Rotary Encoder.
489+
* Stock Display for the BIQU B1 SE Series.
490+
* Schematic: https://github.com/bigtreetech/TFT35-SPI/blob/master/v1/Hardware/BTT%20TFT35-SPI%20V1-SCH.pdf
491+
*/
477492
#define TFT_CS_PIN EXP2_04_PIN
478-
#define TFT_A0_PIN EXP2_07_PIN
493+
#define TFT_DC_PIN EXP2_07_PIN
494+
#define TFT_A0_PIN TFT_DC_PIN
479495

480496
#define TOUCH_CS_PIN EXP1_04_PIN
481497
#define TOUCH_SCK_PIN EXP1_05_PIN
@@ -511,7 +527,8 @@
511527
* EXP1 EXP2
512528
*/
513529
#define TFT_CS_PIN EXP1_07_PIN // SPI1_CS
514-
#define TFT_A0_PIN EXP1_08_PIN // SPI1_RS
530+
#define TFT_DC_PIN EXP1_08_PIN // SPI1_RS
531+
#define TFT_A0_PIN TFT_DC_PIN
515532

516533
#define TFT_RESET_PIN EXP1_04_PIN
517534

0 commit comments

Comments
 (0)