mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #17380 from qmk/bind_extra_usb_config
usbus: Bind extra USB config
This commit is contained in:
commit
c18c56aa03
@ -152,6 +152,13 @@ extern "C" {
|
||||
#define CONFIG_USB_SELF_POWERED (0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief USB peripheral setting to indicate remote wakeup capability.
|
||||
*/
|
||||
#ifndef CONFIG_USB_REM_WAKEUP
|
||||
#define CONFIG_USB_REM_WAKEUP (0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief USB device max power draw in mA, between 0 and 500mA
|
||||
*/
|
||||
|
@ -261,6 +261,9 @@ size_t usbus_fmt_descriptor_conf(usbus_t *usbus)
|
||||
if (CONFIG_USB_SELF_POWERED) {
|
||||
conf.attributes |= USB_CONF_ATTR_SELF_POWERED;
|
||||
}
|
||||
if (CONFIG_USB_REM_WAKEUP) {
|
||||
conf.attributes |= USB_CONF_ATTR_REM_WAKEUP;
|
||||
}
|
||||
/* TODO: upper bound */
|
||||
/* USB max power is reported in increments of 2 mA */
|
||||
conf.max_power = CONFIG_USB_MAX_POWER / 2;
|
||||
@ -286,6 +289,7 @@ size_t usbus_fmt_descriptor_dev(usbus_t *usbus)
|
||||
desc.max_packet_size = CONFIG_USBUS_EP0_SIZE;
|
||||
desc.vendor_id = CONFIG_USB_VID;
|
||||
desc.product_id = CONFIG_USB_PID;
|
||||
desc.bcd_device = CONFIG_USB_PRODUCT_BCDVERSION;
|
||||
desc.manufacturer_idx = usbus->manuf.idx;
|
||||
desc.product_idx = usbus->product.idx;
|
||||
desc.serial_idx = usbus->serial.idx;
|
||||
|
Loading…
Reference in New Issue
Block a user