Bladeren bron

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 5 jaren geleden
bovenliggende
commit
3a27933ae7
No account linked to committer's email address

+ 6
- 4
Marlin/Configuration_adv.h Bestand weergeven

1375
   //#define TOUCH_UI_800x480
1375
   //#define TOUCH_UI_800x480
1376
 
1376
 
1377
   // Mappings for boards with a standard RepRapDiscount Display connector
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
   //#define OTHER_PIN_LAYOUT  // Define pins manually below
1385
   //#define OTHER_PIN_LAYOUT  // Define pins manually below
1384
   #if ENABLED(OTHER_PIN_LAYOUT)
1386
   #if ENABLED(OTHER_PIN_LAYOUT)

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h Bestand weergeven

361
   #define HAS_DGUS_LCD 1
361
   #define HAS_DGUS_LCD 1
362
 #endif
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
 #if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE)
365
 #if ANY(HAS_DGUS_LCD, MALYAN_LCD, TOUCH_UI_FTDI_EVE)
366
   #define IS_EXTUI
366
   #define IS_EXTUI
367
   #define EXTENSIBLE_UI
367
   #define EXTENSIBLE_UI

+ 45
- 51
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp Bestand weergeven

58
 uint16_t CLCD::FontMetrics::get_text_width(const char *str, size_t n) const {
58
 uint16_t CLCD::FontMetrics::get_text_width(const char *str, size_t n) const {
59
   uint16_t width = 0;
59
   uint16_t width = 0;
60
   const uint8_t *p = (const uint8_t *) str;
60
   const uint8_t *p = (const uint8_t *) str;
61
-  for(;;) {
61
+  for (;;) {
62
     const uint8_t val = *p++; n--;
62
     const uint8_t val = *p++; n--;
63
     if (!val || n == 0) break;
63
     if (!val || n == 0) break;
64
     width += val < 128 ? char_widths[val] : 0;
64
     width += val < 128 ? char_widths[val] : 0;
69
 uint16_t CLCD::FontMetrics::get_text_width(progmem_str str, size_t n) const {
69
 uint16_t CLCD::FontMetrics::get_text_width(progmem_str str, size_t n) const {
70
   uint16_t width = 0;
70
   uint16_t width = 0;
71
   const uint8_t *p = (const uint8_t *) str;
71
   const uint8_t *p = (const uint8_t *) str;
72
-  for(;;) {
72
+  for (;;) {
73
     const uint8_t val = pgm_read_byte(p++); n--;
73
     const uint8_t val = pgm_read_byte(p++); n--;
74
     if (!val || n == 0) break;
74
     if (!val || n == 0) break;
75
     width += val < 128 ? char_widths[val] : 0;
75
     width += val < 128 ? char_widths[val] : 0;
79
 
79
 
80
 /************************** HOST COMMAND FUNCTION *********************************/
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
   if (host_command != FTDI::ACTIVE) {
83
   if (host_command != FTDI::ACTIVE) {
84
     host_command |= 0x40;
84
     host_command |= 0x40;
85
   }
85
   }
92
 
92
 
93
 /************************** MEMORY READ FUNCTIONS *********************************/
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
   spi_send((reg_address >> 16) & 0x3F);  // Address [21:16]
96
   spi_send((reg_address >> 16) & 0x3F);  // Address [21:16]
97
   spi_send((reg_address >> 8 ) & 0xFF);  // Address [15:8]
97
   spi_send((reg_address >> 8 ) & 0xFF);  // Address [15:8]
98
   spi_send((reg_address >> 0)  & 0xFF);  // Address [7:0]
98
   spi_send((reg_address >> 0)  & 0xFF);  // Address [7:0]
100
 }
100
 }
101
 
101
 
102
 // Write 4-Byte Address, Read Multiple Bytes
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
   spi_ftdi_select();
104
   spi_ftdi_select();
105
   spi_read_addr(reg_address);
105
   spi_read_addr(reg_address);
106
   spi_read_bulk (data, len);
106
   spi_read_bulk (data, len);
108
 }
108
 }
109
 
109
 
110
 // Write 4-Byte Address, Read 1-Byte Data
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
   spi_ftdi_select();
112
   spi_ftdi_select();
113
   spi_read_addr(reg_address);
113
   spi_read_addr(reg_address);
114
   uint8_t r_data = spi_read_8();
114
   uint8_t r_data = spi_read_8();
117
 }
117
 }
118
 
118
 
119
 // Write 4-Byte Address, Read 2-Bytes Data
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
   using namespace SPI::least_significant_byte_first;
121
   using namespace SPI::least_significant_byte_first;
122
   spi_ftdi_select();
122
   spi_ftdi_select();
123
   spi_read_addr(reg_address);
123
   spi_read_addr(reg_address);
127
 }
127
 }
128
 
128
 
129
 // Write 4-Byte Address, Read 4-Bytes Data
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
   using namespace SPI::least_significant_byte_first;
131
   using namespace SPI::least_significant_byte_first;
132
   spi_ftdi_select();
132
   spi_ftdi_select();
133
   spi_read_addr(reg_address);
133
   spi_read_addr(reg_address);
147
 }
147
 }
148
 static inline uint8_t xbm_write(const uint8_t *p) {return reverse_byte(pgm_read_byte(p));}
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
   spi_send((reg_address >> 16) | 0x80);  // Address [21:16]
151
   spi_send((reg_address >> 16) | 0x80);  // Address [21:16]
152
   spi_send((reg_address >> 8 ) & 0xFF);  // Address [15:8]
152
   spi_send((reg_address >> 8 ) & 0xFF);  // Address [15:8]
153
   spi_send((reg_address >> 0)  & 0xFF);  // Address [7:0]
153
   spi_send((reg_address >> 0)  & 0xFF);  // Address [7:0]
154
 }
154
 }
155
 
155
 
156
 // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from RAM
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
   spi_ftdi_select();
158
   spi_ftdi_select();
159
   spi_write_addr(reg_address);
159
   spi_write_addr(reg_address);
160
   spi_write_bulk<ram_write>(data, len, padding);
160
   spi_write_bulk<ram_write>(data, len, padding);
162
 }
162
 }
163
 
163
 
164
 // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM
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
   spi_ftdi_select();
166
   spi_ftdi_select();
167
   spi_write_addr(reg_address);
167
   spi_write_addr(reg_address);
168
   spi_write_bulk<pgm_write>(str, len, padding);
168
   spi_write_bulk<pgm_write>(str, len, padding);
170
 }
170
 }
171
 
171
 
172
  // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM
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
   spi_ftdi_select();
174
   spi_ftdi_select();
175
   spi_write_addr(reg_address);
175
   spi_write_addr(reg_address);
176
   spi_write_bulk<pgm_write>(data, len, padding);
176
   spi_write_bulk<pgm_write>(data, len, padding);
178
 }
178
 }
179
 
179
 
180
 // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images)
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
   spi_ftdi_select();
182
   spi_ftdi_select();
183
   spi_write_addr(reg_address);
183
   spi_write_addr(reg_address);
184
   spi_write_bulk<xbm_write>(data, len, padding);
184
   spi_write_bulk<xbm_write>(data, len, padding);
186
 }
186
 }
187
 
187
 
188
 // Write 3-Byte Address, Write 1-Byte Data
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
   spi_ftdi_select();
190
   spi_ftdi_select();
191
   spi_write_addr(reg_address);
191
   spi_write_addr(reg_address);
192
   spi_write_8(data);
192
   spi_write_8(data);
194
 }
194
 }
195
 
195
 
196
 // Write 3-Byte Address, Write 2-Bytes Data
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
   using namespace SPI::least_significant_byte_first;
198
   using namespace SPI::least_significant_byte_first;
199
   spi_ftdi_select();
199
   spi_ftdi_select();
200
   spi_write_addr(reg_address);
200
   spi_write_addr(reg_address);
201
-  spi_write_32(data);
201
+  spi_write_16(data);
202
   spi_ftdi_deselect();
202
   spi_ftdi_deselect();
203
 }
203
 }
204
 
204
 
205
 // Write 3-Byte Address, Write 4-Bytes Data
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
   using namespace SPI::least_significant_byte_first;
207
   using namespace SPI::least_significant_byte_first;
208
   spi_ftdi_select();
208
   spi_ftdi_select();
209
   spi_write_addr(reg_address);
209
   spi_write_addr(reg_address);
281
 }
281
 }
282
 
282
 
283
 // This sends the a toggle command to the command preprocessor, must be followed by str()
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
   struct {
285
   struct {
286
     int32_t type = CMD_TOGGLE;
286
     int32_t type = CMD_TOGGLE;
287
     int16_t x;
287
     int16_t x;
303
 }
303
 }
304
 
304
 
305
 // This sends the a keys command to the command preprocessor, must be followed by str()
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
   struct {
307
   struct {
308
     int32_t type = CMD_KEYS;
308
     int32_t type = CMD_KEYS;
309
     int16_t x;
309
     int16_t x;
324
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
329
   struct {
330
     int32_t type = CMD_CLOCK;
330
     int32_t type = CMD_CLOCK;
350
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
355
   struct {
356
     int32_t  type = CMD_GAUGE;
356
     int32_t  type = CMD_GAUGE;
376
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
381
   struct {
382
     int32_t  type = CMD_DIAL;
382
     int32_t  type = CMD_DIAL;
396
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
400
   struct {
401
     int32_t  type = CMD_SCROLLBAR;
401
     int32_t  type = CMD_SCROLLBAR;
402
     int16_t  x;
402
     int16_t  x;
421
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
425
   struct {
426
     int32_t  type = CMD_PROGRESS;
426
     int32_t  type = CMD_PROGRESS;
427
     int16_t  x;
427
     int16_t  x;
444
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
448
   struct {
449
     int32_t type = CMD_SLIDER;
449
     int32_t type = CMD_SLIDER;
450
     int16_t x;
450
     int16_t x;
467
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
471
   struct {
472
     int32_t type = CMD_GRADIENT;
472
     int32_t type = CMD_GRADIENT;
473
     int16_t x0;
473
     int16_t x0;
488
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
492
   struct {
493
     int32_t  type = CMD_NUMBER;
493
     int32_t  type = CMD_NUMBER;
494
     int16_t  x;
494
     int16_t  x;
507
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
511
   struct {
512
     uint32_t  type = CMD_MEMZERO;
512
     uint32_t  type = CMD_MEMZERO;
513
     uint32_t  ptr;
513
     uint32_t  ptr;
520
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
524
   struct {
525
     uint32_t  type = CMD_MEMSET;
525
     uint32_t  type = CMD_MEMSET;
526
     uint32_t  ptr;
526
     uint32_t  ptr;
535
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
539
   struct {
540
     uint32_t  type = CMD_MEMCPY;
540
     uint32_t  type = CMD_MEMCPY;
541
     uint32_t  dst;
541
     uint32_t  dst;
550
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
554
   struct {
555
     uint32_t  type = CMD_MEMCRC;
555
     uint32_t  type = CMD_MEMCRC;
556
     uint32_t  ptr;
556
     uint32_t  ptr;
565
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
569
   struct {
570
     uint32_t  type = CMD_MEMWRITE;
570
     uint32_t  type = CMD_MEMWRITE;
571
     uint32_t  ptr;
571
     uint32_t  ptr;
580
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
584
   struct {
585
     uint32_t  type = CMD_APPEND;
585
     uint32_t  type = CMD_APPEND;
586
     uint32_t  ptr;
586
     uint32_t  ptr;
593
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
597
   struct {
598
     uint32_t  type = CMD_INFLATE;
598
     uint32_t  type = CMD_INFLATE;
599
     uint32_t  ptr;
599
     uint32_t  ptr;
604
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
608
   struct {
609
     uint32_t  type = CMD_GETPTR;
609
     uint32_t  type = CMD_GETPTR;
610
     uint32_t  result;
610
     uint32_t  result;
696
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
700
   struct {
701
     uint32_t  type = CMD_GETPROPS;
701
     uint32_t  type = CMD_GETPROPS;
702
     uint32_t  ptr;
702
     uint32_t  ptr;
735
   cmd( &cmd_data, sizeof(cmd_data) );
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
   struct {
739
   struct {
740
     uint32_t type = CMD_TRANSLATE;
740
     uint32_t type = CMD_TRANSLATE;
741
     int32_t  tx;
741
     int32_t  tx;
749
 }
749
 }
750
 
750
 
751
 #if FTDI_API_LEVEL >= 810
751
 #if FTDI_API_LEVEL >= 810
752
-void CLCD::CommandFifo::setbase (uint8_t base) {
752
+void CLCD::CommandFifo::setbase(uint8_t base) {
753
   struct {
753
   struct {
754
     int32_t  type = CMD_SETBASE;
754
     int32_t  type = CMD_SETBASE;
755
     uint32_t base;
755
     uint32_t base;
855
 #endif
855
 #endif
856
 
856
 
857
 #if FTDI_API_LEVEL >= 810
857
 #if FTDI_API_LEVEL >= 810
858
-void CLCD::CommandFifo::setrotate (uint8_t rotation) {
858
+void CLCD::CommandFifo::setrotate(uint8_t rotation) {
859
   struct {
859
   struct {
860
     uint32_t  type = CMD_SETROTATE;
860
     uint32_t  type = CMD_SETROTATE;
861
     uint32_t  rotation;
861
     uint32_t  rotation;
868
 #endif
868
 #endif
869
 
869
 
870
 #if FTDI_API_LEVEL >= 810
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
   struct {
872
   struct {
873
     uint32_t  type = CMD_ROMFONT;
873
     uint32_t  type = CMD_ROMFONT;
874
     uint32_t  font;
874
     uint32_t  font;
1054
   spi_init();                                  // Set Up I/O Lines for SPI and FT800/810 Control
1054
   spi_init();                                  // Set Up I/O Lines for SPI and FT800/810 Control
1055
   ftdi_reset();                                // Power down/up the FT8xx with the apropriate delays
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
   host_cmd(FTDI::ACTIVE, 0);                        // Activate the System Clock
1058
   host_cmd(FTDI::ACTIVE, 0);                        // Activate the System Clock
1065
 
1059
 
1066
   /* read the device-id until it returns 0x7c or times out, should take less than 150ms */
1060
   /* read the device-id until it returns 0x7c or times out, should take less than 150ms */
1067
   uint8_t counter;
1061
   uint8_t counter;
1068
-  for(counter = 0; counter < 250; counter++) {
1062
+  for (counter = 0; counter < 250; counter++) {
1069
    uint8_t device_id = mem_read_8(REG::ID);            // Read Device ID, Should Be 0x7C;
1063
    uint8_t device_id = mem_read_8(REG::ID);            // Read Device ID, Should Be 0x7C;
1070
    if (device_id == 0x7c) {
1064
    if (device_id == 0x7c) {
1071
      #if ENABLED(TOUCH_UI_DEBUG)
1065
      #if ENABLED(TOUCH_UI_DEBUG)
1073
      #endif
1067
      #endif
1074
      break;
1068
      break;
1075
    }
1069
    }
1076
-   else {
1070
+   else
1077
      delay(1);
1071
      delay(1);
1078
-   }
1072
+
1079
    if (counter == 249) {
1073
    if (counter == 249) {
1080
      #if ENABLED(TOUCH_UI_DEBUG)
1074
      #if ENABLED(TOUCH_UI_DEBUG)
1081
        SERIAL_ECHO_START();
1075
        SERIAL_ECHO_START();
1130
 
1124
 
1131
   mem_write_8(REG::PCLK, Pclk); // Turns on Clock by setting PCLK Register to the value necessary for the module
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
   // Turning off dithering seems to help prevent horizontal line artifacts on certain colors
1129
   // Turning off dithering seems to help prevent horizontal line artifacts on certain colors
1136
   mem_write_8(REG::DITHER,  0);
1130
   mem_write_8(REG::DITHER,  0);

+ 17
- 17
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.cpp Bestand weergeven

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

+ 10
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/spi.h Bestand weergeven

27
 #endif
27
 #endif
28
 
28
 
29
 namespace FTDI {
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
   namespace SPI {
38
   namespace SPI {
31
     #ifndef CLCD_USE_SOFT_SPI
39
     #ifndef CLCD_USE_SOFT_SPI
32
       extern SPISettings spi_settings;
40
       extern SPISettings spi_settings;
47
       #ifdef CLCD_USE_SOFT_SPI
55
       #ifdef CLCD_USE_SOFT_SPI
48
         return _soft_spi_xfer(0x00);
56
         return _soft_spi_xfer(0x00);
49
       #else
57
       #else
50
-        return ::SPI.transfer(0x00);
58
+        SPI_OBJ.transfer(0x00);
51
       #endif
59
       #endif
52
     };
60
     };
53
 
61
 
55
       #ifdef CLCD_USE_SOFT_SPI
63
       #ifdef CLCD_USE_SOFT_SPI
56
         _soft_spi_send(val);
64
         _soft_spi_send(val);
57
       #else
65
       #else
58
-        ::SPI.transfer(val);
66
+        SPI_OBJ.transfer(val);
59
       #endif
67
       #endif
60
     };
68
     };
61
 
69
 

+ 2
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h Bestand weergeven

30
   public:
30
   public:
31
     static const uint8_t n;
31
     static const uint8_t n;
32
     static inline const char* name(uint8_t val) {
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
     static inline FTDI::SoundPlayer::sound_t* data(uint8_t val) {
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 Bestand weergeven

154
     #define CLCD_SPI_EXTRA_CS            SDSS
154
     #define CLCD_SPI_EXTRA_CS            SDSS
155
   #endif
155
   #endif
156
 #endif
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 Bestand weergeven

82
   );
82
   );
83
   draw_text_box(cmd, FW_VERS_POS, progmem_str(getFirmwareName_str()), OPT_CENTER, font_medium);
83
   draw_text_box(cmd, FW_VERS_POS, progmem_str(getFirmwareName_str()), OPT_CENTER, font_medium);
84
   draw_text_box(cmd, FW_INFO_POS, about_str, OPT_CENTER, font_medium);
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
   cmd.font(font_medium)
87
   cmd.font(font_medium)
88
      .colors(normal_btn)
88
      .colors(normal_btn)

+ 4
- 0
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/interface_settings_screen.cpp Bestand weergeven

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

721
     #define BTN_ENC                           63
721
     #define BTN_ENC                           63
722
   #endif
722
   #endif
723
 #endif
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 Bestand weergeven

47
 //
47
 //
48
 // Limit Switches
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
 // Z Probe must be this pin
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
 // Filament Runout Sensor
60
 // Filament Runout Sensor
61
 //
61
 //
62
 #ifndef FIL_RUNOUT_PIN
62
 #ifndef FIL_RUNOUT_PIN
63
-  #define FIL_RUNOUT_PIN                    PC2   // E0-STOP
63
+  #define FIL_RUNOUT_PIN                    PC2   // "E0-STOP"
64
 #endif
64
 #endif
65
 
65
 
66
 //
66
 //
149
 //
149
 //
150
 // Heaters / Fans
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
 // USB connect control
157
 // USB connect control
159
 #define USB_CONNECT_PIN                     PC13
159
 #define USB_CONNECT_PIN                     PC13
160
 #define USB_CONNECT_INVERTING false
160
 #define USB_CONNECT_INVERTING false
161
 
161
 
162
-#define SD_DETECT_PIN                       PC4
163
-
164
 /**
162
 /**
165
  *                 _____
163
  *                 _____
166
  *             5V | 1 2 | GND
164
  *             5V | 1 2 | GND
182
 #define EXPA1_10_PIN                        PA15
180
 #define EXPA1_10_PIN                        PA15
183
 
181
 
184
 #if HAS_SPI_LCD
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
   #if ENABLED(CR10_STOCKDISPLAY)
184
   #if ENABLED(CR10_STOCKDISPLAY)
190
 
185
 
191
     #define BEEPER_PIN              EXPA1_10_PIN
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
     #define LCD_PINS_RS             EXPA1_04_PIN
192
     #define LCD_PINS_RS             EXPA1_04_PIN
194
     #define LCD_PINS_ENABLE         EXPA1_03_PIN
193
     #define LCD_PINS_ENABLE         EXPA1_03_PIN
195
     #define LCD_PINS_D4             EXPA1_05_PIN
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
   #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
208
   #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
198
 
209
 
199
     /** Creality Ender-2 display pinout
210
     /** Creality Ender-2 display pinout
207
      *                    EXP1
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
     #define DOGLCD_CS               EXPA1_04_PIN
225
     #define DOGLCD_CS               EXPA1_04_PIN
211
     #define DOGLCD_A0               EXPA1_05_PIN
226
     #define DOGLCD_A0               EXPA1_05_PIN
212
     #define DOGLCD_SCK              EXPA1_10_PIN
227
     #define DOGLCD_SCK              EXPA1_10_PIN
215
     #define LCD_BACKLIGHT_PIN               -1
230
     #define LCD_BACKLIGHT_PIN               -1
216
 
231
 
217
   #else
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
   #endif
234
   #endif
220
 
235
 
221
 #endif // HAS_SPI_LCD
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
 // SD Support
281
 // SD Support
225
 //
282
 //
283
+
226
 #ifndef SDCARD_CONNECTION
284
 #ifndef SDCARD_CONNECTION
227
   #define SDCARD_CONNECTION              ONBOARD
285
   #define SDCARD_CONNECTION              ONBOARD
228
 #endif
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
 #define ONBOARD_SD_CS_PIN                   PA4   // Chip select for "System" SD card
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 Bestand weergeven

40
 //
40
 //
41
 // Servos
41
 // Servos
42
 //
42
 //
43
-#define SERVO0_PIN                          PA1
43
+#define SERVO0_PIN                          PA1   // "SERVOS"
44
 
44
 
45
 //
45
 //
46
 // Limit Switches
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
 // Filament Runout Sensor
58
 // Filament Runout Sensor
83
 //
83
 //
84
 // Temperature Sensors
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
 // Heaters / Fans
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
 // USB connect control
97
 // USB connect control
99
 #define USB_CONNECT_PIN                     PC13
99
 #define USB_CONNECT_PIN                     PC13
100
 #define USB_CONNECT_INVERTING false
100
 #define USB_CONNECT_INVERTING false
101
 
101
 
102
-#define SD_DETECT_PIN                       PC4
103
-
104
 /**
102
 /**
105
  *                 _____
103
  *                 _____
106
  *             5V | 1 2 | GND
104
  *             5V | 1 2 | GND
127
 
125
 
128
     #define BEEPER_PIN              EXPA1_10_PIN
126
     #define BEEPER_PIN              EXPA1_10_PIN
129
 
127
 
128
+    #define BTN_ENC                 EXPA1_09_PIN
130
     #define BTN_EN1                 EXPA1_08_PIN
129
     #define BTN_EN1                 EXPA1_08_PIN
131
     #define BTN_EN2                 EXPA1_06_PIN
130
     #define BTN_EN2                 EXPA1_06_PIN
132
-    #define BTN_ENC                 EXPA1_09_PIN
133
 
131
 
134
     #define LCD_PINS_RS             EXPA1_04_PIN
132
     #define LCD_PINS_RS             EXPA1_04_PIN
135
     #define LCD_PINS_ENABLE         EXPA1_03_PIN
133
     #define LCD_PINS_ENABLE         EXPA1_03_PIN
159
      *                   -----
157
      *                   -----
160
      *                    EXP1
158
      *                    EXP1
161
      */
159
      */
160
+
161
+    #define BTN_ENC                 EXPA1_09_PIN
162
     #define BTN_EN1                 EXPA1_08_PIN
162
     #define BTN_EN1                 EXPA1_08_PIN
163
     #define BTN_EN2                 EXPA1_06_PIN
163
     #define BTN_EN2                 EXPA1_06_PIN
164
-    #define BTN_ENC                 EXPA1_09_PIN
165
 
164
 
166
     #define DOGLCD_CS               EXPA1_04_PIN
165
     #define DOGLCD_CS               EXPA1_04_PIN
167
     #define DOGLCD_A0               EXPA1_05_PIN
166
     #define DOGLCD_A0               EXPA1_05_PIN
171
     #define LCD_BACKLIGHT_PIN               -1
170
     #define LCD_BACKLIGHT_PIN               -1
172
 
171
 
173
   #else
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
   #endif
174
   #endif
178
 
175
 
179
 #endif // HAS_SPI_LCD
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
 // SD Support
223
 // SD Support
183
 //
224
 //
225
+
184
 #ifndef SDCARD_CONNECTION
226
 #ifndef SDCARD_CONNECTION
185
   #define SDCARD_CONNECTION              ONBOARD
227
   #define SDCARD_CONNECTION              ONBOARD
186
 #endif
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
 #define ON_BOARD_SPI_DEVICE 1                     // SPI1
241
 #define ON_BOARD_SPI_DEVICE 1                     // SPI1
189
 #define ONBOARD_SD_CS_PIN                   PA4   // Chip select for "System" SD card
242
 #define ONBOARD_SD_CS_PIN                   PA4   // Chip select for "System" SD card

Laden…
Annuleren
Opslaan