1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Kconfig: Expose USB peripheral configurations

This commit is contained in:
Leandro Lanzieri 2019-12-05 13:22:36 +01:00
parent 15bd4897c1
commit a1836d36a4
3 changed files with 89 additions and 0 deletions

View File

@ -7,5 +7,6 @@
menu "System"
rsource "net/Kconfig"
rsource "usb/Kconfig"
endmenu # System

View File

@ -92,7 +92,13 @@ extern "C" {
* @brief USB specification version
*/
#ifndef CONFIG_USB_SPEC_BCDVERSION
#if defined(CONFIG_USB_SPEC_BCDVERSION_1_1)
#define CONFIG_USB_SPEC_BCDVERSION 0x0110
#elif defined(CONFIG_USB_SPEC_BCDVERSION_2_0)
#define CONFIG_USB_SPEC_BCDVERSION 0x0200
#else
#define CONFIG_USB_SPEC_BCDVERSION 0x0200
#endif
#endif
/**

82
sys/usb/Kconfig Normal file
View File

@ -0,0 +1,82 @@
# 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
help
You must provide your own PID.
config USB_VID
hex "Vendor ID"
range 0x0000 0xFFFF
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).
endif # KCONFIG_USB