Browse Source

Two additional EVE displays (#18839)

RudolphRiedel 4 years ago
parent
commit
04b83d50a2
No account linked to committer's email address

+ 2
- 0
Marlin/Configuration_adv.h View File

@@ -1565,6 +1565,8 @@
1565 1565
   //#define LCD_HAOYU_FT810CB         // Haoyu with 5" (800x480)
1566 1566
   //#define LCD_ALEPHOBJECTS_CLCD_UI  // Aleph Objects Color LCD UI
1567 1567
   //#define LCD_FYSETC_TFT81050       // FYSETC with 5" (800x480)
1568
+  //#define LCD_EVE3_50G              // Matrix Orbital 5.0", 800x480, BT815
1569
+  //#define LCD_EVE2_50G              // Matrix Orbital 5.0", 800x480, FT813
1568 1570
 
1569 1571
   // Correct the resolution if not using the stock TFT panel.
1570 1572
   //#define TOUCH_UI_320x240

+ 98
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h View File

@@ -112,7 +112,7 @@
112 112
   }
113 113
 
114 114
 /**
115
- * Settings for the 4D Systems,        4.3" Embedded SPI Display             480x272, SPI, FT800 (4DLCD-FT843)
115
+ * Settings for the 4D Systems, 4.3" Embedded SPI Display 480x272, SPI, FT800 (4DLCD-FT843)
116 116
  *  https://4dsystems.com.au/4dlcd-ft843
117 117
  * Datasheet:
118 118
  *  https://4dsystems.com.au/mwdownloads/download/link/id/52/
@@ -177,8 +177,105 @@
177 177
     constexpr uint8_t CSpread             = 0;
178 178
     constexpr uint16_t touch_threshold    = 2000; /* touch-sensitivity */
179 179
   }
180
+
181
+/**
182
+ * Settings for EVE3-50G - Matrix Orbital 5.0" 800x480, BT815
183
+ * https://www.matrixorbital.com/ftdi-eve/eve-bt815-bt816/eve3-50g
184
+ * use for example with: https://github.com/RudolphRiedel/EVE_display-adapter
185
+ */
186
+#elif defined(LCD_EVE3_50G)
187
+  #if !HAS_RESOLUTION
188
+    #define TOUCH_UI_800x480
189
+    #define TOUCH_UI_800x480_GENERIC    // use more common timing parameters as the original set
190
+  #endif
191
+  #ifndef FTDI_API_LEVEL
192
+    #define FTDI_API_LEVEL                810
193
+  #endif
194
+  namespace FTDI {
195
+    IS_FT810
196
+    constexpr bool Use_Crystal            = true; // 0 = use internal oscillator, 1 = module has a crystal populated
197
+    constexpr bool GPIO_0_Audio_Enable    = false;
198
+    constexpr bool GPIO_1_Audio_Shutdown  = false;
199
+    #define USE_GT911 // this display uses an alternative touch-controller and we need to tell the init function to switch
200
+    constexpr uint8_t Swizzle             = 0;
201
+    constexpr uint8_t CSpread             = 1;
202
+    constexpr uint8_t Pclkpol             = 1;
203
+    constexpr uint16_t touch_threshold    = 1200; /* touch-sensitivity */
204
+
205
+    constexpr uint32_t default_transform_a  =  0x000109E4;
206
+    constexpr uint32_t default_transform_b  =  0x000007A6;
207
+    constexpr uint32_t default_transform_c  =  0xFFEC1EBA;
208
+    constexpr uint32_t default_transform_d  =  0x0000072C;
209
+    constexpr uint32_t default_transform_e  =  0x0001096A;
210
+    constexpr uint32_t default_transform_f  =  0xFFF469CF;
211
+  }
212
+
213
+/**
214
+ * Settings for EVE2-50G - Matrix Orbital 5.0" 800x480, FT813
215
+ * https://www.matrixorbital.com/ftdi-eve/eve-bt815-bt816/eve3-50g
216
+ * use for example with: https://github.com/RudolphRiedel/EVE_display-adapter
217
+ */
218
+#elif defined(LCD_EVE2_50G)
219
+  #if !HAS_RESOLUTION
220
+    #define TOUCH_UI_800x480
221
+    #define TOUCH_UI_800x480_GENERIC    // use more common timing parameters as the original set
222
+  #endif
223
+  #ifndef FTDI_API_LEVEL
224
+    #define FTDI_API_LEVEL                810
225
+  #endif
226
+  namespace FTDI {
227
+    IS_FT810
228
+    constexpr bool Use_Crystal            = false; // 0 = use internal oscillator, 1 = module has a crystal populated
229
+    constexpr bool GPIO_0_Audio_Enable    = false;
230
+    constexpr bool GPIO_1_Audio_Shutdown  = false;
231
+    #define PATCH_GT911 // this display uses an alternative touch-controller and we need to tell the init function to patch the FT813 for it
232
+    constexpr uint8_t Pclkpol             = 1;
233
+    constexpr uint8_t Swizzle             = 0;
234
+    constexpr uint8_t CSpread             = 1;
235
+    constexpr uint16_t touch_threshold    = 1200; /* touch-sensitivity */
236
+
237
+    constexpr uint32_t default_transform_a  =  0x000109E4;
238
+    constexpr uint32_t default_transform_b  =  0x000007A6;
239
+    constexpr uint32_t default_transform_c  =  0xFFEC1EBA;
240
+    constexpr uint32_t default_transform_d  =  0x0000072C;
241
+    constexpr uint32_t default_transform_e  =  0x0001096A;
242
+    constexpr uint32_t default_transform_f  =  0xFFF469CF;
243
+  }
244
+
180 245
 #else
181 246
 
182 247
   #error "Unknown or no TOUCH_UI_FTDI_EVE board specified. To add a new board, modify this file."
183 248
 
184 249
 #endif
250
+
251
+
252
+/* this data is used to patch FT813 displays that use a GT911 as a touch-controller */
253
+#ifdef PATCH_GT911
254
+  constexpr PROGMEM unsigned char GT911_data[] = {
255
+    26,255,255,255,32,32,48,0,4,0,0,0,2,0,0,0,
256
+    34,255,255,255,0,176,48,0,120,218,237,84,221,111,84,69,20,63,51,179,93,160,148,101,111,76,5,44,141,123,111,161,11,219,154,16,9,16,17,229,156,75,26,11,13,21,227,3,16,252,184,179,
257
+    45,219,143,45,41,125,144,72,67,100,150,71,189,113,18,36,17,165,100,165,198,16,32,17,149,196,240,128,161,16,164,38,54,240,0,209,72,130,15,38,125,48,66,82,30,76,19,31,172,103,46,
258
+    139,24,255,4,227,157,204,156,51,115,102,206,231,239,220,5,170,94,129,137,75,194,216,98,94,103,117,115,121,76,131,177,125,89,125,82,123,60,243,58,142,242,204,185,243,188,118,156,
259
+    227,155,203,238,238,195,251,205,229,71,92,28,169,190,184,84,143,113,137,53,244,103,181,237,87,253,113,137,233,48,12,198,165,181,104,139,25,84,253,155,114,74,191,0,54,138,163,
260
+    12,62,131,207,129,23,217,34,91,31,128,65,246,163,175,213,8,147,213,107,35,203,94,108,3,111,40,171,83,24,15,165,177,222,116,97,23,188,140,206,150,42,102,181,87,78,86,182,170,134,
261
+    215,241,121,26,243,252,2,76,115,217,139,222,206,173,136,132,81,61,35,185,39,113,23,46,199,76,178,54,151,183,224,0,40,189,28,149,182,58,131,79,152,30,76,34,98,234,162,216,133,141,
262
+    102,39,170,40,192,101,53,201,146,191,37,77,44,177,209,74,211,5,206,187,5,6,216,47,53,96,123,22,50,103,251,192,84,17,74,227,185,56,106,51,91,161,96,182,163,48,171,141,139,65,152,
263
+    66,66,11,102,43,158,75,36,80,147,184,147,139,112,17,235,216,103,111,239,245,92,10,175,194,40,44,58,125,5,59,112,50,103,245,4,78,192,5,156,194,51,60,191,134,75,110,173,237,46,192,
264
+    121,156,192,115,184,218,120,67,63,115,46,11,102,10,97,232,50,235,114,182,148,118,178,41,188,12,135,77,202,124,12,96,238,35,161,234,189,129,23,249,212,139,230,25,53,48,205,52,93,
265
+    163,117,53,154,170,81,85,163,178,70,69,66,167,241,14,46,241,1,226,136,152,179,197,59,184,148,254,49,132,48,15,176,137,192,76,131,196,105,104,162,86,81,160,165,255,26,173,162,137,
266
+    86,145,210,183,192,55,175,194,211,60,91,120,230,184,174,27,41,131,155,40,224,29,87,179,232,16,55,55,7,165,147,81,23,165,49,101,54,224,75,180,81,108,18,29,226,69,225,110,175,224,
267
+    42,212,25,47,130,193,110,234,192,215,252,56,74,162,24,46,251,174,54,106,68,245,14,9,155,160,22,120,207,104,240,29,90,178,140,28,24,220,47,166,112,61,251,208,192,111,56,239,238,
268
+    93,255,251,62,99,32,193,75,61,190,235,123,229,110,218,194,85,79,225,59,98,20,238,227,235,220,11,221,149,25,180,116,194,159,111,96,192,24,213,59,139,179,156,215,69,230,19,24,35,
269
+    135,117,206,171,206,162,67,129,234,61,235,11,104,103,84,64,223,167,254,40,163,101,92,84,43,150,46,249,219,205,7,116,11,91,104,61,57,75,223,8,48,25,28,119,252,222,113,49,86,249,
270
+    74,180,211,156,181,61,215,168,157,7,251,199,150,242,250,91,58,132,94,121,7,53,151,139,98,6,165,153,69,214,32,110,211,100,101,31,89,45,81,98,23,205,205,197,209,109,186,198,35,
271
+    141,191,249,25,60,132,223,153,251,98,20,239,146,139,20,217,250,41,250,137,58,177,90,57,79,51,108,233,20,253,194,187,49,222,205,114,141,96,48,175,219,107,54,111,138,22,154,103,
272
+    108,79,58,252,179,178,79,164,195,2,153,36,39,170,199,201,167,197,85,106,8,59,177,81,46,56,2,230,75,114,17,55,112,188,65,208,137,77,114,10,115,55,58,208,197,173,122,87,6,140,
273
+    110,42,208,124,163,70,108,241,104,18,245,98,214,187,134,53,42,221,22,182,133,211,116,148,177,194,209,192,85,90,199,58,55,203,2,229,19,137,187,161,228,154,112,203,145,125,244,
274
+    188,220,118,228,41,201,181,41,195,144,215,183,51,80,250,21,217,16,217,200,235,109,227,188,122,218,142,60,170,224,112,240,184,130,229,224,113,5,223,148,163,80,165,183,130,187,
275
+    132,116,64,238,161,85,220,115,139,205,98,227,244,29,102,125,7,37,243,123,223,11,26,92,63,243,116,61,191,138,123,244,160,84,186,74,31,5,174,247,119,135,199,248,253,135,242,97,
276
+    102,145,190,144,14,85,238,221,231,193,158,48,205,25,120,248,15,220,29,158,9,70,185,30,103,229,33,254,23,237,160,172,62,193,90,222,224,232,14,200,56,90,104,142,227,120,110,6,
277
+    21,211,203,65,150,99,151,220,247,87,164,50,159,49,239,234,58,142,0,109,108,123,18,79,227,36,100,248,222,205,96,127,120,26,171,228,69,63,36,17,252,200,17,116,242,187,227,88,143,
278
+    247,2,75,191,6,130,59,188,11,55,240,31,243,122,152,226,183,207,154,73,188,39,219,43,105,222,87,41,143,141,140,175,73,112,184,252,61,184,16,90,250,35,168,82,119,176,57,116,94,
279
+    200,150,22,190,179,44,104,12,235,84,149,102,252,89,154,193,99,228,106,242,125,248,64,194,255,223,127,242,83,11,255,2,70,214,226,128,0,0
280
+  };
281
+#endif // PATCH_GT911

+ 27
- 16
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp View File

@@ -1073,37 +1073,48 @@ void CLCD::init() {
1073 1073
   for (counter = 0; counter < 250; counter++) {
1074 1074
    uint8_t device_id = mem_read_8(REG::ID);            // Read Device ID, Should Be 0x7C;
1075 1075
    if (device_id == 0x7C) {
1076
-     #if ENABLED(TOUCH_UI_DEBUG)
1077
-       SERIAL_ECHO_MSG("FTDI chip initialized");
1078
-     #endif
1076
+     if (ENABLED(TOUCH_UI_DEBUG)) SERIAL_ECHO_MSG("FTDI chip initialized ");
1079 1077
      break;
1080 1078
    }
1081 1079
    else
1082 1080
      delay(1);
1083 1081
 
1084
-   if (counter == 249) {
1085
-      #if ENABLED(TOUCH_UI_DEBUG)
1086
-        SERIAL_ECHO_MSG("Timeout waiting for device ID, should be 124, got ", device_id);
1087
-      #endif
1088
-    }
1082
+    if (TERN0(TOUCH_UI_DEBUG, counter > 248))
1083
+      SERIAL_ECHO_MSG("Timeout waiting for device ID, should be 124, got ", device_id);
1089 1084
   }
1090 1085
 
1091
-  /* make sure that all units are in working conditions, usually the touch-controller needs a little more time */
1086
+  /* Ensure all units are in working condition, usually the touch-controller needs a little more time */
1092 1087
   for (counter = 0; counter < 100; counter++) {
1093 1088
     uint8_t reset_status = mem_read_8(REG::CPURESET) & 0x03;
1094 1089
     if (reset_status == 0x00) {
1095
-      #if ENABLED(TOUCH_UI_DEBUG)
1096
-        SERIAL_ECHO_MSG("FTDI chip all units running ");
1097
-      #endif
1090
+      if (ENABLED(TOUCH_UI_DEBUG)) SERIAL_ECHO_MSG("FTDI chip all units running ");
1098 1091
       break;
1099 1092
     }
1100 1093
     else
1101 1094
       delay(1);
1102 1095
 
1103
-    if (ENABLED(TOUCH_UI_DEBUG) && counter == 99)
1096
+    if (TERN0(TOUCH_UI_DEBUG, counter > 98))
1104 1097
       SERIAL_ECHO_MSG("Timeout waiting for reset status. Should be 0x00, got ", reset_status);
1105 1098
   }
1106 1099
 
1100
+  #if ENABLED(USE_GT911)   /* switch BT815 to use Goodix GT911 touch controller */
1101
+    mem_write_32(REG::TOUCH_CONFIG, 0x000005D1);
1102
+  #endif
1103
+
1104
+  #if ENABLED(PATCH_GT911) /* patch FT813 use Goodix GT911 touch controller */
1105
+    mem_write_pgm(REG::CMDB_WRITE, GT911_data, sizeof(GT911_data)); /* write binary blob to command-fifo */
1106
+    delay(10);
1107
+    mem_write_8(REG::TOUCH_OVERSAMPLE, 0x0F);  /* setup oversample to 0x0f as "hidden" in binary-blob for AN_336 */
1108
+    mem_write_16(REG::TOUCH_CONFIG, 0x05d0); /* write magic cookie as requested by AN_336 */
1109
+
1110
+    /* specific to the EVE2 modules from Matrix-Orbital we have to use GPIO3 to reset GT911 */
1111
+    mem_write_16(REG::GPIOX_DIR,0x8008); /* Reset-Value is 0x8000, adding 0x08 sets GPIO3 to output, default-value for REG_GPIOX is 0x8000 -> Low output on GPIO3 */
1112
+    delay(1); /* wait more than 100µs */
1113
+    mem_write_8(REG::CPURESET, 0x00); /* clear all resets */
1114
+    delay(56); /* wait more than 55ms */
1115
+    mem_write_16(REG::GPIOX_DIR,0x8000); /* setting GPIO3 back to input */
1116
+  #endif
1117
+
1107 1118
   mem_write_8(REG::PWM_DUTY, 0);   // turn off Backlight, Frequency already is set to 250Hz default
1108 1119
 
1109 1120
   /* Configure the FT8xx Registers */
@@ -1140,13 +1151,13 @@ void CLCD::init() {
1140 1151
   if (GPIO_1_Audio_Shutdown) {
1141 1152
     mem_write_8(REG::GPIO_DIR,   GPIO_DISP  | GPIO_GP1);
1142 1153
     mem_write_8(REG::GPIO,       GPIO_DISP  | GPIO_GP1);
1143
-  } else if (GPIO_0_Audio_Enable) {
1154
+  }
1155
+  else if (GPIO_0_Audio_Enable) {
1144 1156
     mem_write_8(REG::GPIO_DIR,   GPIO_DISP  | GPIO_GP0);
1145 1157
     mem_write_8(REG::GPIO,       GPIO_DISP  | GPIO_GP0);
1146 1158
   }
1147
-  else {
1159
+  else
1148 1160
     mem_write_8(REG::GPIO, GPIO_DISP); /* REG::GPIO_DIR is set to output for GPIO_DISP by default */
1149
-  }
1150 1161
 
1151 1162
   mem_write_8(REG::PCLK, Pclk); // Turns on Clock by setting PCLK Register to the value necessary for the module
1152 1163
 

+ 40
- 25
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/resolutions.h View File

@@ -43,7 +43,7 @@
43 43
     constexpr uint16_t Vsync0               = tvfp - 1; \
44 44
     constexpr uint16_t Vsync1               = tvfp + tvpw - 1; \
45 45
     static_assert(thfp + thb + Hsize == th, "Mismatch in display th"); \
46
-    static_assert(tvfp + tvb + Vsize == tv, "Mismatch in display tv");
46
+    static_assert(tvfp + tvb + Vsize == tv, "Mismatch in display tv")
47 47
 
48 48
 #if ENABLED(TOUCH_UI_320x240)
49 49
   namespace FTDI {
@@ -85,7 +85,7 @@
85 85
     constexpr uint16_t tvb                  =    2; // VS Back porch (blanking)
86 86
     constexpr uint16_t tvpw                 =   10; // VS pulse width
87 87
 
88
-    COMPUTE_REGS_FROM_DATASHEET
88
+    COMPUTE_REGS_FROM_DATASHEET;
89 89
 
90 90
     constexpr uint32_t default_transform_a  =  0x00008100;
91 91
     constexpr uint32_t default_transform_b  =  0x00000000;
@@ -97,29 +97,44 @@
97 97
 
98 98
 #elif defined(TOUCH_UI_800x480)
99 99
   namespace FTDI {
100
-    constexpr uint8_t  Pclk                 =    3;
101
-    constexpr uint8_t  Pclkpol              =    1;
102
-    constexpr uint16_t Hsize                =  800;
103
-    constexpr uint16_t Vsize                =  480;
104
-
105
-    constexpr uint16_t th                   = 1056; // One horizontal line
106
-    constexpr uint16_t thfp                 =  210; // HS Front porch
107
-    constexpr uint16_t thb                  =   46; // HS Back porch (blanking)
108
-    constexpr uint16_t thpw                 =   23; // HS pulse width
109
-
110
-    constexpr uint16_t tv                   =  525; // Vertical period time
111
-    constexpr uint16_t tvfp                 =   22; // VS Front porch
112
-    constexpr uint16_t tvb                  =   23; // VS Back porch (blanking)
113
-    constexpr uint16_t tvpw                 =   10; // VS pulse width
114
-
115
-    COMPUTE_REGS_FROM_DATASHEET
116
-
117
-    constexpr uint32_t default_transform_a  =  0x0000D8B9;
118
-    constexpr uint32_t default_transform_b  =  0x00000124;
119
-    constexpr uint32_t default_transform_c  =  0xFFE23926;
120
-    constexpr uint32_t default_transform_d  =  0xFFFFFF51;
121
-    constexpr uint32_t default_transform_e  =  0xFFFF7E4F;
122
-    constexpr uint32_t default_transform_f  =  0x01F0AF70;
100
+    #if defined(TOUCH_UI_800x480_GENERIC)
101
+      constexpr uint8_t Pclk                 =    2;
102
+      constexpr uint16_t Hsize               =  800;
103
+      constexpr uint16_t Vsize               =  480;
104
+
105
+      constexpr uint16_t Vsync0              =    0;
106
+      constexpr uint16_t Vsync1              =    3;
107
+      constexpr uint16_t Voffset             =   32;
108
+      constexpr uint16_t Vcycle              =  525;
109
+      constexpr uint16_t Hsync0              =    0;
110
+      constexpr uint16_t Hsync1              =   48;
111
+      constexpr uint16_t Hoffset             =   88;
112
+      constexpr uint16_t Hcycle              =  928;
113
+    #else
114
+      constexpr uint8_t  Pclk                =    3;
115
+      constexpr uint8_t  Pclkpol             =    1;
116
+      constexpr uint16_t Hsize               =  800;
117
+      constexpr uint16_t Vsize               =  480;
118
+
119
+      constexpr uint16_t th                  = 1056; // One horizontal line
120
+      constexpr uint16_t thfp                =  210; // HS Front porch
121
+      constexpr uint16_t thb                 =   46; // HS Back porch (blanking)
122
+      constexpr uint16_t thpw                =   23; // HS pulse width
123
+
124
+      constexpr uint16_t tv                  =  525; // Vertical period time
125
+      constexpr uint16_t tvfp                =   22; // VS Front porch
126
+      constexpr uint16_t tvb                 =   23; // VS Back porch (blanking)
127
+      constexpr uint16_t tvpw                =   10; // VS pulse width
128
+
129
+      COMPUTE_REGS_FROM_DATASHEET;
130
+
131
+      constexpr uint32_t default_transform_a  =  0x0000D8B9;
132
+      constexpr uint32_t default_transform_b  =  0x00000124;
133
+      constexpr uint32_t default_transform_c  =  0xFFE23926;
134
+      constexpr uint32_t default_transform_d  =  0xFFFFFF51;
135
+      constexpr uint32_t default_transform_e  =  0xFFFF7E4F;
136
+      constexpr uint32_t default_transform_f  =  0x01F0AF70;
137
+    #endif
123 138
   }
124 139
 
125 140
 #else

Loading…
Cancel
Save