;***************************************************;
;          Generic ESP32 build with                 ;
;               - ESP32dev board                    ;
;               - ili9488 TFT                       ;
;               - GT911 touch controller            ;
;***************************************************;

[env:esp32dev-mrb3511]
extends = arduino_esp32_v2, flash_4mb
board = esp32dev

build_flags =
    ${arduino_esp32_v2.build_flags}
    ${esp32.no_ps_ram}

;region -- TFT_eSPI build options ------------------------
    ${lcd.mrb3511}
    -D TFT_BCKL=5  ;None, configurable via web UI (e.g. 2 for D4)
    -D TFT_CS=33  ; Chip select control pin
    -D TFT_DC=15  ; =RS; Data Command control pin - must use a pin in the range 0-31
    -D TFT_RST=32 ; Reset pin
    -D TFT_WR=4   ; Write strobe control pin - must use a pin in the range 0-31
    -D TFT_RD=2
    -D TFT_D0=12  ; Must use pins in the range 0-31 for the data bus
    -D TFT_D1=13  ; so a single register write sets/clears all bits
    -D TFT_D2=26
    -D TFT_D3=25
    -D TFT_D4=17
    -D TFT_D5=16
    -D TFT_D6=27
    -D TFT_D7=14
    -D TOUCH_SDA=21
    -D TOUCH_SCL=22
    -D TOUCH_IRQ=34   ; use 34-39 as these are input only pins
    -D TOUCH_RST=-1   ; not used, connected to 3.3V
;endregion

; -- Debugging options -----------------------------
;   -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG

lib_deps =
    ${arduino_esp32_v2.lib_deps}
    ${tft_espi.lib_deps}
    ${goodix.lib_deps}
    ; adafruit/Adafruit GFX Library @ ^1.10.3
    ; adafruit/Adafruit BusIO @ ^1.6.0
