usb: cdc: Add unique PIDs for each sample

Unique PID is required for each sample in order
to be recognized by host.

When creating a new sample:
- Add USB_PID_<SAMPLE_NAME>_SAMPLE
  in samples/subsys/usb/usb_pid.Kconfig
- Create Kconfig file in your sample's subdirectory, containing:
  config USB_DEVICE_PID
	default USB_PID_<SAMPLE_NAME>_SAMPLE

  source "Kconfig.zephyr"

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
This commit is contained in:
Marcin Szymczyk 2019-03-06 12:01:02 +01:00 committed by Anas Nashif
parent c53c32e17d
commit e5cbe6a9e7
16 changed files with 180 additions and 3 deletions

View file

@ -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
*****************************

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -7,4 +7,4 @@ USB Samples
:maxdepth: 1
:glob:
**/*
**/*

View file

@ -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

View file

@ -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"

View file

@ -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.