diff --git a/doc/reference/usb/index.rst b/doc/reference/usb/index.rst index 7db6a54b756..8e38aebd54e 100644 --- a/doc/reference/usb/index.rst +++ b/doc/reference/usb/index.rst @@ -23,6 +23,22 @@ The USB maintainer, if one is assigned, or otherwise the Zephyr Technical Steering Committee, may allocate other USB Product IDs based on well-motivated and documented requests. +Each USB sample has its own unique Product ID. +When adding a new sample, add a new entry in :file:`samples/subsys/usb/usb_pid.Kconfig` +and a Kconfig file inside your sample subdirectory. +The following Product IDs are currently used: + +* :option:`CONFIG_USB_PID_CDC_ACM_SAMPLE` +* :option:`CONFIG_USB_PID_CDC_ACM_COMPOSITE_SAMPLE` +* :option:`CONFIG_USB_PID_HID_CDC_SAMPLE` +* :option:`CONFIG_USB_PID_CONSOLE_SAMPLE` +* :option:`CONFIG_USB_PID_DFU_SAMPLE` +* :option:`CONFIG_USB_PID_HID_SAMPLE` +* :option:`CONFIG_USB_PID_HID_MOUSE_SAMPLE` +* :option:`CONFIG_USB_PID_MASS_SAMPLE` +* :option:`CONFIG_USB_PID_TESTUSB_SAMPLE` +* :option:`CONFIG_USB_PID_WEBUSB_SAMPLE` + USB device controller drivers ***************************** diff --git a/samples/bluetooth/hci_usb/Kconfig b/samples/bluetooth/hci_usb/Kconfig new file mode 100644 index 00000000000..e474b695ab7 --- /dev/null +++ b/samples/bluetooth/hci_usb/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_BLE_HCI_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/cdc_acm/Kconfig b/samples/subsys/usb/cdc_acm/Kconfig new file mode 100644 index 00000000000..86c7b98d275 --- /dev/null +++ b/samples/subsys/usb/cdc_acm/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_CDC_ACM_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/cdc_acm_composite/Kconfig b/samples/subsys/usb/cdc_acm_composite/Kconfig new file mode 100644 index 00000000000..7457577859e --- /dev/null +++ b/samples/subsys/usb/cdc_acm_composite/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_CDC_ACM_COMPOSITE_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/cdc_acm_composite/prj.conf b/samples/subsys/usb/cdc_acm_composite/prj.conf index cde468e5dad..6da8a174597 100644 --- a/samples/subsys/usb/cdc_acm_composite/prj.conf +++ b/samples/subsys/usb/cdc_acm_composite/prj.conf @@ -7,7 +7,7 @@ CONFIG_UART_LINE_CTRL=y CONFIG_USB=y CONFIG_USB_DEVICE_STACK=y -CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM sample" +CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM Composite sample" CONFIG_USB_COMPOSITE_DEVICE=y CONFIG_USB_CDC_ACM=y CONFIG_USB_CDC_ACM_DEVICE_COUNT=2 diff --git a/samples/subsys/usb/console/Kconfig b/samples/subsys/usb/console/Kconfig new file mode 100644 index 00000000000..5281f623a19 --- /dev/null +++ b/samples/subsys/usb/console/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_CONSOLE_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/dfu/Kconfig b/samples/subsys/usb/dfu/Kconfig new file mode 100644 index 00000000000..28aa3f1cf3e --- /dev/null +++ b/samples/subsys/usb/dfu/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_DFU_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/hid-cdc/Kconfig b/samples/subsys/usb/hid-cdc/Kconfig new file mode 100644 index 00000000000..4ba868eaa49 --- /dev/null +++ b/samples/subsys/usb/hid-cdc/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_HID_CDC_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/hid-mouse/Kconfig b/samples/subsys/usb/hid-mouse/Kconfig new file mode 100644 index 00000000000..82fa354608e --- /dev/null +++ b/samples/subsys/usb/hid-mouse/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_HID_MOUSE_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/hid/Kconfig b/samples/subsys/usb/hid/Kconfig new file mode 100644 index 00000000000..85e5fc9447e --- /dev/null +++ b/samples/subsys/usb/hid/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_HID_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/mass/Kconfig b/samples/subsys/usb/mass/Kconfig new file mode 100644 index 00000000000..ff44fef87d9 --- /dev/null +++ b/samples/subsys/usb/mass/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_MASS_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/testusb/Kconfig b/samples/subsys/usb/testusb/Kconfig new file mode 100644 index 00000000000..daa016614cf --- /dev/null +++ b/samples/subsys/usb/testusb/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_TESTUSB_SAMPLE + +source "Kconfig.zephyr" diff --git a/samples/subsys/usb/usb.rst b/samples/subsys/usb/usb.rst index 8e282e37d32..e73266cd98f 100644 --- a/samples/subsys/usb/usb.rst +++ b/samples/subsys/usb/usb.rst @@ -7,4 +7,4 @@ USB Samples :maxdepth: 1 :glob: - **/* + **/* \ No newline at end of file diff --git a/samples/subsys/usb/usb_pid.Kconfig b/samples/subsys/usb/usb_pid.Kconfig new file mode 100644 index 00000000000..a0e0672990d --- /dev/null +++ b/samples/subsys/usb/usb_pid.Kconfig @@ -0,0 +1,49 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_PID_CDC_ACM_SAMPLE + hex + default 0x0001 + +config USB_PID_CDC_ACM_COMPOSITE_SAMPLE + hex + default 0x0002 + +config USB_PID_HID_CDC_SAMPLE + hex + default 0x0003 + +config USB_PID_CONSOLE_SAMPLE + hex + default 0x0004 + +config USB_PID_DFU_SAMPLE + hex + default 0x0005 + +config USB_PID_HID_SAMPLE + hex + default 0x0006 + +config USB_PID_HID_MOUSE_SAMPLE + hex + default 0x0007 + +config USB_PID_MASS_SAMPLE + hex + default 0x0008 + +config USB_PID_TESTUSB_SAMPLE + hex + default 0x0009 + +config USB_PID_WEBUSB_SAMPLE + hex + default 0x000A + +config USB_PID_BLE_HCI_SAMPLE + hex + default 0x000B diff --git a/samples/subsys/usb/webusb/Kconfig b/samples/subsys/usb/webusb/Kconfig new file mode 100644 index 00000000000..dd9da56e6a4 --- /dev/null +++ b/samples/subsys/usb/webusb/Kconfig @@ -0,0 +1,10 @@ +# +# Copyright (c) 2019 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +config USB_DEVICE_PID + default USB_PID_WEBUSB_SAMPLE + +source "Kconfig.zephyr" diff --git a/subsys/usb/Kconfig b/subsys/usb/Kconfig index 5fe8ac7c5b5..a256fb1473d 100644 --- a/subsys/usb/Kconfig +++ b/subsys/usb/Kconfig @@ -18,6 +18,8 @@ module = USB_DEVICE module-str = usb device source "subsys/logging/Kconfig.template.log_config" +source "samples/subsys/usb/usb_pid.Kconfig" + config USB_DEVICE_VID hex "USB Vendor ID" default 0x2FE3 @@ -26,7 +28,7 @@ config USB_DEVICE_VID config USB_DEVICE_PID hex "USB Product ID" - default 0x100 + default 0x0100 help USB device product ID. MUST be configured by vendor.