acidportal

- 😈 Worlds smallest Evil Portal on a LilyGo T-QT
git clone git://git.acid.vegas/acidportal.git
Log | Files | Refs | Archive | README | LICENSE

TFT_config.h (9704B)

      1 
      2 ///////////////////////////////////////////////////////////
      3 /*           Support file for ESP32 IDF use              */
      4 /*              See library docs folder                  */
      5 /*                                                       */
      6 /*              DO NOT EDIT THIS FILE                    */
      7 /*                                                       */
      8 ///////////////////////////////////////////////////////////
      9 
     10 /**
     11  * @file   TFT_config.h
     12  * @author Ricard Bitriá Ribes (https://github.com/dracir9)
     13  * Created Date: 22-01-2022
     14  * -----
     15  * Last Modified: 25-02-2023
     16  * Modified By: Ricard Bitriá Ribes
     17  * -----
     18  * @copyright (c) 2022 Ricard Bitriá Ribes
     19  */
     20 
     21 #ifndef TFT_CONFIG_H
     22 #define TFT_CONFIG_H
     23 
     24 #include "sdkconfig.h"
     25 
     26 /***************************************************************************************
     27 **                         Others
     28 ***************************************************************************************/
     29 
     30 #ifdef CONFIG_DISABLE_WARNINGS
     31     #define DISABLE_ALL_LIBRARY_WARNINGS
     32 #endif
     33 
     34 /***************************************************************************************
     35 **                         TFT_eSPI Configuration defines
     36 ***************************************************************************************/
     37 // Override defaults
     38 #define USER_SETUP_LOADED
     39 
     40 /***************************************************************************************
     41 **                         Section 1: Load TFT driver
     42 ***************************************************************************************/
     43 #if defined (CONFIG_TFT_ILI9341_DRIVER)
     44     #define ILI9341_DRIVER
     45 #elif defined (CONFIG_TFT_ILI9341_2_DRIVER)
     46     #define ILI9341_2_DRIVER
     47 #elif defined (CONFIG_TFT_ST7735_DRIVER)
     48     #define ST7735_DRIVER
     49 #elif defined (CONFIG_TFT_ILI9163_DRIVER)
     50     #define ILI9163_DRIVER
     51 #elif defined (CONFIG_TFT_S6D02A1_DRIVER)
     52     #define S6D02A1_DRIVER
     53 #elif defined (CONFIG_TFT_HX8357D_DRIVER)
     54     #define HX8357D_DRIVER
     55 #elif defined (CONFIG_TFT_ILI9481_DRIVER)
     56     #define ILI9481_DRIVER
     57 #elif defined (CONFIG_TFT_ILI9486_DRIVER)
     58     #define ILI9486_DRIVER
     59 #elif defined (CONFIG_TFT_ILI9488_DRIVER)
     60     #define ILI9488_DRIVER
     61 #elif defined (CONFIG_TFT_ST7789_DRIVER)
     62     #define ST7789_DRIVER
     63 #elif defined (CONFIG_TFT_ST7789_2_DRIVER)
     64     #define ST7789_2_DRIVER
     65 #elif defined (CONFIG_TFT_R61581_DRIVER)
     66     #define R61581_DRIVER
     67 #elif defined (CONFIG_TFT_RM68140_DRIVER)
     68     #define RM68140_DRIVER
     69 #elif defined (CONFIG_TFT_ST7796_DRIVER)
     70     #define ST7796_DRIVER
     71 #elif defined (CONFIG_TFT_SSD1351_DRIVER)
     72     #define SSD1351_DRIVER
     73 #elif defined (CONFIG_TFT_SSD1963_480_DRIVER)
     74     #define SSD1963_480_DRIVER
     75 #elif defined (CONFIG_TFT_SSD1963_800_DRIVER)
     76     #define SSD1963_800_DRIVER
     77 #elif defined (CONFIG_TFT_SSD1963_800ALT_DRIVER)
     78     #define SSD1963_800ALT_DRIVER
     79 #elif defined (CONFIG_TFT_ILI9225_DRIVER)
     80     #define ILI9225_DRIVER
     81 #elif defined (CONFIG_TFT_GC9A01_DRIVER)
     82     #define GC9A01_DRIVER
     83 #endif
     84 
     85 #ifdef CONFIG_TFT_RGB_ORDER
     86     #define TFT_RGB_ORDER TFT_RGB
     87 #endif
     88 
     89 #ifdef CONFIG_TFT_BGR_ORDER
     90     #define TFT_RGB_ORDER TFT_BGR
     91 #endif
     92 
     93 #ifdef CONFIG_TFT_M5STACK
     94     #define M5STACK
     95 #endif
     96 
     97 #ifdef CONFIG_TFT_WIDTH
     98     #define TFT_WIDTH   CONFIG_TFT_WIDTH
     99 #endif
    100 
    101 #ifdef CONFIG_TFT_HEIGHT
    102     #define TFT_HEIGHT   CONFIG_TFT_HEIGHT
    103 #endif
    104 
    105 #if defined (CONFIG_TFT_ST7735_INITB)
    106     #define ST7735_INITB
    107 #elif defined (CONFIG_TFT_ST7735_GREENTAB)
    108     #define ST7735_GREENTAB
    109 #elif defined (CONFIG_TFT_ST7735_GREENTAB2)
    110     #define ST7735_GREENTAB2
    111 #elif defined (CONFIG_TFT_ST7735_GREENTAB3)
    112     #define ST7735_GREENTAB3
    113 #elif defined (CONFIG_TFT_ST7735_GREENTAB128)
    114     #define ST7735_GREENTAB128
    115 #elif defined (CONFIG_TFT_ST7735_GREENTAB160x80)
    116     #define ST7735_GREENTAB160x80
    117 #elif defined (CONFIG_TFT_ST7735_REDTAB)
    118     #define ST7735_REDTAB
    119 #elif defined (CONFIG_TFT_ST7735_BLACKTAB)
    120     #define ST7735_BLACKTAB
    121 #elif defined (CONFIG_TFT_ST7735_REDTAB160x80)
    122     #define ST7735_REDTAB160x80
    123 #endif
    124 
    125 #if defined (CONFIG_TFT_INVERSION_ON)
    126     #define TFT_INVERSION_ON
    127 #elif defined (CONFIG_TFT_INVERSION_OFF)
    128     #define TFT_INVERSION_OFF
    129 #endif
    130 
    131 /***************************************************************************************
    132 **                         Section 2: General Pin configuration
    133 ***************************************************************************************/
    134 // General pins
    135 #if CONFIG_TFT_CS == -1
    136     #error "Invalid Chip Select pin. Check TFT_eSPI configuration"
    137 #else
    138     #define TFT_CS          CONFIG_TFT_CS
    139 #endif
    140 
    141 #if CONFIG_TFT_DC == -1
    142     #error "Invalid Data/Command pin. Check TFT_eSPI configuration"
    143 #else
    144     #define TFT_DC          CONFIG_TFT_DC
    145 #endif
    146 
    147 #if CONFIG_TFT_RST == -1
    148     #if !defined(DISABLE_ALL_LIBRARY_WARNINGS)
    149         #warning "Invalid Reset pin. Check TFT_eSPI configuration"
    150     #endif
    151 #else
    152     #define TFT_RST         CONFIG_TFT_RST
    153 #endif
    154 
    155 // Backlight config
    156 #ifdef CONFIG_ENABLE_BL
    157     #if CONFIG_TFT_BL == -1
    158         #error "Invalid backlight control pin. Check TFT_eSPI configuration"
    159     #else
    160         #define TFT_BL      CONFIG_TFT_BL
    161     #endif
    162 
    163     #define TFT_BACKLIGHT_ON CONFIG_TFT_BACKLIGHT_ON
    164 #endif
    165 
    166 
    167 /***************************************************************************************
    168 **                         Section 3: Data bus Pin configuration
    169 ***************************************************************************************/
    170 
    171 // 8 BIT PARALLEL BUS
    172 #ifdef CONFIG_TFT_PARALLEL_8_BIT
    173 
    174     #define TFT_PARALLEL_8_BIT
    175 
    176     #if CONFIG_TFT_D0 == -1
    177         #error "Invalid Data 0 pin. Check TFT_eSPI configuration"
    178     #else
    179         #define TFT_D0      CONFIG_TFT_D0
    180     #endif
    181 
    182     #if CONFIG_TFT_D1 == -1
    183         #error "Invalid Data 1 pin. Check TFT_eSPI configuration"
    184     #else
    185         #define TFT_D1      CONFIG_TFT_D1
    186     #endif
    187 
    188     #if CONFIG_TFT_D2 == -1
    189         #error "Invalid Data 2 pin. Check TFT_eSPI configuration"
    190     #else
    191         #define TFT_D2      CONFIG_TFT_D2
    192     #endif
    193 
    194     #if CONFIG_TFT_D3 == -1
    195         #error "Invalid Data 3 pin. Check TFT_eSPI configuration"
    196     #else
    197         #define TFT_D3      CONFIG_TFT_D3
    198     #endif
    199 
    200     #if CONFIG_TFT_D4 == -1
    201         #error "Invalid Data 4 pin. Check TFT_eSPI configuration"
    202     #else
    203         #define TFT_D4      CONFIG_TFT_D4
    204     #endif
    205 
    206     #if CONFIG_TFT_D5 == -1
    207         #error "Invalid Data 5 pin. Check TFT_eSPI configuration"
    208     #else
    209         #define TFT_D5      CONFIG_TFT_D5
    210     #endif
    211 
    212     #if CONFIG_TFT_D6 == -1
    213         #error "Invalid Data 6 pin. Check TFT_eSPI configuration"
    214     #else
    215         #define TFT_D6      CONFIG_TFT_D6
    216     #endif
    217 
    218     #if CONFIG_TFT_D7 == -1
    219         #error "Invalid Data 7 pin. Check TFT_eSPI configuration"
    220     #else
    221         #define TFT_D7      CONFIG_TFT_D7
    222     #endif
    223     
    224     #if CONFIG_TFT_WR == -1
    225         #error "Invalid Write strobe pin. Check TFT_eSPI configuration"
    226     #else
    227         #define TFT_WR      CONFIG_TFT_WR
    228     #endif
    229 
    230     #if CONFIG_TFT_RD == -1
    231         #error "Invalid Read strobe pin. Check TFT_eSPI configuration"
    232     #else
    233         #define TFT_RD      CONFIG_TFT_RD
    234     #endif
    235 
    236 // SPI BUS
    237 #else
    238     #if CONFIG_TFT_HSPI_PORT
    239         #define USE_HSPI_PORT
    240     #endif
    241 
    242     #if CONFIG_TFT_MISO != -1
    243         #define TFT_MISO      CONFIG_TFT_MISO
    244     #endif
    245 
    246     #if CONFIG_TFT_MOSI == -1
    247         #error "Invalid MOSI pin. Check TFT_eSPI configuration"
    248     #else
    249         #define TFT_MOSI      CONFIG_TFT_MOSI
    250     #endif
    251 
    252     #if CONFIG_TFT_SCLK == -1
    253         #error "Invalid Clock pin. Check TFT_eSPI configuration"
    254     #else
    255         #define TFT_SCLK      CONFIG_TFT_SCLK
    256     #endif
    257 
    258     #define SPI_FREQUENCY   CONFIG_TFT_SPI_FREQUENCY
    259 
    260     #if CONFIG_TFT_SPI_READ_FREQ != -1
    261         #define SPI_READ_FREQUENCY CONFIG_TFT_SPI_READ_FREQ
    262     #endif
    263     
    264     #ifdef CONFIG_TFT_SDA_READ
    265         #define TFT_SDA_READ
    266     #endif
    267 #endif
    268 
    269 
    270 /***************************************************************************************
    271 **                         Section 4: Setup Fonts
    272 ***************************************************************************************/
    273 
    274 #ifdef CONFIG_TFT_LOAD_GLCD
    275     #define LOAD_GLCD       // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
    276 #endif
    277 
    278 #ifdef CONFIG_TFT_LOAD_FONT2
    279     #define LOAD_FONT2      // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
    280 #endif
    281 
    282 #ifdef CONFIG_TFT_LOAD_FONT4
    283     #define LOAD_FONT4      // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
    284 #endif
    285 
    286 #ifdef CONFIG_TFT_LOAD_FONT6
    287     #define LOAD_FONT6      // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
    288 #endif
    289 
    290 #ifdef CONFIG_TFT_LOAD_FONT7
    291     #define LOAD_FONT7      // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
    292 #endif
    293 
    294 #ifdef CONFIG_TFT_LOAD_FONT8
    295     #define LOAD_FONT8      // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
    296 #endif
    297 
    298 #ifdef CONFIG_TFT_LOAD_GFXFF
    299     #define LOAD_GFXFF      // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
    300 #endif
    301 
    302 #if CONFIG_TFT_SMOOTH_FONT
    303     #define SMOOTH_FONT
    304 #endif
    305 
    306 /***************************************************************************************
    307 **                         Section 5: Touchscreen configuration
    308 ***************************************************************************************/
    309 
    310 #ifdef CONFIG_ENABLE_TOUCH
    311     #if CONFIG_TOUCH_CS == -1
    312         #error "Invalid Touch Chip Select pin. Check TFT_eSPI configuration"
    313     #else
    314         #define TOUCH_CS            CONFIG_TOUCH_CS
    315     #endif
    316 
    317     #define SPI_TOUCH_FREQUENCY CONFIG_SPI_TOUCH_FREQUENCY
    318 #endif
    319 
    320 #endif // TFT_CONFIG_H