usb: Allow registration of a single non-contiguous string descriptor for WinUSB

Classic WinUSB support is detected by probing for a string descriptor
at index 0xEE with a special string.
usbd_register_extra_string() allows registration of a string at this
index without having to provide 237 other string descriptors

Originally filed as https://github.com/libopencm3/libopencm3/pull/849

WCID reference: https://github.com/pbatard/libwdi/wiki/WCID-Devices
This commit is contained in:
Devan Lai
2020-10-17 17:12:20 +00:00
committed by Karl Palsson
parent ffe8ddfca2
commit c13c2b3b3c
4 changed files with 38 additions and 1 deletions

View File

@@ -165,6 +165,9 @@ extern int usbd_register_set_config_callback(usbd_device *usbd_dev,
extern void usbd_register_set_altsetting_callback(usbd_device *usbd_dev,
usbd_set_altsetting_callback callback);
/** Registers a non-contiguous string descriptor */
extern void usbd_register_extra_string(usbd_device *usbd_dev, int index, const char* string);
/* Functions to be provided by the hardware abstraction layer */
extern void usbd_poll(usbd_device *usbd_dev);