diff --git a/sys/include/usb.h b/sys/include/usb.h index fd2b8660fd..de0f3f49e9 100644 --- a/sys/include/usb.h +++ b/sys/include/usb.h @@ -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 */ diff --git a/sys/usb/usbus/usbus_fmt.c b/sys/usb/usbus/usbus_fmt.c index cb3f097fa2..4da76cd460 100644 --- a/sys/usb/usbus/usbus_fmt.c +++ b/sys/usb/usbus/usbus_fmt.c @@ -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;