Convert MS OS descriptor builder to a writer API

This brings it inline with the other embassy-usb descriptor APIs and allows it to integrate well with the Builder to allow class constructors to add MS OS descriptors.

Also adds a `usb_serial_winusb` example to demonstrate how to use the API.
This commit is contained in:
alexmoon
2023-02-02 16:13:16 -05:00
parent b9ecdb72bb
commit 9f9230ae7a
6 changed files with 461 additions and 273 deletions

View File

@ -13,6 +13,7 @@ target = "thumbv7em-none-eabi"
[features]
defmt = ["dep:defmt", "embassy-usb-driver/defmt"]
usbd-hid = ["dep:usbd-hid", "dep:ssmarshal"]
msos-descriptor = ["dep:widestring"]
default = ["usbd-hid"]
[dependencies]
@ -24,7 +25,7 @@ embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-
defmt = { version = "0.3", optional = true }
log = { version = "0.4.14", optional = true }
heapless = "0.7.10"
widestring = { version = "1.0.2", default-features = false }
widestring = { version = "1.0.2", default-features = false, optional = true }
# for HID
usbd-hid = { version = "0.6.0", optional = true }