;***************************************************;
;   Makerfabs TFT Touch with camera 3.5" Capacitive ;
;               - 3.5" ili9488 TFT SPI 4-WIRE       ;
;               - FT6236 touch controller           ;
;***************************************************;

[makerfabs-tft35-cap]
extends = arduino_esp32_v2
board = esp32dev

build_flags =
    -D HASP_MODEL="Makerfabs TFT Touch 3.5 Capacitive"
    ${arduino_esp32_v2.build_flags}
    ${esp32.hspi}        ; Use HSPI hardware SPI bus
    ${esp32.ps_ram}

;region -- TFT_eSPI build options ------------------------
    -D USER_SETUP_LOADED=1
    -D ILI9488_DRIVER=1
    -D SUPPORT_TRANSACTIONS
    -D TFT_ROTATION=0 ; 0=0, 1=90, 2=180 or 3=270 degree
    -D TFT_WIDTH=320
    -D TFT_HEIGHT=480
    -D TFT_RST=26
    -D TFT_DC=33
    -D TFT_CS=15
    -D TFT_BCKL=-1    ; Needs soldering R31
    -D SPI_FREQUENCY=60000000
    -D TOUCH_DRIVER=0x6336
    -D TOUCH_SDA=26
    -D TOUCH_SCL=27
    -D TOUCH_IRQ=0
    -D TOUCH_RST=-1
    -D I2C_TOUCH_FREQUENCY=400000
    -D I2C_TOUCH_ADDRESS=0x38
;endregion

lib_deps =
    ${arduino_esp32_v2.lib_deps}
    ${tft_espi.lib_deps}
    ${ft6336.lib_deps}

[env:makerfabs-tft35-cap_4MB]
extends = makerfabs-tft35-cap, flash_4mb

[env:makerfabs-tft35-cap_16MB]
extends = makerfabs-tft35-cap, flash_16mb
