Browse Source

FYSETC TFT81050 LCD support (#17568)

George Fu 5 years ago
parent
commit
e990a98404
No account linked to committer's email address

+ 1
- 0
Marlin/Configuration_adv.h View File

@@ -1344,6 +1344,7 @@
1344 1344
   //#define LCD_HAOYU_FT800CB         // Haoyu with 4.3" or 5" (480x272)
1345 1345
   //#define LCD_HAOYU_FT810CB         // Haoyu with 5" (800x480)
1346 1346
   //#define LCD_ALEPHOBJECTS_CLCD_UI  // Aleph Objects Color LCD UI
1347
+  //#define LCD_FYSETC_TFT81050       // FYSETC with 5" (800x480)
1347 1348
 
1348 1349
   // Correct the resolution if not using the stock TFT panel.
1349 1350
   //#define TOUCH_UI_320x240

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

@@ -25,24 +25,23 @@
25 25
 #define HAS_RESOLUTION (defined(TOUCH_UI_320x240) || defined(TOUCH_UI_480x272) || defined(TOUCH_UI_800x480))
26 26
 
27 27
 #define IS_FT800 \
28
-    constexpr uint16_t ftdi_chip = 800; \
29
-    using namespace FTDI_FT800; \
30
-    namespace DL { \
31
-      using namespace FTDI_FT800_DL; \
32
-    } \
33
-    typedef ft800_memory_map ftdi_memory_map; \
34
-    typedef ft800_registers  ftdi_registers;
28
+  constexpr uint16_t ftdi_chip = 800; \
29
+  using namespace FTDI_FT800; \
30
+  namespace DL { \
31
+    using namespace FTDI_FT800_DL; \
32
+  } \
33
+  typedef ft800_memory_map ftdi_memory_map; \
34
+  typedef ft800_registers  ftdi_registers;
35 35
 
36 36
 #define IS_FT810 \
37
-    constexpr uint16_t ftdi_chip = 810; \
38
-    using namespace FTDI_FT810; \
39
-    namespace DL { \
40
-      using namespace FTDI_FT800_DL; \
41
-      using namespace FTDI_FT810_DL; \
42
-    } \
43
-    typedef ft810_memory_map ftdi_memory_map; \
44
-    typedef ft810_registers  ftdi_registers;
45
-
37
+  constexpr uint16_t ftdi_chip = 810; \
38
+  using namespace FTDI_FT810; \
39
+  namespace DL { \
40
+    using namespace FTDI_FT800_DL; \
41
+    using namespace FTDI_FT810_DL; \
42
+  } \
43
+  typedef ft810_memory_map ftdi_memory_map; \
44
+  typedef ft810_registers  ftdi_registers;
46 45
 
47 46
 #ifdef LCD_FTDI_VM800B35A
48 47
   #if !HAS_RESOLUTION
@@ -53,30 +52,25 @@
53 52
   #endif
54 53
   namespace FTDI {
55 54
     IS_FT800
56
-    constexpr bool Use_Crystal              = true;  // 0 = use internal oscillator, 1 = module has a crystal populated
57
-    constexpr bool GPIO_0_Audio_Enable      = false; /* 1 = does use GPIO00 for amplifier control, 0 = not in use for Audio */
58
-    constexpr bool GPIO_1_Audio_Shutdown    = true;  /* 1 = does use GPIO01 for amplifier control, 0 = not in use for Audio */
59
-    constexpr uint8_t Swizzle               = 2;
60
-    constexpr uint8_t CSpread               = 1;
55
+    constexpr bool Use_Crystal            = true;  // 0 = use internal oscillator, 1 = module has a crystal populated
56
+    constexpr bool GPIO_0_Audio_Enable    = false; /* 1 = does use GPIO00 for amplifier control, 0 = not in use for Audio */
57
+    constexpr bool GPIO_1_Audio_Shutdown  = true;  /* 1 = does use GPIO01 for amplifier control, 0 = not in use for Audio */
58
+    constexpr uint8_t Swizzle             = 2;
59
+    constexpr uint8_t CSpread             = 1;
61 60
 
62
-    constexpr uint16_t touch_threshold      = 1200; /* touch-sensitivity */
61
+    constexpr uint16_t touch_threshold    = 1200; /* touch-sensitivity */
63 62
   }
64 63
 
65
-/*
66
- * Settings for the Haoyu Electronics, 4.3" Graphical LCD Touchscreen,       480x272, SPI, FT800 (FT800CB-HY43B)
67
- *                  Haoyu Electronics,   5" Graphical LCD Touchscreen,       480x272, SPI, FT800 (FT800CB-HY50B)
68
- *
69
- *    http://www.hotmcu.com/43-graphical-lcd-touchscreen-480x272-spi-ft800-p-111.html?cPath=6_16
70
- *    http://www.hotmcu.com/5-graphical-lcd-touchscreen-480x272-spi-ft800-p-124.html?cPath=6_16
71
- *
64
+/**
65
+ * Settings for the Haoyu Electronics, 4.3" Graphical LCD Touchscreen, 480x272, SPI, FT800 (FT800CB-HY43B)
66
+ *                                 and   5" Graphical LCD Touchscreen, 480x272, SPI, FT800 (FT800CB-HY50B)
67
+ *  http://www.hotmcu.com/43-graphical-lcd-touchscreen-480x272-spi-ft800-p-111.html?cPath=6_16
68
+ *  http://www.hotmcu.com/5-graphical-lcd-touchscreen-480x272-spi-ft800-p-124.html?cPath=6_16
72 69
  * Datasheet:
73
- *
74
- *    http://www.hantronix.com/files/data/1278363262430-3.pdf
75
- *    http://www.haoyuelectronics.com/Attachment/HY43-LCD/LCD%20DataSheet.pdf
76
- *    http://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf
77
- *
70
+ *  http://www.hantronix.com/files/data/1278363262430-3.pdf
71
+ *  http://www.haoyuelectronics.com/Attachment/HY43-LCD/LCD%20DataSheet.pdf
72
+ *  http://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf
78 73
  */
79
-
80 74
 #elif defined(LCD_HAOYU_FT800CB)
81 75
   #if !HAS_RESOLUTION
82 76
     #define TOUCH_UI_480x272
@@ -86,25 +80,20 @@
86 80
   #endif
87 81
   namespace FTDI {
88 82
     IS_FT800
89
-    constexpr bool Use_Crystal              = true; // 0 = use internal oscillator, 1 = module has a crystal populated
90
-    constexpr bool GPIO_0_Audio_Enable      = false;
91
-    constexpr bool GPIO_1_Audio_Shutdown    = false;
92
-    constexpr uint8_t Swizzle               = 0;
93
-    constexpr uint8_t CSpread               = 1;
94
-    constexpr uint16_t touch_threshold      = 2000; /* touch-sensitivity */
83
+    constexpr bool Use_Crystal            = true; // 0 = use internal oscillator, 1 = module has a crystal populated
84
+    constexpr bool GPIO_0_Audio_Enable    = false;
85
+    constexpr bool GPIO_1_Audio_Shutdown  = false;
86
+    constexpr uint8_t Swizzle             = 0;
87
+    constexpr uint8_t CSpread             = 1;
88
+    constexpr uint16_t touch_threshold    = 2000; /* touch-sensitivity */
95 89
   }
96 90
 
97
-/*
91
+/**
98 92
  * Settings for the Haoyu Electronics, 5" Graphical LCD Touchscreen, 800x480, SPI, FT810
99
- *
100
- *    http://www.hotmcu.com/5-graphical-lcd-touchscreen-800x480-spi-ft810-p-286.html
101
- *
93
+ *  http://www.hotmcu.com/5-graphical-lcd-touchscreen-800x480-spi-ft810-p-286.html
102 94
  * Datasheet:
103
- *
104
- *    http://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf
105
- *
95
+ *  http://www.haoyuelectronics.com/Attachment/HY5-LCD-HD/KD50G21-40NT-A1.pdf
106 96
  */
107
-
108 97
 #elif defined(LCD_HAOYU_FT810CB)
109 98
   #if !HAS_RESOLUTION
110 99
     #define TOUCH_UI_800x480
@@ -114,25 +103,20 @@
114 103
   #endif
115 104
   namespace FTDI {
116 105
     IS_FT810
117
-    constexpr bool Use_Crystal              = true; // 0 = use internal oscillator, 1 = module has a crystal populated
118
-    constexpr bool GPIO_0_Audio_Enable      = false;
119
-    constexpr bool GPIO_1_Audio_Shutdown    = false;
120
-    constexpr uint8_t Swizzle               = 0;
121
-    constexpr uint8_t CSpread               = 1;
122
-    constexpr uint16_t touch_threshold      = 2000; /* touch-sensitivity */
106
+    constexpr bool Use_Crystal            = true; // 0 = use internal oscillator, 1 = module has a crystal populated
107
+    constexpr bool GPIO_0_Audio_Enable    = false;
108
+    constexpr bool GPIO_1_Audio_Shutdown  = false;
109
+    constexpr uint8_t Swizzle             = 0;
110
+    constexpr uint8_t CSpread             = 1;
111
+    constexpr uint16_t touch_threshold    = 2000; /* touch-sensitivity */
123 112
   }
124 113
 
125
-/*
114
+/**
126 115
  * Settings for the 4D Systems,        4.3" Embedded SPI Display             480x272, SPI, FT800 (4DLCD-FT843)
127
- *
128
- *    http://www.4dsystems.com.au/product/4DLCD_FT843/
129
- *
116
+ *  http://www.4dsystems.com.au/product/4DLCD_FT843/
130 117
  * Datasheet:
131
- *
132
- *    http://www.4dsystems.com.au/productpages/4DLCD-FT843/downloads/FT843-4.3-Display_datasheet_R_1_2.pdf
133
- *
118
+ *  http://www.4dsystems.com.au/productpages/4DLCD-FT843/downloads/FT843-4.3-Display_datasheet_R_1_2.pdf
134 119
  */
135
-
136 120
 #elif defined(LCD_4DSYSTEMS_4DLCD_FT843)
137 121
   #if !HAS_RESOLUTION
138 122
     #define TOUCH_UI_480x272
@@ -142,23 +126,19 @@
142 126
   #endif
143 127
   namespace FTDI {
144 128
     IS_FT800
145
-    constexpr bool Use_Crystal              = true; // 0 = use internal oscillator, 1 = module has a crystal populated
146
-    constexpr bool GPIO_0_Audio_Enable      = false;
147
-    constexpr bool GPIO_1_Audio_Shutdown    = true;
148
-    constexpr uint8_t Swizzle               = 0;
149
-    constexpr uint8_t CSpread               = 1;
150
-    constexpr uint16_t touch_threshold      = 1200; /* touch-sensitivity */
129
+    constexpr bool Use_Crystal            = true; // 0 = use internal oscillator, 1 = module has a crystal populated
130
+    constexpr bool GPIO_0_Audio_Enable    = false;
131
+    constexpr bool GPIO_1_Audio_Shutdown  = true;
132
+    constexpr uint8_t Swizzle             = 0;
133
+    constexpr uint8_t CSpread             = 1;
134
+    constexpr uint16_t touch_threshold    = 1200; /* touch-sensitivity */
151 135
   }
152 136
 
153
-/*
137
+/**
154 138
  * Settings for the Aleph Objects Color LCD User Interface
155
- *
156
- *    https://code.alephobjects.com/source/aotctl/
157
- *
139
+ *  https://code.alephobjects.com/source/aotctl/
158 140
  * Datasheet:
159
- *
160
- *    http://www.hantronix.com/files/data/s1501799605s500-gh7.pdf
161
- *
141
+ *  http://www.hantronix.com/files/data/s1501799605s500-gh7.pdf
162 142
  */
163 143
 #elif defined(LCD_ALEPHOBJECTS_CLCD_UI)
164 144
   #if !HAS_RESOLUTION
@@ -169,15 +149,38 @@
169 149
   #endif
170 150
   namespace FTDI {
171 151
     IS_FT810
172
-    constexpr bool Use_Crystal              = false; // 0 = use internal oscillator, 1 = module has a crystal populated
173
-    constexpr bool GPIO_0_Audio_Enable      = true;  // The AO CLCD uses GPIO0 to enable audio
174
-    constexpr bool GPIO_1_Audio_Shutdown    = false;
175
-    constexpr uint8_t Swizzle               = 0;
176
-    constexpr uint8_t CSpread               = 0;
177
-    constexpr uint16_t touch_threshold      = 2000; /* touch-sensitivity */
152
+    constexpr bool Use_Crystal            = false; // 0 = use internal oscillator, 1 = module has a crystal populated
153
+    constexpr bool GPIO_0_Audio_Enable    = true;  // The AO CLCD uses GPIO0 to enable audio
154
+    constexpr bool GPIO_1_Audio_Shutdown  = false;
155
+    constexpr uint8_t Swizzle             = 0;
156
+    constexpr uint8_t CSpread             = 0;
157
+    constexpr uint16_t touch_threshold    = 2000; /* touch-sensitivity */
178 158
   }
179 159
 
160
+/**
161
+ * FYSETC Color LCD
162
+ *  https://www.aliexpress.com/item/4000627651757.html
163
+ * Product information:
164
+ *  https://github.com/FYSETC/TFT81050
165
+ */
166
+#elif defined(LCD_FYSETC_TFT81050)
167
+  #if !HAS_RESOLUTION
168
+    #define TOUCH_UI_800x480
169
+  #endif
170
+  #ifndef FTDI_API_LEVEL
171
+    #define FTDI_API_LEVEL 810
172
+  #endif
173
+  namespace FTDI {
174
+    IS_FT810
175
+    constexpr bool Use_Crystal            = false; // 0 = use internal oscillator, 1 = module has a crystal populated
176
+    constexpr bool GPIO_0_Audio_Enable    = true;  // The AO CLCD uses GPIO0 to enable audio
177
+    constexpr bool GPIO_1_Audio_Shutdown  = false;
178
+    constexpr uint8_t Swizzle             = 0;
179
+    constexpr uint8_t CSpread             = 0;
180
+    constexpr uint16_t touch_threshold    = 2000; /* touch-sensitivity */
181
+  }
180 182
 #else
181 183
 
182
-  #error "Unknown or no TOUCH_UI_FTDI_EVE board specified. To add a new board, modify 'ftdi_eve_boards.h'."
184
+  #error "Unknown or no TOUCH_UI_FTDI_EVE board specified. To add a new board, modify this file."
185
+
183 186
 #endif

Loading…
Cancel
Save