TFT Presets, Generic options, Sanity checks (#19723)

This commit is contained in:
Scott Lahteine
2020-10-15 03:00:27 -05:00
committed by GitHub
parent 04c27573d6
commit f6ffbe548c
116 changed files with 593 additions and 599 deletions

View File

@@ -139,6 +139,35 @@
* If the screen stays white, disable 'LCD_RESET_PIN'
* to let the bootloader init the screen.
*/
#if EITHER(HAS_FSMC_GRAPHICAL_TFT, TFT_320x240)
#define FSMC_CS_PIN PD7 // NE4
#define FSMC_RS_PIN PD11 // A0
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
#define FSMC_DMA_DEV DMA2
#define FSMC_DMA_CHANNEL DMA_CH5
#define LCD_RESET_PIN PC6 // FSMC_RST
#define LCD_BACKLIGHT_PIN PD13
#endif
#if BOTH(NEED_TOUCH_PINS, HAS_FSMC_GRAPHICAL_TFT) || ENABLED(TFT_320x240)
#define TOUCH_CS_PIN PC2 // SPI2_NSS
#define TOUCH_SCK_PIN PB13 // SPI2_SCK
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
#define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
#endif
#if ENABLED(TFT_320x240) // TFT32/28
#define TFT_DRIVER ILI9341
#define TFT_BUFFER_SIZE 14400
#define ILI9341_COLOR_RGB
// YV for normal screen mounting
#define ILI9341_ORIENTATION ILI9341_MADCTL_MY | ILI9341_MADCTL_MV
// XV for 180° rotated screen mounting
//#define ILI9341_ORIENTATION ILI9341_MADCTL_MX | ILI9341_MADCTL_MV
#endif
#if ENABLED(TOUCH_SCREEN)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION 12033
@@ -154,52 +183,6 @@
#endif
#endif
#if ENABLED(FSMC_GRAPHICAL_TFT)
#define FSMC_CS_PIN PD7 // NE4
#define FSMC_RS_PIN PD11 // A0
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
#define FSMC_DMA_DEV DMA2
#define FSMC_DMA_CHANNEL DMA_CH5
#define LCD_RESET_PIN PC6 // FSMC_RST
#define LCD_BACKLIGHT_PIN PD13
#if NEED_TOUCH_PINS
#define TOUCH_CS_PIN PC2 // SPI2_NSS
#define TOUCH_SCK_PIN PB13 // SPI2_SCK
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
#define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
#endif
#elif ENABLED(TFT_320x240) //TFT32/28
#define TFT_RESET_PIN PC6
#define TFT_BACKLIGHT_PIN PD13
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
#define FSMC_CS_PIN PD7
#define FSMC_RS_PIN PD11
#define FSMC_DMA_DEV DMA2
#define FSMC_DMA_CHANNEL DMA_CH5
#define TOUCH_CS_PIN PC2 // SPI2_NSS
#define TOUCH_SCK_PIN PB13 // SPI2_SCK
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
#define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
#define TFT_DRIVER ILI9341
#define TFT_BUFFER_SIZE 14400
// YV for normal screen mounting
#define ILI9341_ORIENTATION ILI9341_MADCTL_MY | ILI9341_MADCTL_MV
// XV for 180° rotated screen mounting
//#define ILI9341_ORIENTATION ILI9341_MADCTL_MX | ILI9341_MADCTL_MV
#define ILI9341_COLOR_RGB
#endif
#define HAS_SPI_FLASH 1
#if HAS_SPI_FLASH
#define SPI_FLASH_SIZE 0x1000000 // 16MB