acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

TFT_config.h (9651B)

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