Browse Source

Permit touch calibration override

Scott Lahteine 4 years ago
parent
commit
854af7a4bf

+ 12
- 4
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h View File

303
 
303
 
304
     // Emulated DOGM have xpt calibration values independent of display resolution
304
     // Emulated DOGM have xpt calibration values independent of display resolution
305
     #if ENABLED(SPI_GRAPHICAL_TFT)
305
     #if ENABLED(SPI_GRAPHICAL_TFT)
306
-      #define XPT2046_X_CALIBRATION      -11245
307
-      #define XPT2046_Y_CALIBRATION        8629
308
-      #define XPT2046_X_OFFSET              685
309
-      #define XPT2046_Y_OFFSET             -285
306
+      #ifndef XPT2046_X_CALIBRATION
307
+        #define XPT2046_X_CALIBRATION    -11245
308
+      #endif
309
+      #ifdef XPT2046_Y_CALIBRATION
310
+        #define XPT2046_Y_CALIBRATION      8629
311
+      #endif
312
+      #ifdef XPT2046_X_OFFSET
313
+        #define XPT2046_X_OFFSET            685
314
+      #endif
315
+      #ifdef XPT2046_Y_OFFSET
316
+        #define XPT2046_Y_OFFSET           -285
317
+      #endif
310
     #endif
318
     #endif
311
 
319
 
312
   #elif IS_TFTGLCD_PANEL
320
   #elif IS_TFTGLCD_PANEL

+ 19
- 19
Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h View File

105
 #define FIL_RUNOUT_PIN                      PA15
105
 #define FIL_RUNOUT_PIN                      PA15
106
 
106
 
107
 // SPI Flash
107
 // SPI Flash
108
-#define SPI_FLASH_SIZE                  0x200000  // 2MB
109
 #define HAS_SPI_FLASH                          1
108
 #define HAS_SPI_FLASH                          1
109
+#if HAS_SPI_FLASH
110
+  #define SPI_FLASH_SIZE                0x200000  // 2MB
111
+#endif
110
 
112
 
111
 // SPI 2
113
 // SPI 2
112
 #define W25QXX_CS_PIN                       PB12
114
 #define W25QXX_CS_PIN                       PB12
146
 #endif
148
 #endif
147
 
149
 
148
 #if HAS_TFT_LVGL_UI
150
 #if HAS_TFT_LVGL_UI
149
-
150
   // LVGL
151
   // LVGL
151
-
152
   #define HAS_SPI_FLASH_FONT                   1
152
   #define HAS_SPI_FLASH_FONT                   1
153
   #define HAS_GCODE_PREVIEW                    1
153
   #define HAS_GCODE_PREVIEW                    1
154
   #define HAS_GCODE_DEFAULT_VIEW_IN_FLASH      0
154
   #define HAS_GCODE_DEFAULT_VIEW_IN_FLASH      0
155
   #define HAS_LANG_SELECT_SCREEN               1
155
   #define HAS_LANG_SELECT_SCREEN               1
156
   #define HAS_BAK_VIEW_IN_FLASH                0
156
   #define HAS_BAK_VIEW_IN_FLASH                0
157
   #define HAS_LOGO_IN_FLASH                    0
157
   #define HAS_LOGO_IN_FLASH                    0
158
-
159
-  #define XPT2046_X_CALIBRATION           -17181
160
-  #define XPT2046_Y_CALIBRATION            11434
161
-  #define XPT2046_X_OFFSET                   501
162
-  #define XPT2046_Y_OFFSET                    -9
163
-
164
 #elif ENABLED(TFT_480x320)
158
 #elif ENABLED(TFT_480x320)
165
-
166
   // Color UI
159
   // Color UI
167
-
168
   #define TFT_DRIVER                     ILI9488
160
   #define TFT_DRIVER                     ILI9488
169
   #define TFT_BUFFER_SIZE                  14400
161
   #define TFT_BUFFER_SIZE                  14400
170
-
171
-  #define XPT2046_X_CALIBRATION           -17181
172
-  #define XPT2046_Y_CALIBRATION            11434
173
-  #define XPT2046_X_OFFSET                   501
174
-  #define XPT2046_Y_OFFSET                    -9
175
-
176
 #elif ENABLED(FSMC_GRAPHICAL_TFT)
162
 #elif ENABLED(FSMC_GRAPHICAL_TFT)
177
-
178
   // Emulated DOGM
163
   // Emulated DOGM
179
-
180
   #define GRAPHICAL_TFT_UPSCALE                3
164
   #define GRAPHICAL_TFT_UPSCALE                3
165
+#endif
166
+
167
+#if EITHER(HAS_TFT_LVGL_UI, TFT_480x320)
168
+  #ifndef XPT2046_X_CALIBRATION
169
+    #define XPT2046_X_CALIBRATION         -17181
170
+  #endif
171
+  #ifndef XPT2046_Y_CALIBRATION
172
+    #define XPT2046_Y_CALIBRATION          11434
173
+  #endif
174
+  #ifndef XPT2046_X_OFFSET
175
+    #define XPT2046_X_OFFSET                 501
176
+  #endif
177
+  #ifndef XPT2046_Y_OFFSET
178
+    #define XPT2046_Y_OFFSET                  -9
179
+  #endif
180
+#elif ENABLED(FSMC_GRAPHICAL_TFT)
181
   #ifndef XPT2046_X_CALIBRATION
181
   #ifndef XPT2046_X_CALIBRATION
182
     #define XPT2046_X_CALIBRATION         -12316
182
     #define XPT2046_X_CALIBRATION         -12316
183
   #endif
183
   #endif

+ 21
- 19
Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h View File

120
 #endif
120
 #endif
121
 
121
 
122
 // SPI Flash
122
 // SPI Flash
123
-#define SPI_FLASH_SIZE                  0x200000  // 2MB
124
 #define HAS_SPI_FLASH                          1
123
 #define HAS_SPI_FLASH                          1
124
+#if HAS_SPI_FLASH
125
+  #define SPI_FLASH_SIZE                0x200000  // 2MB
126
+#endif
125
 
127
 
126
 // SPI 2
128
 // SPI 2
127
 #define W25QXX_CS_PIN                       PB12
129
 #define W25QXX_CS_PIN                       PB12
158
 
160
 
159
 #endif
161
 #endif
160
 
162
 
161
-// LVGL Configs
162
 #if HAS_TFT_LVGL_UI
163
 #if HAS_TFT_LVGL_UI
163
-
164
+  // LVGL
164
   #define HAS_SPI_FLASH_FONT                   1
165
   #define HAS_SPI_FLASH_FONT                   1
165
   #define HAS_GCODE_PREVIEW                    1
166
   #define HAS_GCODE_PREVIEW                    1
166
   #define HAS_GCODE_DEFAULT_VIEW_IN_FLASH      0
167
   #define HAS_GCODE_DEFAULT_VIEW_IN_FLASH      0
167
   #define HAS_LANG_SELECT_SCREEN               1
168
   #define HAS_LANG_SELECT_SCREEN               1
168
   #define HAS_BAK_VIEW_IN_FLASH                0
169
   #define HAS_BAK_VIEW_IN_FLASH                0
169
   #define HAS_LOGO_IN_FLASH                    0
170
   #define HAS_LOGO_IN_FLASH                    0
170
-
171
-  #define XPT2046_X_CALIBRATION           -17181
172
-  #define XPT2046_Y_CALIBRATION            11434
173
-  #define XPT2046_X_OFFSET                   501
174
-  #define XPT2046_Y_OFFSET                    -9
175
-
176
-// Color UI Configs
177
 #elif ENABLED(TFT_480x320)
171
 #elif ENABLED(TFT_480x320)
178
-
172
+  // Color UI
179
   #define TFT_DRIVER                     ILI9488
173
   #define TFT_DRIVER                     ILI9488
180
   #define TFT_BUFFER_SIZE                  14400
174
   #define TFT_BUFFER_SIZE                  14400
181
-
182
-  #define XPT2046_X_CALIBRATION           -17181
183
-  #define XPT2046_Y_CALIBRATION            11434
184
-  #define XPT2046_X_OFFSET                   501
185
-  #define XPT2046_Y_OFFSET                    -9
186
-
187
-// Emulated DOGM
188
 #elif ENABLED(FSMC_GRAPHICAL_TFT)
175
 #elif ENABLED(FSMC_GRAPHICAL_TFT)
176
+  // Emulated DOGM
189
   #define GRAPHICAL_TFT_UPSCALE                3
177
   #define GRAPHICAL_TFT_UPSCALE                3
178
+#endif
190
 
179
 
180
+#if EITHER(HAS_TFT_LVGL_UI, TFT_480x320)
181
+  #ifndef XPT2046_X_CALIBRATION
182
+    #define XPT2046_X_CALIBRATION         -17181
183
+  #endif
184
+  #ifndef XPT2046_Y_CALIBRATION
185
+    #define XPT2046_Y_CALIBRATION          11434
186
+  #endif
187
+  #ifndef XPT2046_X_OFFSET
188
+    #define XPT2046_X_OFFSET                 501
189
+  #endif
190
+  #ifndef XPT2046_Y_OFFSET
191
+    #define XPT2046_Y_OFFSET                  -9
192
+  #endif
193
+#elif ENABLED(FSMC_GRAPHICAL_TFT)
191
   #ifndef XPT2046_X_CALIBRATION
194
   #ifndef XPT2046_X_CALIBRATION
192
     #define XPT2046_X_CALIBRATION         -12316
195
     #define XPT2046_X_CALIBRATION         -12316
193
   #endif
196
   #endif
200
   #ifndef XPT2046_Y_OFFSET
203
   #ifndef XPT2046_Y_OFFSET
201
     #define XPT2046_Y_OFFSET                 -20
204
     #define XPT2046_Y_OFFSET                 -20
202
   #endif
205
   #endif
203
-
204
 #endif
206
 #endif
205
 
207
 
206
 // SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available
208
 // SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available

+ 28
- 30
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h View File

269
 
269
 
270
 #endif
270
 #endif
271
 
271
 
272
-#if ENABLED(TFT_LVGL_UI_SPI)
273
-
274
-  // LVGL
275
-
276
-  #define XPT2046_X_CALIBRATION           -17253
277
-  #define XPT2046_Y_CALIBRATION            11579
278
-  #define XPT2046_X_OFFSET                   514
279
-  #define XPT2046_Y_OFFSET                   -24
280
-
281
-#elif ENABLED(SPI_GRAPHICAL_TFT)
282
-
272
+#if ENABLED(SPI_GRAPHICAL_TFT)
283
   // Emulated DOGM SPI
273
   // Emulated DOGM SPI
284
-
285
-  #ifndef XPT2046_X_CALIBRATION
286
-    #define XPT2046_X_CALIBRATION         -11386
287
-  #endif
288
-  #ifndef XPT2046_Y_CALIBRATION
289
-    #define XPT2046_Y_CALIBRATION           8684
290
-  #endif
291
-  #ifndef XPT2046_X_OFFSET
292
-    #define XPT2046_X_OFFSET                 339
293
-  #endif
294
-  #ifndef XPT2046_Y_OFFSET
295
-    #define XPT2046_Y_OFFSET                 -18
296
-  #endif
297
-
298
   #ifndef GRAPHICAL_TFT_UPSCALE
274
   #ifndef GRAPHICAL_TFT_UPSCALE
299
     #define GRAPHICAL_TFT_UPSCALE              3
275
     #define GRAPHICAL_TFT_UPSCALE              3
300
   #endif
276
   #endif
310
   #define LCD_PINS_RS                       PC6
286
   #define LCD_PINS_RS                       PC6
311
 
287
 
312
 #elif ENABLED(TFT_480x320_SPI)
288
 #elif ENABLED(TFT_480x320_SPI)
289
+  #define TFT_DRIVER                      ST7796
290
+  #define TFT_BUFFER_SIZE                  14400
291
+#endif
292
+
293
+#if EITHER(HAS_TFT_LVGL_UI, TFT_480x320_SPI)
294
+  #ifndef XPT2046_X_CALIBRATION
313
     #define XPT2046_X_CALIBRATION         -17253
295
     #define XPT2046_X_CALIBRATION         -17253
296
+  #endif
297
+  #ifndef XPT2046_Y_CALIBRATION
314
     #define XPT2046_Y_CALIBRATION          11579
298
     #define XPT2046_Y_CALIBRATION          11579
299
+  #endif
300
+  #ifndef XPT2046_X_OFFSET
315
     #define XPT2046_X_OFFSET                 514
301
     #define XPT2046_X_OFFSET                 514
302
+  #endif
303
+  #ifndef XPT2046_Y_OFFSET
316
     #define XPT2046_Y_OFFSET                 -24
304
     #define XPT2046_Y_OFFSET                 -24
317
-
318
-    #define TFT_DRIVER                    ST7796
319
-    #define TFT_BUFFER_SIZE                14400
320
-
305
+  #endif
306
+#elif ENABLED(SPI_GRAPHICAL_TFT)
307
+  #ifndef XPT2046_X_CALIBRATION
308
+    #define XPT2046_X_CALIBRATION         -11386
309
+  #endif
310
+  #ifndef XPT2046_Y_CALIBRATION
311
+    #define XPT2046_Y_CALIBRATION           8684
312
+  #endif
313
+  #ifndef XPT2046_X_OFFSET
314
+    #define XPT2046_X_OFFSET                 339
315
+  #endif
316
+  #ifndef XPT2046_Y_OFFSET
317
+    #define XPT2046_Y_OFFSET                 -18
318
+  #endif
321
 #endif
319
 #endif
322
 
320
 
323
 #if HAS_WIRED_LCD && !HAS_SPI_TFT
321
 #if HAS_WIRED_LCD && !HAS_SPI_TFT
364
 #endif // HAS_WIRED_LCD && !HAS_SPI_TFT
362
 #endif // HAS_WIRED_LCD && !HAS_SPI_TFT
365
 
363
 
366
 #define HAS_SPI_FLASH                          1
364
 #define HAS_SPI_FLASH                          1
367
-#define SPI_FLASH_SIZE                 0x1000000  // 16MB
368
 #if HAS_SPI_FLASH
365
 #if HAS_SPI_FLASH
366
+  #define SPI_FLASH_SIZE               0x1000000  // 16MB
369
   #define W25QXX_CS_PIN                     PB12
367
   #define W25QXX_CS_PIN                     PB12
370
   #define W25QXX_MOSI_PIN                   PB15
368
   #define W25QXX_MOSI_PIN                   PB15
371
   #define W25QXX_MISO_PIN                   PB14
369
   #define W25QXX_MISO_PIN                   PB14

+ 15
- 5
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h View File

139
  * If the screen stays white, disable 'LCD_RESET_PIN'
139
  * If the screen stays white, disable 'LCD_RESET_PIN'
140
  * to let the bootloader init the screen.
140
  * to let the bootloader init the screen.
141
  */
141
  */
142
-  #define XPT2046_X_CALIBRATION            12033
143
-  #define XPT2046_Y_CALIBRATION            -9047
144
-  #define XPT2046_X_OFFSET                   -30
145
-  #define XPT2046_Y_OFFSET                   254
142
+#if ENABLED(TOUCH_SCREEN)
143
+  #ifndef XPT2046_X_CALIBRATION
144
+    #define XPT2046_X_CALIBRATION          12033
145
+  #endif
146
+  #ifndef XPT2046_Y_CALIBRATION
147
+    #define XPT2046_Y_CALIBRATION          -9047
148
+  #endif
149
+  #ifndef XPT2046_X_OFFSET
150
+    #define XPT2046_X_OFFSET                 -30
151
+  #endif
152
+  #ifndef XPT2046_Y_OFFSET
153
+    #define XPT2046_Y_OFFSET                 254
154
+  #endif
155
+#endif
146
 
156
 
147
 #if ENABLED(FSMC_GRAPHICAL_TFT)
157
 #if ENABLED(FSMC_GRAPHICAL_TFT)
148
 
158
 
191
 #endif
201
 #endif
192
 
202
 
193
 #define HAS_SPI_FLASH                          1
203
 #define HAS_SPI_FLASH                          1
194
-#define SPI_FLASH_SIZE                 0x1000000  // 16MB
195
 #if HAS_SPI_FLASH
204
 #if HAS_SPI_FLASH
205
+  #define SPI_FLASH_SIZE               0x1000000  // 16MB
196
   #define W25QXX_CS_PIN                     PB12  // Flash chip-select
206
   #define W25QXX_CS_PIN                     PB12  // Flash chip-select
197
   #define W25QXX_MOSI_PIN                   PB15
207
   #define W25QXX_MOSI_PIN                   PB15
198
   #define W25QXX_MISO_PIN                   PB14
208
   #define W25QXX_MISO_PIN                   PB14

+ 36
- 51
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h View File

195
   #define TOUCH_BUTTONS_HW_SPI_DEVICE          2
195
   #define TOUCH_BUTTONS_HW_SPI_DEVICE          2
196
 #endif
196
 #endif
197
 
197
 
198
-// LVGL Configs
199
-#if ENABLED(TFT_LVGL_UI_FSMC)
200
-
201
-  #ifndef XPT2046_X_CALIBRATION
202
-    #define XPT2046_X_CALIBRATION          17880
203
-  #endif
204
-  #ifndef XPT2046_Y_CALIBRATION
205
-    #define XPT2046_Y_CALIBRATION         -12234
206
-  #endif
207
-  #ifndef XPT2046_X_OFFSET
208
-    #define XPT2046_X_OFFSET                 -45
209
-  #endif
210
-  #ifndef XPT2046_Y_OFFSET
211
-   #define XPT2046_Y_OFFSET                  349
212
-  #endif
213
-
214
-// Emulated DOGM Configs
215
-#elif ENABLED(FSMC_GRAPHICAL_TFT)
216
-
198
+#if ENABLED(FSMC_GRAPHICAL_TFT)
199
+  // Emulated DOGM
217
   #define DOGLCD_MOSI                       -1    // prevent redefine Conditionals_post.h
200
   #define DOGLCD_MOSI                       -1    // prevent redefine Conditionals_post.h
218
   #define DOGLCD_SCK                        -1
201
   #define DOGLCD_SCK                        -1
219
 
202
 
233
     #define TFT_PIXEL_OFFSET_Y                32
216
     #define TFT_PIXEL_OFFSET_Y                32
234
   #endif
217
   #endif
235
 
218
 
236
-  #ifndef XPT2046_X_CALIBRATION
237
-    #define XPT2046_X_CALIBRATION          12149
238
-  #endif
239
-  #ifndef XPT2046_Y_CALIBRATION
240
-    #define XPT2046_Y_CALIBRATION          -8746
241
-  #endif
242
-  #ifndef XPT2046_X_OFFSET
243
-    #define XPT2046_X_OFFSET                 -35
244
-  #endif
245
-  #ifndef XPT2046_Y_OFFSET
246
-    #define XPT2046_Y_OFFSET                 256
247
-  #endif
248
-
249
 #elif ENABLED(TFT_320x240)                        // TFT32/28
219
 #elif ENABLED(TFT_320x240)                        // TFT32/28
250
   #define TFT_RESET_PIN                     PC6
220
   #define TFT_RESET_PIN                     PC6
251
   #define TFT_BACKLIGHT_PIN                 PD13
221
   #define TFT_BACKLIGHT_PIN                 PD13
256
   #define FSMC_DMA_DEV                      DMA2
226
   #define FSMC_DMA_DEV                      DMA2
257
   #define FSMC_DMA_CHANNEL               DMA_CH5
227
   #define FSMC_DMA_CHANNEL               DMA_CH5
258
 
228
 
259
-  #ifndef XPT2046_X_CALIBRATION
260
-    #define XPT2046_X_CALIBRATION         -12246
261
-  #endif
262
-  #ifndef XPT2046_Y_CALIBRATION
263
-    #define XPT2046_Y_CALIBRATION           9453
264
-  #endif
265
-  #ifndef XPT2046_X_OFFSET
266
-    #define XPT2046_X_OFFSET                 360
267
-  #endif
268
-  #ifndef XPT2046_Y_OFFSET
269
-    #define XPT2046_Y_OFFSET                 -22
270
-  #endif
271
-
272
   #define TOUCH_CS_PIN                      PA7   // SPI2_NSS
229
   #define TOUCH_CS_PIN                      PA7   // SPI2_NSS
273
   #define TOUCH_SCK_PIN                     PB13  // SPI2_SCK
230
   #define TOUCH_SCK_PIN                     PB13  // SPI2_SCK
274
   #define TOUCH_MISO_PIN                    PB14  // SPI2_MISO
231
   #define TOUCH_MISO_PIN                    PB14  // SPI2_MISO
285
   #define ILI9341_COLOR_RGB
242
   #define ILI9341_COLOR_RGB
286
 
243
 
287
 #elif ENABLED(TFT_480x320)
244
 #elif ENABLED(TFT_480x320)
245
+  #define TFT_DRIVER                     ILI9488
246
+  #define TFT_BUFFER_SIZE                  14400
247
+  #define ILI9488_ORIENTATION               ILI9488_MADCTL_MX | ILI9488_MADCTL_MV
248
+#endif
249
+
250
+#if EITHER(TFT_LVGL_UI_FSMC, TFT_480x320)
288
   #ifndef XPT2046_X_CALIBRATION
251
   #ifndef XPT2046_X_CALIBRATION
289
     #define XPT2046_X_CALIBRATION          17880
252
     #define XPT2046_X_CALIBRATION          17880
290
   #endif
253
   #endif
295
     #define XPT2046_X_OFFSET                 -45
258
     #define XPT2046_X_OFFSET                 -45
296
   #endif
259
   #endif
297
   #ifndef XPT2046_Y_OFFSET
260
   #ifndef XPT2046_Y_OFFSET
298
-    #define XPT2046_Y_OFFSET                 349
261
+   #define XPT2046_Y_OFFSET                  349
262
+  #endif
263
+#elif ENABLED(FSMC_GRAPHICAL_TFT)
264
+  #ifndef XPT2046_X_CALIBRATION
265
+    #define XPT2046_X_CALIBRATION          12149
266
+  #endif
267
+  #ifndef XPT2046_Y_CALIBRATION
268
+    #define XPT2046_Y_CALIBRATION          -8746
269
+  #endif
270
+  #ifndef XPT2046_X_OFFSET
271
+    #define XPT2046_X_OFFSET                 -35
272
+  #endif
273
+  #ifndef XPT2046_Y_OFFSET
274
+    #define XPT2046_Y_OFFSET                 256
275
+  #endif
276
+#elif ENABLED(TFT_320x240)                        // TFT32/28
277
+  #ifndef XPT2046_X_CALIBRATION
278
+    #define XPT2046_X_CALIBRATION         -12246
279
+  #endif
280
+  #ifndef XPT2046_Y_CALIBRATION
281
+    #define XPT2046_Y_CALIBRATION           9453
282
+  #endif
283
+  #ifndef XPT2046_X_OFFSET
284
+    #define XPT2046_X_OFFSET                 360
285
+  #endif
286
+  #ifndef XPT2046_Y_OFFSET
287
+    #define XPT2046_Y_OFFSET                 -22
299
   #endif
288
   #endif
300
-
301
-  #define TFT_DRIVER                     ILI9488
302
-  #define TFT_BUFFER_SIZE                  14400
303
-  #define ILI9488_ORIENTATION               ILI9488_MADCTL_MX | ILI9488_MADCTL_MV
304
 #endif
289
 #endif
305
 
290
 
306
 #define HAS_SPI_FLASH                          1
291
 #define HAS_SPI_FLASH                          1
307
-#define SPI_FLASH_SIZE                 0x1000000  // 16MB
308
 #if HAS_SPI_FLASH
292
 #if HAS_SPI_FLASH
293
+  #define SPI_FLASH_SIZE               0x1000000  // 16MB
309
   #define W25QXX_CS_PIN                     PB12
294
   #define W25QXX_CS_PIN                     PB12
310
   #define W25QXX_MOSI_PIN                   PB15
295
   #define W25QXX_MOSI_PIN                   PB15
311
   #define W25QXX_MISO_PIN                   PB14
296
   #define W25QXX_MISO_PIN                   PB14

+ 20
- 30
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h View File

281
 
281
 
282
 #endif
282
 #endif
283
 
283
 
284
-#if ENABLED(TFT_LVGL_UI_SPI)
285
-
286
-  // LVGL
287
-
288
-  #define XPT2046_X_CALIBRATION           -17253
289
-  #define XPT2046_Y_CALIBRATION            11579
290
-  #define XPT2046_X_OFFSET                   514
291
-  #define XPT2046_Y_OFFSET                   -24
292
-
293
-#elif ENABLED(SPI_GRAPHICAL_TFT)
294
-
284
+#if ENABLED(SPI_GRAPHICAL_TFT)
295
   // Emulated DOGM SPI
285
   // Emulated DOGM SPI
296
-
297
-  #ifndef XPT2046_X_CALIBRATION
298
-    #define XPT2046_X_CALIBRATION         -11386
299
-  #endif
300
-  #ifndef XPT2046_Y_CALIBRATION
301
-    #define XPT2046_Y_CALIBRATION           8684
302
-  #endif
303
-  #ifndef XPT2046_X_OFFSET
304
-    #define XPT2046_X_OFFSET                 339
305
-  #endif
306
-  #ifndef XPT2046_Y_OFFSET
307
-    #define XPT2046_Y_OFFSET                 -18
308
-  #endif
309
-
310
   #ifndef GRAPHICAL_TFT_UPSCALE
286
   #ifndef GRAPHICAL_TFT_UPSCALE
311
     #define GRAPHICAL_TFT_UPSCALE              3
287
     #define GRAPHICAL_TFT_UPSCALE              3
312
   #endif
288
   #endif
322
   #define LCD_PINS_RS                       PC6
298
   #define LCD_PINS_RS                       PC6
323
 
299
 
324
 #elif ENABLED(TFT_480x320_SPI)
300
 #elif ENABLED(TFT_480x320_SPI)
301
+  #define TFT_DRIVER                      ST7796
302
+  #define TFT_BUFFER_SIZE                  14400
303
+#endif
304
+
305
+#if EITHER(TFT_LVGL_UI_SPI, TFT_480x320_SPI)
325
   #ifndef XPT2046_X_CALIBRATION
306
   #ifndef XPT2046_X_CALIBRATION
326
     #define XPT2046_X_CALIBRATION         -17253
307
     #define XPT2046_X_CALIBRATION         -17253
327
   #endif
308
   #endif
334
   #ifndef XPT2046_Y_OFFSET
315
   #ifndef XPT2046_Y_OFFSET
335
     #define XPT2046_Y_OFFSET                 -24
316
     #define XPT2046_Y_OFFSET                 -24
336
   #endif
317
   #endif
337
-
338
-  #define TFT_DRIVER                      ST7796
339
-  #define TFT_BUFFER_SIZE                  14400
340
-
318
+#elif ENABLED(SPI_GRAPHICAL_TFT)
319
+  #ifndef XPT2046_X_CALIBRATION
320
+    #define XPT2046_X_CALIBRATION         -11386
321
+  #endif
322
+  #ifndef XPT2046_Y_CALIBRATION
323
+    #define XPT2046_Y_CALIBRATION           8684
324
+  #endif
325
+  #ifndef XPT2046_X_OFFSET
326
+    #define XPT2046_X_OFFSET                 339
327
+  #endif
328
+  #ifndef XPT2046_Y_OFFSET
329
+    #define XPT2046_Y_OFFSET                 -18
330
+  #endif
341
 #endif
331
 #endif
342
 
332
 
343
 #if HAS_WIRED_LCD && !HAS_SPI_TFT
333
 #if HAS_WIRED_LCD && !HAS_SPI_TFT
393
 #endif // HAS_WIRED_LCD && !HAS_SPI_TFT
383
 #endif // HAS_WIRED_LCD && !HAS_SPI_TFT
394
 
384
 
395
 #define HAS_SPI_FLASH                          1
385
 #define HAS_SPI_FLASH                          1
396
-#define SPI_FLASH_SIZE                 0x1000000  // 16MB
397
 #if HAS_SPI_FLASH
386
 #if HAS_SPI_FLASH
387
+  #define SPI_FLASH_SIZE               0x1000000  // 16MB
398
   #define W25QXX_CS_PIN                     PB12
388
   #define W25QXX_CS_PIN                     PB12
399
   #define W25QXX_MOSI_PIN                   PB15
389
   #define W25QXX_MOSI_PIN                   PB15
400
   #define W25QXX_MISO_PIN                   PB14
390
   #define W25QXX_MISO_PIN                   PB14

Loading…
Cancel
Save