;***************************************************;
;          Lanbon L8 Switch with ST7789V TFT 2.4"   ;
;               - Custom ESP32 pcb                  ;
;               - ST7789V TFT                       ;
;               - FT5206 touch controller           ;
;***************************************************;

[env:lanbon_l8]
extends = esp32
board = esp32dev
board_upload.flash_size=8MB
board_upload.maximum_size = 8388608
board_build.partitions = user_setups/esp32/partitions_8MB.csv

build_flags =
    ${env.build_flags}
    ${esp32.build_flags}
    ${esp32.ps_ram}
    -D HASP_MODEL="Lanbon L8"

;region -- TFT_eSPI build options ------------------------
    ${lcd.st7789v}
    -D LANBONL8
    -D TFT_RST=18        ; FCP pin2 RESET
    -D TFT_SCLK=19       ; FCP pin3 SCL
    -D TFT_DC=21         ; FCP pin4 D/C
    -D TFT_CS=22         ; FCP pin5 CS
    -D TFT_MOSI=23       ; FCP pin6 SDA
    -D TFT_MISO=25       ; FCP pin7 SDO
    -D TFT_BCKL=5
    -D TOUCH_DRIVER=5206
    -D TOUCH_SDA=4
    -D TOUCH_SCL=0
    -D TOUCH_IRQ=-1   ; not connected
    -D TOUCH_RST=-1   ; not used, connected to 3.3V on FCP pin10
    -D TOUCH_FREQUENCY=400000
    -D LED_RED=26
    -D LED_GREEN=32
    -D LED_BLUE=33
    -D RELAY_1=12
    -D RELAY_2=24
    -D RELAY_3=37
;endregion

;region -- Library options -------------------------------
lib_deps =
    ${env.lib_deps}
    ${esp32.lib_deps}
    ;git+https://github.com/lvgl/lvgl_esp32_drivers.git
    git+https://github.com/aselectroworks/Arduino-FT6336U.git

lib_ignore =
    ${env.lib_ignore}
    ${esp32.lib_ignore}
    ESP32 BLE Arduino
;endregion
