; LilyGo T-Lora-Pager
[env:tlora-pager]
custom_meshtastic_hw_model = 103
custom_meshtastic_hw_model_slug = T_LORA_PAGER
custom_meshtastic_architecture = esp32-s3
custom_meshtastic_actively_supported = true
custom_meshtastic_support_level = 1
custom_meshtastic_display_name = LILYGO T-LoRa Pager
custom_meshtastic_images = lilygo-tlora-pager.svg
custom_meshtastic_tags = LilyGo
custom_meshtastic_requires_dfu = true
custom_meshtastic_partition_scheme = 16MB
custom_meshtastic_has_mui = true

extends = esp32s3_base
board = t-deck-pro ; same as T-Deck Pro
board_check = true
board_build.partitions = default_16MB.csv
upload_protocol = esptool

build_src_filter =
  ${esp32s3_base.build_src_filter}
  +<../variants/esp32s3/tlora-pager>

build_flags = ${esp32s3_base.build_flags} 
  -I variants/esp32s3/tlora-pager
  -D T_LORA_PAGER 
  -D BOARD_HAS_PSRAM
  -D HAS_SDCARD
  -D ENABLE_ROTARY_PULLUP
  -D ENABLE_BUTTON_PULLUP
  -D ROTARY_BUXTRONICS

lib_deps = ${esp32s3_base.lib_deps}
  # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX
  lovyan03/LovyanGFX@1.2.19
  # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix
  https://github.com/meshtastic/ESP8266Audio/archive/343024632ee78d6216907b2353fc943a62422d80.zip
  # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM
  earlephilhower/ESP8266SAM@1.1.0
  # renovate: datasource=custom.pio depName=Adafruit DRV2605 packageName=adafruit/library/Adafruit DRV2605 Library
  adafruit/Adafruit DRV2605 Library@1.2.4
  # renovate: datasource=custom.pio depName=PCF8563 packageName=lewisxhe/library/PCF8563_Library
  lewisxhe/PCF8563_Library@1.0.1
  # renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib
  lewisxhe/SensorLib@0.3.4
  # renovate: datasource=github-tags depName=pschatzmann_arduino-audio-driver packageName=pschatzmann/arduino-audio-driver
  https://github.com/pschatzmann/arduino-audio-driver/archive/v0.2.1.zip
  # TODO renovate
  https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip
  # TODO renovate
  https://github.com/mverch67/RotaryEncoder/archive/da958a21389cbcd485989705df602a33e092dd88.zip

[env:tlora-pager-tft]
board_level = extra
extends = env:tlora-pager
build_flags =
  ${env:tlora-pager.build_flags}
  -D CONFIG_DISABLE_HAL_LOCKS=1
  -D INPUTDRIVER_ROTARY_TYPE=1
  -D INPUTDRIVER_ROTARY_UP=40
  -D INPUTDRIVER_ROTARY_DOWN=41
  -D INPUTDRIVER_ROTARY_BTN=7
  -D INPUTDRIVER_BUTTON_TYPE=0
  -D HAS_SCREEN=1
  -D HAS_TFT=1
  -D USE_I2S_BUZZER
  -D RAM_SIZE=5120
  -D LV_LVGL_H_INCLUDE_SIMPLE
  -D LV_CONF_INCLUDE_SIMPLE
  -D LV_COMP_CONF_INCLUDE_SIMPLE
  -D LV_USE_SYSMON=0
  -D LV_USE_PROFILER=0
  -D LV_USE_PERF_MONITOR=0
  -D LV_USE_MEM_MONITOR=0
  -D LV_USE_LOG=0
  -D USE_LOG_DEBUG
  -D LOG_DEBUG_INC=\"DebugConfiguration.h\"
  -D RADIOLIB_SPI_PARANOID=0
  -D LGFX_SCREEN_WIDTH=222
  -D LGFX_SCREEN_HEIGHT=480
  -D DISPLAY_SIZE=480x222 ; landscape mode
  -D DISPLAY_SET_RESOLUTION
  -D LGFX_DRIVER=LGFX_TLORA_PAGER
  -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_T_LORA_PAGER.h\"
;  -D LVGL_DRIVER=LVGL_T_LORA_PAGER
;  -D LV_USE_ST7796=1
  -D VIEW_480x222
  -D USE_PACKET_API
  -D MAP_FULL_REDRAW

lib_deps =
  ${env:tlora-pager.lib_deps}
  ${device-ui_base.lib_deps}
