menu "TinyUF2 Config"
    # We not support disable now
    config ENABLE_UF2_FLASHING
        bool
        default y if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4
        select TINYUSB_SOURCE_CODE_ONLY
        help
            Enable UF2, only support ESP SoC with USB-OTG
    config ENABLE_UF2_USB_CONSOLE
        bool "Enable USB Console For log"
        depends on ENABLE_UF2_FLASHING
        default n
    config UF2_DISK_SIZE_MB
        int "USB Virtual Disk size(MB)"
        depends on ENABLE_UF2_FLASHING
        default 8
        range 4 32
    config UF2_FLASH_SIZE_MB
        int "Max APP size(MB)"
        depends on ENABLE_UF2_FLASHING
        default 4
        range 2 8
    config FLASH_CACHE_SIZE
        int "Flash cache size(KB)"
        depends on ENABLE_UF2_FLASHING
        default 32
        range 4 64
    config TUSB_VID
        hex "USB Device VID"
        depends on ENABLE_UF2_FLASHING
        default 0x303A
    config TUSB_PID
        hex "USB Device PID"
        depends on ENABLE_UF2_FLASHING
        default 0x8000
    config UF2_VOLUME_LABEL
        string "USB Disk Name"
        depends on ENABLE_UF2_FLASHING
        default "ESP32S2-UF2" if IDF_TARGET_ESP32S2
        default "ESP32S3-UF2" if IDF_TARGET_ESP32S3
        default "ESP32P4-UF2" if IDF_TARGET_ESP32P4
    config TUSB_MANUFACTURER
        string "USB Device Manufacture"
        depends on ENABLE_UF2_FLASHING
        default "Espressif"
    config TUSB_PRODUCT
        string "Product Name"
        depends on ENABLE_UF2_FLASHING
        default "ESP TinyUF2"
    config UF2_SERIAL_NUM
        string "Product ID"
        depends on ENABLE_UF2_FLASHING
        default "12345678"
    config UF2_INDEX_URL
        string "Product URL"
        depends on ENABLE_UF2_FLASHING
        default "https://products.espressif.com/"
    config UF2_INI_FILE_SIZE
        int "UF2 NVS ini file size"
        depends on ENABLE_UF2_FLASHING
        default 512
        range 256 2048
    config UF2_INI_NVS_VALUE_HIDDEN
        bool "Enable UF2 ini file hide NVS value"
        depends on ENABLE_UF2_FLASHING
        default n
    config UF2_INI_NVS_HIDDEN_MAX_NUM
        int "UF2 ini file hide NVS value max number"
        depends on UF2_INI_NVS_VALUE_HIDDEN
        default 32
    config UF2_OTA_FACTORY_ONLY
        bool "OTA Factory Only"
        help
            Enable this option to limit the OTA updates to the factory partition only.
    config UF2_OTA_RESET_REASON_VALUE
        hex "OTA Reset Reason Value"
        depends on ENABLE_UF2_FLASHING
        default 0xF2
        help
            The reset value for uf2 ota reset.

    choice TINYUSB_RHPORT
        prompt "TinyUSB Root Port"
        default TINYUSB_RHPORT_HS if IDF_TARGET_ESP32P4
        default TINYUSB_RHPORT_FS
        help
            Allows set the USB PHY Controller for TinyUSB: HS (USB OTG2.0 PHY for HighSpeed)

        config TINYUSB_RHPORT_HS
            depends on IDF_TARGET_ESP32P4
            bool "High Speed"

        config TINYUSB_RHPORT_FS
            bool "Full Speed"
    endchoice

endmenu
