1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00
RIOT/sys/usb/Kconfig
chrysn 250f6fdfa3 usb: Warn on test-ID usage in a unified location
This

* renames DEFAULT_xID to USB_xID_TESTING as it is not really a default
  (if anyting, the 7D00 is, and it's not that)
* moves the check into Makefile
* generalizes the check to all test PID/VID pairs
  * in doing so, fixes the "or" (which would have ruled out warning-free
    use of an allocated pid.codes number), and compares to the actual
    testing PID rather than the RIOT-peripheral PID
* removes all occurrences of duplicated checks in examples or tests,
  leaving definitions only where they are needed
* moves the Kconfig defaults of the usbus_minimal example into the main
  Kconfig, as these are good defaults for all cases when USB is enabled
  manually

Closes: https://github.com/RIOT-OS/RIOT/issues/12273
2020-06-30 10:51:36 +02:00

87 lines
1.9 KiB
Plaintext

# Copyright (c) 2019 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 KCONFIG_USB
bool "Configure USB"
depends on MODULE_USBUS
help
Configure the USB peripheral via Kconfig.
if KCONFIG_USB
menu "Power management"
config USB_MAX_POWER
int "Reported maximum power draw [mA]"
default 100
range 0 500
config USB_SELF_POWERED
bool "Report as self-powered device"
help
When enabled, the device advertises itself as a self-powered device to
the host computer.
endmenu # Power management
choice
bool "USB specification version"
config USB_SPEC_BCDVERSION_2_0
bool "USB v2.0"
help
The peripheral acts as an USB version 2.0 device.
config USB_SPEC_BCDVERSION_1_1
bool "USB v1.1"
help
The peripheral acts as an USB version 1.1 device.
endchoice
config USB_PID
hex "Product ID"
range 0x0000 0xFFFF
default 0x$(USB_PID_TESTING) if KCONFIG_USB
help
You must provide your own PID.
config USB_VID
hex "Vendor ID"
range 0x0000 0xFFFF
default 0x$(USB_VID_TESTING) if KCONFIG_USB
help
You must provide your own VID.
config USB_MANUF_STR
string "Manufacturer string"
default "RIOT-os.org"
config USB_PRODUCT_STR
string "Product string"
default "USB device"
config USB_CONFIGURATION_STR
string "Configuration string"
default "USB config"
config USB_PRODUCT_BCDVERSION
hex "Device version"
default 0x0100
help
This is the version number of this peripheral. Not to be confused with
the USB version number.
config USB_DEFAULT_LANGID
hex "Reported string Language ID"
default 0x0409
help
The default value is EN-US (0x0409).
rsource "usbus/Kconfig"
endif # KCONFIG_USB