diff --git a/pkg/tinyusb/Kconfig b/pkg/tinyusb/Kconfig index 4bb4db140dc3..721ad8773b37 100644 --- a/pkg/tinyusb/Kconfig +++ b/pkg/tinyusb/Kconfig @@ -131,9 +131,7 @@ menu "Device Classes" depends on MODULE_TINYUSB_DEVICE rsource "Kconfig.hid" - - config MODULE_TINYUSB_CLASS_MSC - bool "Mass Storage Class (MSC)" + rsource "Kconfig.msc" config MODULE_TINYUSB_CLASS_MIDI bool "Musical Instrument Digital Interface (MIDI)" @@ -160,12 +158,27 @@ menu "Device Classes" endmenu -config TUSB_FS_EP_SIZE - int "FullSpeed Endpoint Buffer Size" +if MODULE_TINYUSB_DEVICE + +config TUSBD_EP0_SIZE + int "Device control endpoint (EP0) size [byte]" + default 64 + +config TUSBD_FS_EP_SIZE + int "Device endpoint size in Full-Speed mode [byte]" default 64 -config TUSB_HS_EP_SIZE - int "HighSpeed Endpoint Buffer Size" +config TUSBD_HS_EP_SIZE + int "Device endpoint Size in High-Speed mode [byte]" default 512 +config TUSBD_USE_CUSTOM_DESC + bool "Custom device descriptors" + depends on MODULE_TINYUSB_DEVICE + help + Enable this option to define custom descriptors for the selected + device classes. Otherwise, generic descriptors will be generated + according to the selected device classes. + +endif # MODULE_TINYUSB_DEVICE endif # PACKAGE_TINYUSB diff --git a/pkg/tinyusb/Kconfig.cdc b/pkg/tinyusb/Kconfig.cdc index 801c1ff74fd9..1b019c8b5511 100644 --- a/pkg/tinyusb/Kconfig.cdc +++ b/pkg/tinyusb/Kconfig.cdc @@ -10,23 +10,23 @@ menuconfig MODULE_TINYUSB_CLASS_CDC if MODULE_TINYUSB_CLASS_CDC && MODULE_TINYUSB_DEVICE -config TUSB_CDC_NUM - int "CDC Interface Number" +config TUSBD_CDC_NUMOF + int "Number of CDC interfaces" default 1 range 1 2 -config TUSB_CDC_NOTIF_EP_SIZE - int "CDC Notification Endpoint Size" +config TUSBD_CDC_NOTIF_EP_SIZE + int "CDC notification endpoint size [byte]" default 8 -config CONFIG_TUSB_CDC_0_STRING - string "CDC0 String" - depends on TUSB_CDC_NUM > 0 +config TUSBD_CDC_0_STRING + string "CDC0 descriptor string" + depends on TUSBD_CDC_NUMOF > 0 default "TinyUSB CDC0" -config CONFIG_TUSB_CDC_1_STRING - string "CDC1 String" - depends on TUSB_CDC_NUM > 1 +config TUSBD_CDC_1_STRING + string "CDC1 descriptor string" + depends on TUSBD_CDC_NUMOF > 1 default "TinyUSB CDC1" endif diff --git a/pkg/tinyusb/Kconfig.hid b/pkg/tinyusb/Kconfig.hid index 4c3ce087c170..31587cdd4580 100644 --- a/pkg/tinyusb/Kconfig.hid +++ b/pkg/tinyusb/Kconfig.hid @@ -10,30 +10,33 @@ menuconfig MODULE_TINYUSB_CLASS_HID if MODULE_TINYUSB_CLASS_HID && MODULE_TINYUSB_DEVICE -config TUSB_HID_NUM - int "Number of HID Interfaces" +config TUSBD_HID_NUMOF + int "Number of HID interfaces" default 1 range 1 2 -config CONFIG_TUSB_HID_0_POLL_INTERVALL - int "HID0 Polling Interval [ms]" - depends on TUSB_HID_NUM > 0 +config TUSBD_HID_EP_SIZE + int "HID endpoint size [byte]" + default 64 + +config TUSBD_HID_0_POLL_INTERVALL + int "HID0 polling interval [ms]" + depends on TUSBD_HID_NUMOF > 0 default 10 -config CONFIG_TUSB_HID_0_STRING - string "HID0 String" - depends on TUSB_HID_NUM > 0 +config TUSBD_HID_0_STRING + string "HID0 descriptor string" + depends on TUSBD_HID_NUMOF > 0 default "TinyUSB HID0 (Generic In/Out)" -config CONFIG_TUSB_HID_1_POLL_INTERVALL - int "HID1 Polling Interval [ms]" - depends on TUSB_HID_NUM > 1 +config TUSBD_HID_1_POLL_INTERVALL + int "HID1 polling interval [ms]" + depends on TUSBD_HID_NUMOF > 1 default 10 -config CONFIG_TUSB_HID_1_STRING - string "HID1 String" - depends on TUSB_HID_NUM > 1 +config TUSBD_HID_1_STRING + string "HID1 descriptor string" + depends on TUSBD_HID_NUMOF > 1 default "TinyUSB HID1 (Generic In/Out)" - endif diff --git a/pkg/tinyusb/Kconfig.msc b/pkg/tinyusb/Kconfig.msc new file mode 100644 index 000000000000..abe6857d8054 --- /dev/null +++ b/pkg/tinyusb/Kconfig.msc @@ -0,0 +1,26 @@ +# Copyright (c) 2022 Gunar Schorcht +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +menuconfig MODULE_TINYUSB_CLASS_MSC + bool "Mass Storage Class (MSC)" + +if MODULE_TINYUSB_CLASS_MSC && MODULE_TINYUSB_DEVICE + +config TUSBD_MSC_NUMOF + int + default 1 + +config TUSBD_MSC_EP_SIZE + int "MSC endpoint size [byte]" + default 512 + +config TUSBD_MSC_STRING + string "MSC descriptor string" + depends on TUSBD_MSC_NUMOF > 0 + default "TinyUSB MSC" + +endif