;***************************************************;
;          STM32F4 build with                       ;
;               - DIY_more board                    ;
;               - ili9341 TFT                       ;
;               - xpt2046 touch controller          ;
;***************************************************;

[env:black_f407vg]
extends = stm32f4
board = diymore_f407vgt
board_build.mcu = stm32f407vgt6
upload_protocol = dfu
monitor_port = COM7     ; To change the port, use platform_override.ini
build_flags =
    ${env.build_flags}
    ${stm32f4.build_flags}

;region -- TFT_eSPI build options ------------------------
    ${lcd.lolin24}
    ;-D TFT_MISO=PB4 ;Default
    ;-D TFT_MOSI=PB5 ;Default
    ;-D TFT_SCLK=PB3 ;Default
    -D TFT_CS=PE13 ;D8
    -D TFT_DC=PE14  ;D3
    -D TFT_BCKL=-1 ;None, configurable via web UI (e.g. 2 for D4)
    -D TOUCH_CS=PA6 ;NC
    -D TFT_RST=-1  ;D4
;endregion

    -D STM32_SERIAL1 ; Set this option to use Serial1 as default sersial port, leave out if using Serial2

;region -- Hasp build options ----------------------------
    -D HASP_OUTPUT_PIN=PE0 ; User LED D2 on DevEBox board
    -D HASP_INPUT_PIN=PD15 ; User Button K1 on DevEBox board
    -D HASP_USE_TASMOTA_CLIENT=1
    -D HASP_USE_OTA=0
    -D HASP_USE_ETHERNET=1
;endregion

;region -- Network build options -------------------------
    -D W5500_MOSI=PB15 ;SPI2 MOSI
    -D W5500_MISO=PB14 ;SPI2 MISO
    -D W5500_SCLK=PB13 ;SPI2 SCLK
    -D W5500_CS=PB6 ;SPI2 CS
    -D W5500_RST=PD1 ;SPI2 CS
    ;-D HAL_ETH_MODULE_ENABLED=1         ; enable ethernet support
    ;-D LAN8742A_PHY_ADDRESS=0x01U       ; set LAN8720 PHY address
;endregion

;region -- Library options -------------------------------
lib_deps =
    ${env.lib_deps}
    ${stm32f4.lib_deps}
    ;Ethernet
    ; STM32duino STM32Ethernet@^1.0.5
    https://github.com/netwizeBE/Ethernet3.git
    https://github.com/khoih-prog/EthernetWebServer_STM32

lib_ignore =
    GxTFT
    XPT2046_Touchscreen
    lv_lib_zifont

src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<lv_lib_zifont/> +<stm32f4/>
;endregion