Przeglądaj źródła

Fixes for FYSETC Touch EVE 5" on AVR (#17659)

Co-Authored-By: RudolphRiedel <rudolphriedel@users.noreply.github.com>
Co-authored-by: sL1pKn07 <sl1pkn07@gmail.com>
Scott Lahteine 4 lat temu
rodzic
commit
3a27933ae7
No account linked to committer's email address

+ 6
- 4
Marlin/Configuration_adv.h Wyświetl plik

@@ -1375,10 +1375,12 @@
1375 1375
   //#define TOUCH_UI_800x480
1376 1376
 
1377 1377
   // Mappings for boards with a standard RepRapDiscount Display connector
1378
-  //#define AO_EXP1_PINMAP    // AlephObjects CLCD UI EXP1 mapping
1379
-  //#define AO_EXP2_PINMAP    // AlephObjects CLCD UI EXP2 mapping
1380
-  //#define CR10_TFT_PINMAP   // Rudolph Riedel's CR10 pin mapping
1381
-  //#define S6_TFT_PINMAP     // FYSETC S6 pin mapping
1378
+  //#define AO_EXP1_PINMAP      // AlephObjects CLCD UI EXP1 mapping
1379
+  //#define AO_EXP2_PINMAP      // AlephObjects CLCD UI EXP2 mapping
1380
+  //#define CR10_TFT_PINMAP     // Rudolph Riedel's CR10 pin mapping
1381
+  //#define S6_TFT_PINMAP       // FYSETC S6 pin mapping
1382
+  //#define E3_EXP1_PINMAP      // E3 type boards (SKR E3/DIP, FYSETC Cheetah and Stock boards) EXP1 pin mapping
1383
+  //#define GENERIC_EXP2_PINMAP // GENERIC EXP2 pin mapping
1382 1384
 
1383 1385
   //#define OTHER_PIN_LAYOUT  // Define pins manually below
1384 1386
   #if ENABLED(OTHER_PIN_LAYOUT)

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h Wyświetl plik

@@ -361,7 +361,7 @@
361 361
   #define HAS_DGUS_LCD 1
362 362
 #endif
363 363
 
364
-// Extensible UI serial touch screens. (See src/lcd/extensible_ui)
364
+// Extensible UI serial touch screens. (See src/lcd/extui)
365 365
 #if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE)
366 366
   #define IS_EXTUI
367 367
   #define EXTENSIBLE_UI

+ 45
- 51
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp Wyświetl plik

@@ -58,7 +58,7 @@ void CLCD::FontMetrics::load(const uint8_t font) {
58 58
 uint16_t CLCD::FontMetrics::get_text_width(const char *str, size_t n) const {
59 59
   uint16_t width = 0;
60 60
   const uint8_t *p = (const uint8_t *) str;
61
-  for(;;) {
61
+  for (;;) {
62 62
     const uint8_t val = *p++; n--;
63 63
     if (!val || n == 0) break;
64 64
     width += val < 128 ? char_widths[val] : 0;
@@ -69,7 +69,7 @@ uint16_t CLCD::FontMetrics::get_text_width(const char *str, size_t n) const {
69 69
 uint16_t CLCD::FontMetrics::get_text_width(progmem_str str, size_t n) const {
70 70
   uint16_t width = 0;
71 71
   const uint8_t *p = (const uint8_t *) str;
72
-  for(;;) {
72
+  for (;;) {
73 73
     const uint8_t val = pgm_read_byte(p++); n--;
74 74
     if (!val || n == 0) break;
75 75
     width += val < 128 ? char_widths[val] : 0;
@@ -79,7 +79,7 @@ uint16_t CLCD::FontMetrics::get_text_width(progmem_str str, size_t n) const {
79 79
 
80 80
 /************************** HOST COMMAND FUNCTION *********************************/
81 81
 
82
-void CLCD::host_cmd (unsigned char host_command, unsigned char byte2) {  // Sends 24-Bit Host Command to LCD
82
+void CLCD::host_cmd(unsigned char host_command, unsigned char byte2) {  // Sends 24-Bit Host Command to LCD
83 83
   if (host_command != FTDI::ACTIVE) {
84 84
     host_command |= 0x40;
85 85
   }
@@ -92,7 +92,7 @@ void CLCD::host_cmd (unsigned char host_command, unsigned char byte2) {  // Send
92 92
 
93 93
 /************************** MEMORY READ FUNCTIONS *********************************/
94 94
 
95
-void CLCD::spi_read_addr  (uint32_t reg_address) {
95
+void CLCD::spi_read_addr(uint32_t reg_address) {
96 96
   spi_send((reg_address >> 16) & 0x3F);  // Address [21:16]
97 97
   spi_send((reg_address >> 8 ) & 0xFF);  // Address [15:8]
98 98
   spi_send((reg_address >> 0)  & 0xFF);  // Address [7:0]
@@ -100,7 +100,7 @@ void CLCD::spi_read_addr  (uint32_t reg_address) {
100 100
 }
101 101
 
102 102
 // Write 4-Byte Address, Read Multiple Bytes
103
-void CLCD::mem_read_bulk (uint32_t reg_address, uint8_t *data, uint16_t len) {
103
+void CLCD::mem_read_bulk(uint32_t reg_address, uint8_t *data, uint16_t len) {
104 104
   spi_ftdi_select();
105 105
   spi_read_addr(reg_address);
106 106
   spi_read_bulk (data, len);
@@ -108,7 +108,7 @@ void CLCD::mem_read_bulk (uint32_t reg_address, uint8_t *data, uint16_t len) {
108 108
 }
109 109
 
110 110
 // Write 4-Byte Address, Read 1-Byte Data
111
-uint8_t CLCD::mem_read_8 (uint32_t reg_address) {
111
+uint8_t CLCD::mem_read_8(uint32_t reg_address) {
112 112
   spi_ftdi_select();
113 113
   spi_read_addr(reg_address);
114 114
   uint8_t r_data = spi_read_8();
@@ -117,7 +117,7 @@ uint8_t CLCD::mem_read_8 (uint32_t reg_address) {
117 117
 }
118 118
 
119 119
 // Write 4-Byte Address, Read 2-Bytes Data
120
-uint16_t CLCD::mem_read_16 (uint32_t reg_address) {
120
+uint16_t CLCD::mem_read_16(uint32_t reg_address) {
121 121
   using namespace SPI::least_significant_byte_first;
122 122
   spi_ftdi_select();
123 123
   spi_read_addr(reg_address);
@@ -127,7 +127,7 @@ uint16_t CLCD::mem_read_16 (uint32_t reg_address) {
127 127
 }
128 128
 
129 129
 // Write 4-Byte Address, Read 4-Bytes Data
130
-uint32_t CLCD::mem_read_32 (uint32_t reg_address) {
130
+uint32_t CLCD::mem_read_32(uint32_t reg_address) {
131 131
   using namespace SPI::least_significant_byte_first;
132 132
   spi_ftdi_select();
133 133
   spi_read_addr(reg_address);
@@ -147,14 +147,14 @@ static inline uint8_t reverse_byte(uint8_t a) {
147 147
 }
148 148
 static inline uint8_t xbm_write(const uint8_t *p) {return reverse_byte(pgm_read_byte(p));}
149 149
 
150
-void CLCD::spi_write_addr (uint32_t reg_address) {
150
+void CLCD::spi_write_addr(uint32_t reg_address) {
151 151
   spi_send((reg_address >> 16) | 0x80);  // Address [21:16]
152 152
   spi_send((reg_address >> 8 ) & 0xFF);  // Address [15:8]
153 153
   spi_send((reg_address >> 0)  & 0xFF);  // Address [7:0]
154 154
 }
155 155
 
156 156
 // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from RAM
157
-void CLCD::mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) {
157
+void CLCD::mem_write_bulk(uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) {
158 158
   spi_ftdi_select();
159 159
   spi_write_addr(reg_address);
160 160
   spi_write_bulk<ram_write>(data, len, padding);
@@ -162,7 +162,7 @@ void CLCD::mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len,
162 162
 }
163 163
 
164 164
 // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM
165
-void CLCD::mem_write_bulk (uint32_t reg_address, progmem_str str, uint16_t len, uint8_t padding) {
165
+void CLCD::mem_write_bulk(uint32_t reg_address, progmem_str str, uint16_t len, uint8_t padding) {
166 166
   spi_ftdi_select();
167 167
   spi_write_addr(reg_address);
168 168
   spi_write_bulk<pgm_write>(str, len, padding);
@@ -170,7 +170,7 @@ void CLCD::mem_write_bulk (uint32_t reg_address, progmem_str str, uint16_t len,
170 170
 }
171 171
 
172 172
  // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM
173
-void CLCD::mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) {
173
+void CLCD::mem_write_pgm(uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) {
174 174
   spi_ftdi_select();
175 175
   spi_write_addr(reg_address);
176 176
   spi_write_bulk<pgm_write>(data, len, padding);
@@ -178,7 +178,7 @@ void CLCD::mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len,
178 178
 }
179 179
 
180 180
 // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images)
181
-void CLCD::mem_write_xbm (uint32_t reg_address, progmem_str data, uint16_t len, uint8_t padding) {
181
+void CLCD::mem_write_xbm(uint32_t reg_address, progmem_str data, uint16_t len, uint8_t padding) {
182 182
   spi_ftdi_select();
183 183
   spi_write_addr(reg_address);
184 184
   spi_write_bulk<xbm_write>(data, len, padding);
@@ -186,7 +186,7 @@ void CLCD::mem_write_xbm (uint32_t reg_address, progmem_str data, uint16_t len,
186 186
 }
187 187
 
188 188
 // Write 3-Byte Address, Write 1-Byte Data
189
-void CLCD::mem_write_8 (uint32_t reg_address, uint8_t data) {
189
+void CLCD::mem_write_8(uint32_t reg_address, uint8_t data) {
190 190
   spi_ftdi_select();
191 191
   spi_write_addr(reg_address);
192 192
   spi_write_8(data);
@@ -194,16 +194,16 @@ void CLCD::mem_write_8 (uint32_t reg_address, uint8_t data) {
194 194
 }
195 195
 
196 196
 // Write 3-Byte Address, Write 2-Bytes Data
197
-void CLCD::mem_write_16 (uint32_t reg_address, uint16_t data) {
197
+void CLCD::mem_write_16(uint32_t reg_address, uint16_t data) {
198 198
   using namespace SPI::least_significant_byte_first;
199 199
   spi_ftdi_select();
200 200
   spi_write_addr(reg_address);
201
-  spi_write_32(data);
201
+  spi_write_16(data);
202 202
   spi_ftdi_deselect();
203 203
 }
204 204
 
205 205
 // Write 3-Byte Address, Write 4-Bytes Data
206
-void CLCD::mem_write_32 (uint32_t reg_address, uint32_t data) {
206
+void CLCD::mem_write_32(uint32_t reg_address, uint32_t data) {
207 207
   using namespace SPI::least_significant_byte_first;
208 208
   spi_ftdi_select();
209 209
   spi_write_addr(reg_address);
@@ -281,7 +281,7 @@ void CLCD::CommandFifo::text(int16_t x, int16_t y, int16_t font,  uint16_t optio
281 281
 }
282 282
 
283 283
 // This sends the a toggle command to the command preprocessor, must be followed by str()
284
-void CLCD::CommandFifo::toggle (int16_t x, int16_t y, int16_t w, int16_t font, uint16_t options, bool state) {
284
+void CLCD::CommandFifo::toggle(int16_t x, int16_t y, int16_t w, int16_t font, uint16_t options, bool state) {
285 285
   struct {
286 286
     int32_t type = CMD_TOGGLE;
287 287
     int16_t x;
@@ -303,7 +303,7 @@ void CLCD::CommandFifo::toggle (int16_t x, int16_t y, int16_t w, int16_t font, u
303 303
 }
304 304
 
305 305
 // This sends the a keys command to the command preprocessor, must be followed by str()
306
-void CLCD::CommandFifo::keys (int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t options) {
306
+void CLCD::CommandFifo::keys(int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t options) {
307 307
   struct {
308 308
     int32_t type = CMD_KEYS;
309 309
     int16_t x;
@@ -324,7 +324,7 @@ void CLCD::CommandFifo::keys (int16_t x, int16_t y, int16_t w, int16_t h, int16_
324 324
   cmd( &cmd_data, sizeof(cmd_data) );
325 325
 }
326 326
 
327
-void CLCD::CommandFifo::clock (int16_t x, int16_t y, int16_t r, uint16_t options, int16_t h, int16_t m, int16_t s, int16_t ms)
327
+void CLCD::CommandFifo::clock(int16_t x, int16_t y, int16_t r, uint16_t options, int16_t h, int16_t m, int16_t s, int16_t ms)
328 328
 {
329 329
   struct {
330 330
     int32_t type = CMD_CLOCK;
@@ -350,7 +350,7 @@ void CLCD::CommandFifo::clock (int16_t x, int16_t y, int16_t r, uint16_t options
350 350
   cmd( &cmd_data, sizeof(cmd_data) );
351 351
 }
352 352
 
353
-void CLCD::CommandFifo::gauge (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range)
353
+void CLCD::CommandFifo::gauge(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range)
354 354
 {
355 355
   struct {
356 356
     int32_t  type = CMD_GAUGE;
@@ -376,7 +376,7 @@ void CLCD::CommandFifo::gauge (int16_t x, int16_t y, int16_t r, uint16_t options
376 376
   cmd( &cmd_data, sizeof(cmd_data) );
377 377
 }
378 378
 
379
-void CLCD::CommandFifo::dial (int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val)
379
+void CLCD::CommandFifo::dial(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val)
380 380
 {
381 381
   struct {
382 382
     int32_t  type = CMD_DIAL;
@@ -396,7 +396,7 @@ void CLCD::CommandFifo::dial (int16_t x, int16_t y, int16_t r, uint16_t options,
396 396
   cmd( &cmd_data, sizeof(cmd_data) );
397 397
 }
398 398
 
399
-void CLCD::CommandFifo::scrollbar (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range) {
399
+void CLCD::CommandFifo::scrollbar(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range) {
400 400
   struct {
401 401
     int32_t  type = CMD_SCROLLBAR;
402 402
     int16_t  x;
@@ -421,7 +421,7 @@ void CLCD::CommandFifo::scrollbar (int16_t x, int16_t y, int16_t w, int16_t h, u
421 421
   cmd( &cmd_data, sizeof(cmd_data) );
422 422
 }
423 423
 
424
-void CLCD::CommandFifo::progress (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options,  uint16_t val, uint16_t range) {
424
+void CLCD::CommandFifo::progress(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options,  uint16_t val, uint16_t range) {
425 425
   struct {
426 426
     int32_t  type = CMD_PROGRESS;
427 427
     int16_t  x;
@@ -444,7 +444,7 @@ void CLCD::CommandFifo::progress (int16_t x, int16_t y, int16_t w, int16_t h, ui
444 444
   cmd( &cmd_data, sizeof(cmd_data) );
445 445
 }
446 446
 
447
-void CLCD::CommandFifo::slider (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range) {
447
+void CLCD::CommandFifo::slider(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range) {
448 448
   struct {
449 449
     int32_t type = CMD_SLIDER;
450 450
     int16_t x;
@@ -467,7 +467,7 @@ void CLCD::CommandFifo::slider (int16_t x, int16_t y, int16_t w, int16_t h, uint
467 467
   cmd( &cmd_data, sizeof(cmd_data) );
468 468
 }
469 469
 
470
-void CLCD::CommandFifo::gradient (int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1) {
470
+void CLCD::CommandFifo::gradient(int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1) {
471 471
   struct {
472 472
     int32_t type = CMD_GRADIENT;
473 473
     int16_t x0;
@@ -488,7 +488,7 @@ void CLCD::CommandFifo::gradient (int16_t x0, int16_t y0, uint32_t rgb0, int16_t
488 488
   cmd( &cmd_data, sizeof(cmd_data) );
489 489
 }
490 490
 
491
-void CLCD::CommandFifo::number (int16_t x, int16_t y, int16_t font, uint16_t options, int32_t n) {
491
+void CLCD::CommandFifo::number(int16_t x, int16_t y, int16_t font, uint16_t options, int32_t n) {
492 492
   struct {
493 493
     int32_t  type = CMD_NUMBER;
494 494
     int16_t  x;
@@ -507,7 +507,7 @@ void CLCD::CommandFifo::number (int16_t x, int16_t y, int16_t font, uint16_t opt
507 507
   cmd( &cmd_data, sizeof(cmd_data) );
508 508
 }
509 509
 
510
-void CLCD::CommandFifo::memzero (uint32_t ptr, uint32_t size) {
510
+void CLCD::CommandFifo::memzero(uint32_t ptr, uint32_t size) {
511 511
   struct {
512 512
     uint32_t  type = CMD_MEMZERO;
513 513
     uint32_t  ptr;
@@ -520,7 +520,7 @@ void CLCD::CommandFifo::memzero (uint32_t ptr, uint32_t size) {
520 520
   cmd( &cmd_data, sizeof(cmd_data) );
521 521
 }
522 522
 
523
-void CLCD::CommandFifo::memset (uint32_t ptr, uint32_t val, uint32_t size) {
523
+void CLCD::CommandFifo::memset(uint32_t ptr, uint32_t val, uint32_t size) {
524 524
   struct {
525 525
     uint32_t  type = CMD_MEMSET;
526 526
     uint32_t  ptr;
@@ -535,7 +535,7 @@ void CLCD::CommandFifo::memset (uint32_t ptr, uint32_t val, uint32_t size) {
535 535
   cmd( &cmd_data, sizeof(cmd_data) );
536 536
 }
537 537
 
538
-void CLCD::CommandFifo::memcpy (uint32_t dst, uint32_t src, uint32_t size) {
538
+void CLCD::CommandFifo::memcpy(uint32_t dst, uint32_t src, uint32_t size) {
539 539
   struct {
540 540
     uint32_t  type = CMD_MEMCPY;
541 541
     uint32_t  dst;
@@ -550,7 +550,7 @@ void CLCD::CommandFifo::memcpy (uint32_t dst, uint32_t src, uint32_t size) {
550 550
   cmd( &cmd_data, sizeof(cmd_data) );
551 551
 }
552 552
 
553
-void CLCD::CommandFifo::memcrc (uint32_t ptr, uint32_t num, uint32_t result) {
553
+void CLCD::CommandFifo::memcrc(uint32_t ptr, uint32_t num, uint32_t result) {
554 554
   struct {
555 555
     uint32_t  type = CMD_MEMCRC;
556 556
     uint32_t  ptr;
@@ -565,7 +565,7 @@ void CLCD::CommandFifo::memcrc (uint32_t ptr, uint32_t num, uint32_t result) {
565 565
   cmd( &cmd_data, sizeof(cmd_data) );
566 566
 }
567 567
 
568
-void CLCD::CommandFifo::memwrite (uint32_t ptr, uint32_t value) {
568
+void CLCD::CommandFifo::memwrite(uint32_t ptr, uint32_t value) {
569 569
   struct {
570 570
     uint32_t  type = CMD_MEMWRITE;
571 571
     uint32_t  ptr;
@@ -580,7 +580,7 @@ void CLCD::CommandFifo::memwrite (uint32_t ptr, uint32_t value) {
580 580
   cmd( &cmd_data, sizeof(cmd_data) );
581 581
 }
582 582
 
583
-void CLCD::CommandFifo::append (uint32_t ptr, uint32_t size) {
583
+void CLCD::CommandFifo::append(uint32_t ptr, uint32_t size) {
584 584
   struct {
585 585
     uint32_t  type = CMD_APPEND;
586 586
     uint32_t  ptr;
@@ -593,7 +593,7 @@ void CLCD::CommandFifo::append (uint32_t ptr, uint32_t size) {
593 593
   cmd( &cmd_data, sizeof(cmd_data) );
594 594
 }
595 595
 
596
-void CLCD::CommandFifo::inflate (uint32_t ptr) {
596
+void CLCD::CommandFifo::inflate(uint32_t ptr) {
597 597
   struct {
598 598
     uint32_t  type = CMD_INFLATE;
599 599
     uint32_t  ptr;
@@ -604,7 +604,7 @@ void CLCD::CommandFifo::inflate (uint32_t ptr) {
604 604
   cmd( &cmd_data, sizeof(cmd_data) );
605 605
 }
606 606
 
607
-void CLCD::CommandFifo::getptr (uint32_t result) {
607
+void CLCD::CommandFifo::getptr(uint32_t result) {
608 608
   struct {
609 609
     uint32_t  type = CMD_GETPTR;
610 610
     uint32_t  result;
@@ -696,7 +696,7 @@ void CLCD::CommandFifo::loadimage(uint32_t ptr, uint32_t options) {
696 696
   cmd( &cmd_data, sizeof(cmd_data) );
697 697
 }
698 698
 
699
-void CLCD::CommandFifo::getprops (uint32_t ptr, uint32_t width, uint32_t height) {
699
+void CLCD::CommandFifo::getprops(uint32_t ptr, uint32_t width, uint32_t height) {
700 700
   struct {
701 701
     uint32_t  type = CMD_GETPROPS;
702 702
     uint32_t  ptr;
@@ -735,7 +735,7 @@ void CLCD::CommandFifo::rotate(int32_t a) {
735 735
   cmd( &cmd_data, sizeof(cmd_data) );
736 736
 }
737 737
 
738
-void CLCD::CommandFifo::translate (int32_t tx, int32_t ty) {
738
+void CLCD::CommandFifo::translate(int32_t tx, int32_t ty) {
739 739
   struct {
740 740
     uint32_t type = CMD_TRANSLATE;
741 741
     int32_t  tx;
@@ -749,7 +749,7 @@ void CLCD::CommandFifo::translate (int32_t tx, int32_t ty) {
749 749
 }
750 750
 
751 751
 #if FTDI_API_LEVEL >= 810
752
-void CLCD::CommandFifo::setbase (uint8_t base) {
752
+void CLCD::CommandFifo::setbase(uint8_t base) {
753 753
   struct {
754 754
     int32_t  type = CMD_SETBASE;
755 755
     uint32_t base;
@@ -855,7 +855,7 @@ void CLCD::CommandFifo::playvideo(uint32_t options) {
855 855
 #endif
856 856
 
857 857
 #if FTDI_API_LEVEL >= 810
858
-void CLCD::CommandFifo::setrotate (uint8_t rotation) {
858
+void CLCD::CommandFifo::setrotate(uint8_t rotation) {
859 859
   struct {
860 860
     uint32_t  type = CMD_SETROTATE;
861 861
     uint32_t  rotation;
@@ -868,7 +868,7 @@ void CLCD::CommandFifo::setrotate (uint8_t rotation) {
868 868
 #endif
869 869
 
870 870
 #if FTDI_API_LEVEL >= 810
871
-void CLCD::CommandFifo::romfont (uint8_t font, uint8_t romslot) {
871
+void CLCD::CommandFifo::romfont(uint8_t font, uint8_t romslot) {
872 872
   struct {
873 873
     uint32_t  type = CMD_ROMFONT;
874 874
     uint32_t  font;
@@ -1054,18 +1054,12 @@ void CLCD::init() {
1054 1054
   spi_init();                                  // Set Up I/O Lines for SPI and FT800/810 Control
1055 1055
   ftdi_reset();                                // Power down/up the FT8xx with the apropriate delays
1056 1056
 
1057
-  if (Use_Crystal == 1) {
1058
-    host_cmd(CLKEXT, 0);
1059
-  }
1060
-  else {
1061
-    host_cmd(CLKINT, 0);
1062
-  }
1063
-
1057
+  host_cmd(Use_Crystal ? CLKEXT : CLKINT, 0);
1064 1058
   host_cmd(FTDI::ACTIVE, 0);                        // Activate the System Clock
1065 1059
 
1066 1060
   /* read the device-id until it returns 0x7c or times out, should take less than 150ms */
1067 1061
   uint8_t counter;
1068
-  for(counter = 0; counter < 250; counter++) {
1062
+  for (counter = 0; counter < 250; counter++) {
1069 1063
    uint8_t device_id = mem_read_8(REG::ID);            // Read Device ID, Should Be 0x7C;
1070 1064
    if (device_id == 0x7c) {
1071 1065
      #if ENABLED(TOUCH_UI_DEBUG)
@@ -1073,9 +1067,9 @@ void CLCD::init() {
1073 1067
      #endif
1074 1068
      break;
1075 1069
    }
1076
-   else {
1070
+   else
1077 1071
      delay(1);
1078
-   }
1072
+
1079 1073
    if (counter == 249) {
1080 1074
      #if ENABLED(TOUCH_UI_DEBUG)
1081 1075
        SERIAL_ECHO_START();
@@ -1130,7 +1124,7 @@ void CLCD::init() {
1130 1124
 
1131 1125
   mem_write_8(REG::PCLK, Pclk); // Turns on Clock by setting PCLK Register to the value necessary for the module
1132 1126
 
1133
-  mem_write_16(REG::PWM_HZ,  0x00FA);
1127
+  mem_write_16(REG::PWM_HZ, ENABLED(LCD_FYSETC_TFT81050) ? 0x2710 : 0x00FA);
1134 1128
 
1135 1129
   // Turning off dithering seems to help prevent horizontal line artifacts on certain colors
1136 1130
   mem_write_8(REG::DITHER,  0);

+ 17
- 17
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp Wyświetl plik

@@ -27,7 +27,11 @@
27 27
 /********************************* SPI Functions *********************************/
28 28
 
29 29
 namespace FTDI {
30
+
30 31
   #ifndef CLCD_USE_SOFT_SPI
32
+    #ifndef __AVR__
33
+      SPIClass EVE_SPI(CLCD_SPI_BUS);
34
+    #endif
31 35
     SPISettings SPI::spi_settings(SPI_FREQUENCY, MSBFIRST, SPI_MODE0);
32 36
   #endif
33 37
 
@@ -57,12 +61,12 @@ namespace FTDI {
57 61
 
58 62
       SET_INPUT_PULLUP(CLCD_SOFT_SPI_MISO);
59 63
     #else
60
-      ::SPI.begin();
64
+      SPI_OBJ.begin();
61 65
     #endif
62 66
   }
63 67
 
64 68
   #ifdef CLCD_USE_SOFT_SPI
65
-    uint8_t SPI::_soft_spi_xfer (uint8_t spiOutByte) {
69
+    uint8_t SPI::_soft_spi_xfer(uint8_t spiOutByte) {
66 70
       uint8_t spiIndex  = 0x80;
67 71
       uint8_t spiInByte = 0;
68 72
       uint8_t k;
@@ -71,8 +75,8 @@ namespace FTDI {
71 75
       for (k = 0; k < 8; k++) {  // Output and Read each bit of spiOutByte and spiInByte
72 76
         WRITE(CLCD_SOFT_SPI_MOSI, (spiOutByte & spiIndex) ? 1 : 0); // Output MOSI Bit
73 77
         WRITE(CLCD_SOFT_SPI_SCLK, 1);   // Pulse Clock
78
+        if (READ(CLCD_SOFT_SPI_MISO)) spiInByte |= spiIndex; // MISO changes on the falling edge of clock, so sample it before
74 79
         WRITE(CLCD_SOFT_SPI_SCLK, 0);
75
-        if (READ(CLCD_SOFT_SPI_MISO)) spiInByte |= spiIndex;
76 80
         spiIndex >>= 1;
77 81
       }
78 82
       interrupts();
@@ -81,7 +85,7 @@ namespace FTDI {
81 85
   #endif
82 86
 
83 87
   #ifdef CLCD_USE_SOFT_SPI
84
-    void SPI::_soft_spi_send (uint8_t spiOutByte) {
88
+    void SPI::_soft_spi_send(uint8_t spiOutByte) {
85 89
       uint8_t k, spiIndex  = 0x80;
86 90
 
87 91
       noInterrupts();
@@ -95,16 +99,12 @@ namespace FTDI {
95 99
     }
96 100
   #endif
97 101
 
98
-  void SPI::spi_read_bulk (void *data, uint16_t len) {
102
+  void SPI::spi_read_bulk(void *data, uint16_t len) {
99 103
     uint8_t* p = (uint8_t *)data;
100
-    #ifndef CLCD_USE_SOFT_SPI
101
-      ::SPI.transfer(p, len);
102
-    #else
103
-      while (len--) *p++ = spi_recv();
104
-    #endif
104
+    while (len--) *p++ = spi_recv();
105 105
   }
106 106
 
107
-  bool SPI::spi_verify_bulk (const void *data, uint16_t len) {
107
+  bool SPI::spi_verify_bulk(const void *data, uint16_t len) {
108 108
     const uint8_t* p = (const uint8_t *)data;
109 109
     while (len--) if (*p++ != spi_recv()) return false;
110 110
     return true;
@@ -113,7 +113,7 @@ namespace FTDI {
113 113
   // CLCD SPI - Chip Select
114 114
   void SPI::spi_ftdi_select() {
115 115
     #ifndef CLCD_USE_SOFT_SPI
116
-      ::SPI.beginTransaction(spi_settings);
116
+      SPI_OBJ.beginTransaction(spi_settings);
117 117
     #endif
118 118
     WRITE(CLCD_SPI_CS, 0);
119 119
     #ifdef CLCD_SPI_EXTRA_CS
@@ -129,25 +129,25 @@ namespace FTDI {
129 129
       WRITE(CLCD_SPI_EXTRA_CS, 1);
130 130
     #endif
131 131
     #ifndef CLCD_USE_SOFT_SPI
132
-      ::SPI.endTransaction();
132
+      SPI_OBJ.endTransaction();
133 133
     #endif
134 134
   }
135 135
 
136 136
   #ifdef SPI_FLASH_SS
137 137
   // Serial SPI Flash SPI - Chip Select
138
-  void SPI::spi_flash_select () {
138
+  void SPI::spi_flash_select() {
139 139
     #ifndef CLCD_USE_SOFT_SPI
140
-    ::SPI.beginTransaction(spi_settings);
140
+      SPI_OBJ.beginTransaction(spi_settings);
141 141
     #endif
142 142
     WRITE(SPI_FLASH_SS, 0);
143 143
     delayMicroseconds(1);
144 144
   }
145 145
 
146 146
   // Serial SPI Flash SPI - Chip Deselect
147
-  void SPI::spi_flash_deselect () {
147
+  void SPI::spi_flash_deselect() {
148 148
     WRITE(SPI_FLASH_SS, 1);
149 149
     #ifndef CLCD_USE_SOFT_SPI
150
-    ::SPI.endTransaction();
150
+      SPI_OBJ.endTransaction();
151 151
     #endif
152 152
   }
153 153
   #endif

+ 10
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h Wyświetl plik

@@ -27,6 +27,14 @@
27 27
 #endif
28 28
 
29 29
 namespace FTDI {
30
+
31
+  #if defined(__AVR__) || defined(CLCD_USE_SOFT_SPI)
32
+    #define SPI_OBJ ::SPI
33
+  #else
34
+    extern SPIClass EVE_SPI;
35
+    #define SPI_OBJ EVE_SPI
36
+  #endif
37
+
30 38
   namespace SPI {
31 39
     #ifndef CLCD_USE_SOFT_SPI
32 40
       extern SPISettings spi_settings;
@@ -47,7 +55,7 @@ namespace FTDI {
47 55
       #ifdef CLCD_USE_SOFT_SPI
48 56
         return _soft_spi_xfer(0x00);
49 57
       #else
50
-        return ::SPI.transfer(0x00);
58
+        SPI_OBJ.transfer(0x00);
51 59
       #endif
52 60
     };
53 61
 
@@ -55,7 +63,7 @@ namespace FTDI {
55 63
       #ifdef CLCD_USE_SOFT_SPI
56 64
         _soft_spi_send(val);
57 65
       #else
58
-        ::SPI.transfer(val);
66
+        SPI_OBJ.transfer(val);
59 67
       #endif
60 68
     };
61 69
 

+ 2
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h Wyświetl plik

@@ -30,9 +30,9 @@ class SoundList {
30 30
   public:
31 31
     static const uint8_t n;
32 32
     static inline const char* name(uint8_t val) {
33
-      return (const char* ) pgm_read_ptr_near(&list[val].name);
33
+      return (const char* ) pgm_read_ptr_far(&list[val].name);
34 34
     }
35 35
     static inline FTDI::SoundPlayer::sound_t* data(uint8_t val) {
36
-      return (FTDI::SoundPlayer::sound_t*) pgm_read_ptr_near(&list[val].data);
36
+      return (FTDI::SoundPlayer::sound_t*) pgm_read_ptr_far(&list[val].data);
37 37
     }
38 38
 };

+ 9
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/pin_mappings.h Wyświetl plik

@@ -154,3 +154,12 @@
154 154
     #define CLCD_SPI_EXTRA_CS            SDSS
155 155
   #endif
156 156
 #endif
157
+
158
+#if EITHER(E3_EXP1_PINMAP, GENERIC_EXP2_PINMAP)
159
+  #ifndef __MARLIN_FIRMWARE__
160
+    #error "This pin mapping requires Marlin."
161
+  #endif
162
+
163
+  #define CLCD_MOD_RESET                 BTN_EN1
164
+  #define CLCD_SPI_CS                    LCD_PINS_RS
165
+#endif

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp Wyświetl plik

@@ -82,7 +82,7 @@ void AboutScreen::onRedraw(draw_mode_t) {
82 82
   );
83 83
   draw_text_box(cmd, FW_VERS_POS, progmem_str(getFirmwareName_str()), OPT_CENTER, font_medium);
84 84
   draw_text_box(cmd, FW_INFO_POS, about_str, OPT_CENTER, font_medium);
85
-  draw_text_box(cmd, INSET_POS(LICENSE_POS), GET_TEXT_F(MSG_LICENSE), OPT_CENTER, font_tiny);
85
+  draw_text_box(cmd.tag(3), INSET_POS(LICENSE_POS), GET_TEXT_F(MSG_LICENSE), OPT_CENTER, font_tiny);
86 86
 
87 87
   cmd.font(font_medium)
88 88
      .colors(normal_btn)

+ 4
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp Wyświetl plik

@@ -74,7 +74,9 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) {
74 74
     #define EDGE_R 30
75 75
        .font(font_small)
76 76
        .tag(0)
77
+    #if DISABLED(LCD_FYSETC_TFT81050)
77 78
        .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_LCD_BRIGHTNESS), OPT_RIGHTX | OPT_CENTERY)
79
+    #endif
78 80
        .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_SOUND_VOLUME),   OPT_RIGHTX | OPT_CENTERY)
79 81
        .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_SCREEN_LOCK),    OPT_RIGHTX | OPT_CENTERY);
80 82
     #if DISABLED(TOUCH_UI_NO_BOOTSCREEN)
@@ -93,7 +95,9 @@ void InterfaceSettingsScreen::onRedraw(draw_mode_t what) {
93 95
     cmd.font(font_medium)
94 96
     #define EDGE_R 30
95 97
        .colors(ui_slider)
98
+    #if DISABLED(LCD_FYSETC_TFT81050)
96 99
        .tag(2).slider(BTN_POS(3,2), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.brightness, 128)
100
+    #endif
97 101
        .tag(3).slider(BTN_POS(3,3), BTN_SIZE(2,1), screen_data.InterfaceSettingsScreen.volume,     0xFF)
98 102
        .colors(ui_toggle)
99 103
        .tag(4).toggle2(BTN_POS(3,4), BTN_SIZE(w,1), GET_TEXT_F(MSG_NO), GET_TEXT_F(MSG_YES), LockScreen::is_enabled())

+ 44
- 0
Marlin/src/pins/ramps/pins_RAMPS.h Wyświetl plik

@@ -721,3 +721,47 @@
721 721
     #define BTN_ENC                           63
722 722
   #endif
723 723
 #endif
724
+
725
+#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
726
+
727
+  #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_RAMPS.h' for details. Comment out this line to continue."
728
+
729
+  /** FYSECT TFT TFT81050 display pinout
730
+   *
731
+   *               Board                                     Display
732
+   *               _____                                     _____
733
+   *  (SCK)   D52 | 1 2 | D50    (MISO)                MISO | 1 2 | SCK
734
+   *  (SD_CS) D53 | 3 4 | D33 (BNT_EN2) (BNT_EN2) MOD_RESET | 3 4 | SD_CS
735
+   *  (MOSI)  D51 | 5 6   D31 (BNT_EN1) (BNT_EN1)    LCD_CS | 5 6   MOSI
736
+   *        RESET | 7 8 | D49  (SD_DET)              SD_DET | 7 8 | RESET
737
+   *           NC | 9 10| GND                           GND | 9 10| 5V
738
+   *               -----                                     -----
739
+   *                EXP2                                      EXP1
740
+   *
741
+   * Needs custom cable:
742
+   *
743
+   *    Board   Adapter   Display
744
+   *           _________
745
+   *   EXP2-1 ----------- EXP1-10
746
+   *   EXP2-2 ----------- EXP1-9
747
+   *   EXP2-4 ----------- EXP1-8
748
+   *   EXP2-4 ----------- EXP1-7
749
+   *   EXP2-3 ----------- EXP1-6
750
+   *   EXP2-6 ----------- EXP1-5
751
+   *   EXP2-7 ----------- EXP1-4
752
+   *   EXP2-8 ----------- EXP1-3
753
+   *   EXP2-1 ----------- EXP1-2
754
+   *  EXT1-10 ----------- EXP1-1
755
+   *
756
+   */
757
+
758
+  #define BEEPER_PIN                          37
759
+
760
+  #define BTN_EN1                             31
761
+  #define LCD_PINS_RS                         33
762
+
763
+  #define SD_DETECT_PIN                       49
764
+
765
+  #define KILL_PIN                            -1
766
+
767
+#endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050

+ 84
- 15
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h Wyświetl plik

@@ -47,20 +47,20 @@
47 47
 //
48 48
 // Limit Switches
49 49
 //
50
-#define X_STOP_PIN                          PC1   // X-STOP
51
-#define Y_STOP_PIN                          PC0   // Y-STOP
52
-#define Z_STOP_PIN                          PC15  // Z-STOP
50
+#define X_STOP_PIN                          PC1   // "X-STOP"
51
+#define Y_STOP_PIN                          PC0   // "Y-STOP"
52
+#define Z_STOP_PIN                          PC15  // "Z-STOP"
53 53
 
54 54
 //
55 55
 // Z Probe must be this pin
56 56
 //
57
-#define Z_MIN_PROBE_PIN                     PC14  // PROBE
57
+#define Z_MIN_PROBE_PIN                     PC14  // "PROBE"
58 58
 
59 59
 //
60 60
 // Filament Runout Sensor
61 61
 //
62 62
 #ifndef FIL_RUNOUT_PIN
63
-  #define FIL_RUNOUT_PIN                    PC2   // E0-STOP
63
+  #define FIL_RUNOUT_PIN                    PC2   // "E0-STOP"
64 64
 #endif
65 65
 
66 66
 //
@@ -149,9 +149,9 @@
149 149
 //
150 150
 // Heaters / Fans
151 151
 //
152
-#define HEATER_0_PIN                        PC8   // HE
153
-#define HEATER_BED_PIN                      PC9   // HB
154
-#define FAN_PIN                             PA8   // FAN0
152
+#define HEATER_0_PIN                        PC8   // "HE"
153
+#define HEATER_BED_PIN                      PC9   // "HB"
154
+#define FAN_PIN                             PA8   // "FAN0"
155 155
 
156 156
 //
157 157
 // USB connect control
@@ -159,8 +159,6 @@
159 159
 #define USB_CONNECT_PIN                     PC13
160 160
 #define USB_CONNECT_INVERTING false
161 161
 
162
-#define SD_DETECT_PIN                       PC4
163
-
164 162
 /**
165 163
  *                 _____
166 164
  *             5V | 1 2 | GND
@@ -182,18 +180,31 @@
182 180
 #define EXPA1_10_PIN                        PA15
183 181
 
184 182
 #if HAS_SPI_LCD
185
-  #define BTN_ENC                   EXPA1_09_PIN
186
-  #define BTN_EN1                   EXPA1_08_PIN
187
-  #define BTN_EN2                   EXPA1_06_PIN
188 183
 
189 184
   #if ENABLED(CR10_STOCKDISPLAY)
190 185
 
191 186
     #define BEEPER_PIN              EXPA1_10_PIN
192 187
 
188
+    #define BTN_ENC                 EXPA1_09_PIN
189
+    #define BTN_EN1                 EXPA1_08_PIN
190
+    #define BTN_EN2                 EXPA1_06_PIN
191
+
193 192
     #define LCD_PINS_RS             EXPA1_04_PIN
194 193
     #define LCD_PINS_ENABLE         EXPA1_03_PIN
195 194
     #define LCD_PINS_D4             EXPA1_05_PIN
196 195
 
196
+  #elif ENABLED(ZONESTAR_LCD)                     // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
197
+
198
+    #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3.h' for details. Comment out this line to continue."
199
+
200
+    #define LCD_PINS_RS             EXPA1_05_PIN
201
+    #define LCD_PINS_ENABLE         EXPA1_09_PIN
202
+    #define LCD_PINS_D4             EXPA1_04_PIN
203
+    #define LCD_PINS_D5             EXPA1_06_PIN
204
+    #define LCD_PINS_D6             EXPA1_08_PIN
205
+    #define LCD_PINS_D7             EXPA1_10_PIN
206
+    #define ADC_KEYPAD_PIN                  PA1   // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
207
+
197 208
   #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
198 209
 
199 210
     /** Creality Ender-2 display pinout
@@ -207,6 +218,10 @@
207 218
      *                    EXP1
208 219
      */
209 220
 
221
+    #define BTN_ENC                 EXPA1_09_PIN
222
+    #define BTN_EN1                 EXPA1_08_PIN
223
+    #define BTN_EN2                 EXPA1_06_PIN
224
+
210 225
     #define DOGLCD_CS               EXPA1_04_PIN
211 226
     #define DOGLCD_A0               EXPA1_05_PIN
212 227
     #define DOGLCD_SCK              EXPA1_10_PIN
@@ -215,17 +230,71 @@
215 230
     #define LCD_BACKLIGHT_PIN               -1
216 231
 
217 232
   #else
218
-    #error "Only CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY, and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_E3_DIP."
233
+    #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_E3_DIP."
219 234
   #endif
220 235
 
221 236
 #endif // HAS_SPI_LCD
222 237
 
238
+#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
239
+
240
+  #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_E3_DIP.h' for details. Comment out this line to continue."
241
+
242
+  /** FYSECT TFT TFT81050 display pinout
243
+   *
244
+   *               Board                                     Display
245
+   *               _____                                      _____
246
+   *           5V | 1 2 | GND               (SPI1-MISO) MISO | 1 2 | SCK   (SPI1-SCK)
247
+   * (FREE)   PB7 | 3 4 | PB8  (LCD_CS)     (PA9)  MOD_RESET | 3 4 | SD_CS (PA10)
248
+   * (FREE)   PB9 | 5 6   PA10 (SD_CS)      (PB8)     LCD_CS | 5 6   MOSI  (SPI1-MOSI)
249
+   *        RESET | 7 8 | PA9  (MOD_RESET)  (PA15)    SD_DET | 7 8 | RESET
250
+   * (BEEPER) PB6 | 9 10| PA15 (SD_DET)                  GND | 9 10| 5V
251
+   *               -----                                      -----
252
+   *                EXP1                                       EXP1
253
+   *
254
+   * Needs custom cable:
255
+   *
256
+   *    Board   Adapter   Display
257
+   *           _________
258
+   *   EXP1-1 ----------- EXP1-10
259
+   *   EXP1-2 ----------- EXP1-9
260
+   *   SPI1-4 ----------- EXP1-6
261
+   *   EXP1-4 ----------- EXP1-5
262
+   *   SP11-3 ----------- EXP1-2
263
+   *   EXP1-6 ----------- EXP1-4
264
+   *   EXP1-7 ----------- EXP1-8
265
+   *   EXP1-8 ----------- EXP1-3
266
+   *   SPI1-1 ----------- EXP1-1
267
+   *  EXT1-10 ----------- EXP1-4
268
+   *
269
+   */
270
+
271
+  #define CLCD_SPI_BUS 1                          // SPI1 connector
272
+
273
+  #define BEEPER_PIN                EXPA1_09_PIN
274
+
275
+  #define BTN_EN1                   EXPA1_08_PIN
276
+  #define LCD_PINS_RS               EXPA1_04_PIN
277
+
278
+#endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050
279
+
223 280
 //
224 281
 // SD Support
225 282
 //
283
+
226 284
 #ifndef SDCARD_CONNECTION
227 285
   #define SDCARD_CONNECTION              ONBOARD
228 286
 #endif
229 287
 
230
-#define ON_BOARD_SPI_DEVICE 1                     //SPI1
288
+#if SD_CONNECTION_IS(ONBOARD)
289
+  #define SD_DETECT_PIN                     PC4
290
+#endif
291
+
292
+#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) && SD_CONNECTION_IS(LCD)
293
+  #define SD_DETECT_PIN             EXPA1_10_PIN
294
+  #define SS_PIN                    EXPA1_06_PIN
295
+#elif SD_CONNECTION_IS(CUSTOM_CABLE)
296
+  #error "SD CUSTOM_CABLE is not compatible with SKR E3 DIP."
297
+#endif
298
+
299
+#define ON_BOARD_SPI_DEVICE 1                     // SPI1
231 300
 #define ONBOARD_SD_CS_PIN                   PA4   // Chip select for "System" SD card

+ 71
- 18
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h Wyświetl plik

@@ -40,19 +40,19 @@
40 40
 //
41 41
 // Servos
42 42
 //
43
-#define SERVO0_PIN                          PA1
43
+#define SERVO0_PIN                          PA1   // "SERVOS"
44 44
 
45 45
 //
46 46
 // Limit Switches
47 47
 //
48
-#define X_STOP_PIN                          PC0
49
-#define Y_STOP_PIN                          PC1
50
-#define Z_STOP_PIN                          PC2
48
+#define X_STOP_PIN                          PC0   // "X-STOP"
49
+#define Y_STOP_PIN                          PC1   // "Y-STOP"
50
+#define Z_STOP_PIN                          PC2   // "Z-STOP"
51 51
 
52 52
 //
53
-// Z Probe must be this pins
53
+// Z Probe must be this pin
54 54
 //
55
-#define Z_MIN_PROBE_PIN                     PC14
55
+#define Z_MIN_PROBE_PIN                     PC14  // "PROBE"
56 56
 
57 57
 //
58 58
 // Filament Runout Sensor
@@ -83,15 +83,15 @@
83 83
 //
84 84
 // Temperature Sensors
85 85
 //
86
-#define TEMP_0_PIN                          PA0   // Analog Input
87
-#define TEMP_BED_PIN                        PC3   // Analog Input
86
+#define TEMP_0_PIN                          PA0   // Analog Input "TH0"
87
+#define TEMP_BED_PIN                        PC3   // Analog Input "TB0"
88 88
 
89 89
 //
90 90
 // Heaters / Fans
91 91
 //
92
-#define HEATER_0_PIN                        PC8   // EXTRUDER
93
-#define HEATER_BED_PIN                      PC9   // BED
94
-#define FAN_PIN                             PA8
92
+#define HEATER_0_PIN                        PC8   // "HE"
93
+#define HEATER_BED_PIN                      PC9   // "HB"
94
+#define FAN_PIN                             PA8   // "FAN0"
95 95
 
96 96
 //
97 97
 // USB connect control
@@ -99,8 +99,6 @@
99 99
 #define USB_CONNECT_PIN                     PC13
100 100
 #define USB_CONNECT_INVERTING false
101 101
 
102
-#define SD_DETECT_PIN                       PC4
103
-
104 102
 /**
105 103
  *                 _____
106 104
  *             5V | 1 2 | GND
@@ -127,9 +125,9 @@
127 125
 
128 126
     #define BEEPER_PIN              EXPA1_10_PIN
129 127
 
128
+    #define BTN_ENC                 EXPA1_09_PIN
130 129
     #define BTN_EN1                 EXPA1_08_PIN
131 130
     #define BTN_EN2                 EXPA1_06_PIN
132
-    #define BTN_ENC                 EXPA1_09_PIN
133 131
 
134 132
     #define LCD_PINS_RS             EXPA1_04_PIN
135 133
     #define LCD_PINS_ENABLE         EXPA1_03_PIN
@@ -159,9 +157,10 @@
159 157
      *                   -----
160 158
      *                    EXP1
161 159
      */
160
+
161
+    #define BTN_ENC                 EXPA1_09_PIN
162 162
     #define BTN_EN1                 EXPA1_08_PIN
163 163
     #define BTN_EN2                 EXPA1_06_PIN
164
-    #define BTN_ENC                 EXPA1_09_PIN
165 164
 
166 165
     #define DOGLCD_CS               EXPA1_04_PIN
167 166
     #define DOGLCD_A0               EXPA1_05_PIN
@@ -171,19 +170,73 @@
171 170
     #define LCD_BACKLIGHT_PIN               -1
172 171
 
173 172
   #else
174
-
175
-    #error "Only ZONESTAR_LCD, MKS_MINI_12864, ENDER2_STOCKDISPLAY, and CR10_STOCKDISPLAY are currently supported on the BIGTREE_SKR_MINI_E3."
176
-
173
+    #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_MINI_E3."
177 174
   #endif
178 175
 
179 176
 #endif // HAS_SPI_LCD
180 177
 
178
+#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
179
+
180
+  #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3.h' for details. Comment out this line to continue."
181
+
182
+  /** FYSECT TFT TFT81050 display pinout
183
+   *
184
+   *               Board                                      Display
185
+   *               _____                                       _____
186
+   *           5V | 1 2 | GND                (SPI1-MISO) MISO | 1 2 | SCK   (SPI1-SCK)
187
+   * (FREE)   PB7 | 3 4 | PB8  (LCD_CS)      (PA9)  MOD_RESET | 3 4 | SD_CS (PA10)
188
+   * (FREE)   PB9 | 5 6   PA10 (SD_CS)       (PB8)     LCD_CS | 5 6   MOSI  (SPI1-MOSI)
189
+   *        RESET | 7 8 | PA9  (MOD_RESET)   (PB5)     SD_DET | 7 8 | RESET
190
+   * (BEEPER) PB6 | 9 10| PB5  (SD_DET)                   GND | 9 10| 5V
191
+   *               -----                                       -----
192
+   *                EXP1                                        EXP1
193
+   *
194
+   * Needs custom cable:
195
+   *
196
+   *    Board   Adapter   Display
197
+   *           _________
198
+   *   EXP1-1 ----------- EXP1-10
199
+   *   EXP1-2 ----------- EXP1-9
200
+   *   SPI1-4 ----------- EXP1-6
201
+   *   EXP1-4 ----------- EXP1-5
202
+   *   SPI1-3 ----------- EXP1-2
203
+   *   EXP1-6 ----------- EXP1-4
204
+   *   EXP1-7 ----------- EXP1-8
205
+   *   EXP1-8 ----------- EXP1-3
206
+   *   SPI1-1 ----------- EXP1-1
207
+   *  EXP1-10 ----------- EXP1-4
208
+   *
209
+   */
210
+
211
+  #define CLCD_SPI_BUS 1                          // SPI1 connector
212
+
213
+  #define BEEPER_PIN                EXPA1_09_PIN
214
+
215
+  #define BTN_EN1                   EXPA1_08_PIN
216
+  #define LCD_PINS_RS               EXPA1_04_PIN
217
+  #define LCD_PINS_ENABLE           EXPA1_03_PIN
218
+  #define LCD_PINS_D4               EXPA1_05_PIN
219
+
220
+#endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050
221
+
181 222
 //
182 223
 // SD Support
183 224
 //
225
+
184 226
 #ifndef SDCARD_CONNECTION
185 227
   #define SDCARD_CONNECTION              ONBOARD
186 228
 #endif
187 229
 
230
+#if SD_CONNECTION_IS(ONBOARD)
231
+  #define SD_DETECT_PIN                     PC4
232
+#endif
233
+
234
+#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) && SD_CONNECTION_IS(LCD)
235
+  #define SD_DETECT_PIN             EXPA1_10_PIN
236
+  #define SS_PIN                    EXPA1_06_PIN
237
+#elif SD_CONNECTION_IS(CUSTOM_CABLE)
238
+  #error "SD CUSTOM_CABLE is not compatible with SKR Mini E3."
239
+#endif
240
+
188 241
 #define ON_BOARD_SPI_DEVICE 1                     // SPI1
189 242
 #define ONBOARD_SD_CS_PIN                   PA4   // Chip select for "System" SD card

Ładowanie…
Anuluj
Zapisz