From 398df91a99c38aaf709aa3da711356812e8a4857 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 25 Nov 2021 10:25:08 +0100 Subject: [PATCH] sys/usb/usbus: model cdc acm stdio in Kconfig --- sys/usb/Kconfig | 3 ++- sys/usb/usbus/Kconfig | 26 ++++++++++++++++++++++++-- sys/usb/usbus/cdc/acm/Kconfig | 16 ++++++++++++++++ sys/usb/usbus/cdc/ecm/Kconfig | 1 + sys/usb/usbus/dfu/Kconfig | 1 + sys/usb/usbus/hid/Kconfig | 17 +++++++++++++++++ 6 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 sys/usb/usbus/hid/Kconfig diff --git a/sys/usb/Kconfig b/sys/usb/Kconfig index 05fb319a4a..b1a6301595 100644 --- a/sys/usb/Kconfig +++ b/sys/usb/Kconfig @@ -108,5 +108,6 @@ config USB_SERIAL_BYTE_LENGTH comment "WARNING: The serial string is empty!" depends on USB_SERIAL_STR = "" && USB_CUSTOM_SERIAL_STR -rsource "usbus/Kconfig" endif # KCONFIG_USB + +rsource "usbus/Kconfig" diff --git a/sys/usb/usbus/Kconfig b/sys/usb/usbus/Kconfig index f1ce681ba2..6f33c40f0b 100644 --- a/sys/usb/usbus/Kconfig +++ b/sys/usb/usbus/Kconfig @@ -4,9 +4,30 @@ # General Public License v2.1. See the file LICENSE in the top level # directory for more details. # + +menuconfig MODULE_USBUS + bool "USB Unified Stack (USBUS)" + depends on TEST_KCONFIG + depends on HAS_PERIPH_USBDEV || MODULE_USBDEV_MOCK + select MODULE_CORE_THREAD_FLAGS + select MODULE_EVENT + select MODULE_LUID + select MODULE_FMT + select MODULE_PERIPH_USBDEV if HAS_PERIPH_USBDEV && !MODULE_USBDEV_MOCK + +if MODULE_USBUS + +config MODULE_AUTO_INIT_USBUS + bool "Auto initialize USBUS" + depends on MODULE_AUTO_INIT + default y + +endif # MODULE_USBUS + menuconfig KCONFIG_USEMODULE_USBUS bool "Configure USB Unified Stack (USBUS)" depends on USEMODULE_USBUS + depends on KCONFIG_USB help Configure the USBUS module via Kconfig. @@ -42,7 +63,8 @@ config USBUS_EP0_SIZE_64 endchoice +endif # KCONFIG_USEMODULE_USBUS + rsource "cdc/Kconfig" rsource "dfu/Kconfig" - -endif # KCONFIG_USEMODULE_USBUS +rsource "hid/Kconfig" diff --git a/sys/usb/usbus/cdc/acm/Kconfig b/sys/usb/usbus/cdc/acm/Kconfig index 132fea85eb..68a8ea1d1f 100644 --- a/sys/usb/usbus/cdc/acm/Kconfig +++ b/sys/usb/usbus/cdc/acm/Kconfig @@ -7,6 +7,7 @@ menuconfig KCONFIG_USEMODULE_USBUS_CDC_ACM bool "Configure USBUS CDC ACM" depends on USEMODULE_USBUS_CDC_ACM + depends on KCONFIG_USEMODULE_USBUS help Configure the USBUS CDC ACM module via Kconfig. @@ -44,3 +45,18 @@ config USBUS_CDC_ACM_BULK_EP_SIZE_64 endchoice endif # KCONFIG_USEMODULE_USBUS_CDC_ACM + +config MODULE_USBUS_CDC_ACM + bool "USB CDC ACM support" + depends on MODULE_USBUS + select MODULE_TSRB + +# extend STDIO options +choice STDIO_IMPLEMENTATION + +config MODULE_STDIO_CDC_ACM + bool "CDC ACM" + depends on MODULE_USBUS_CDC_ACM + select MODULE_ISRPIPE + +endchoice diff --git a/sys/usb/usbus/cdc/ecm/Kconfig b/sys/usb/usbus/cdc/ecm/Kconfig index 9c7ba5fd6e..90b34830f8 100644 --- a/sys/usb/usbus/cdc/ecm/Kconfig +++ b/sys/usb/usbus/cdc/ecm/Kconfig @@ -7,6 +7,7 @@ menuconfig KCONFIG_USEMODULE_USBUS_CDC_ECM bool "Configure USBUS CDC ECM" depends on USEMODULE_USBUS_CDC_ECM + depends on KCONFIG_USEMODULE_USBUS help Configure the USBUS CDC ECM module via Kconfig. diff --git a/sys/usb/usbus/dfu/Kconfig b/sys/usb/usbus/dfu/Kconfig index f9934b67d6..ee67fa04e6 100644 --- a/sys/usb/usbus/dfu/Kconfig +++ b/sys/usb/usbus/dfu/Kconfig @@ -8,6 +8,7 @@ menuconfig KCONFIG_USEMODULE_USBUS_DFU bool "Configure USBUS DFU" depends on USEMODULE_USBUS_DFU + depends on KCONFIG_USEMODULE_USBUS help Configure the USBUS DFU module via Kconfig. diff --git a/sys/usb/usbus/hid/Kconfig b/sys/usb/usbus/hid/Kconfig new file mode 100644 index 0000000000..2639a1bfdf --- /dev/null +++ b/sys/usb/usbus/hid/Kconfig @@ -0,0 +1,17 @@ +# Copyright (c) 2021 HAW Hamburg +# +# 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_USBUS_HID + bool "USB HID support" + depends on TEST_KCONFIG + depends on MODULE_USBUS + select MODULE_ISRPIPE_READ_TIMEOUT + +config USBUS_HID_INTERRUPT_EP_SIZE + int "Interrupt endpoint size in bytes" + default 64 + depends on MODULE_USBUS_HID