Skip to content

Commit

Permalink
fixup! pkg/tinyusb: add Kconfig variables for common tinyUSB descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Nov 8, 2022
1 parent 41497c9 commit 81203b5
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 32 deletions.
27 changes: 20 additions & 7 deletions pkg/tinyusb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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
20 changes: 10 additions & 10 deletions pkg/tinyusb/Kconfig.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -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
33 changes: 18 additions & 15 deletions pkg/tinyusb/Kconfig.hid
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 26 additions & 0 deletions pkg/tinyusb/Kconfig.msc
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 81203b5

Please sign in to comment.