Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit ebad70b

Browse files
committed
Add WebUSB platform capability support.
1 parent 9d0b268 commit ebad70b

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

firmware/library/include/usb.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ enum usb_descriptor {
4949
USB_DESC_DEVICE = 1,
5050
USB_DESC_CONFIGURATION = 2,
5151
USB_DESC_STRING = 3,
52+
USB_DESC_URL = USB_DESC_STRING,
5253
USB_DESC_INTERFACE = 4,
5354
USB_DESC_ENDPOINT = 5,
5455
USB_DESC_DEVICE_QUALIFIER = 6,
@@ -238,6 +239,20 @@ struct usb_desc_string {
238239
typedef __code const struct usb_desc_string
239240
usb_desc_string_c;
240241

242+
enum usb_url_scheme {
243+
USB_URL_SCHEME_HTTPS = 1,
244+
};
245+
246+
struct usb_desc_url {
247+
uint8_t bLength;
248+
uint8_t bDescriptorType;
249+
uint8_t bScheme;
250+
uint8_t bURL[];
251+
};
252+
253+
typedef __code const struct usb_desc_url
254+
usb_desc_url_c;
255+
241256
struct usb_desc_binary_object_store {
242257
uint8_t bLength;
243258
uint8_t bDescriptorType;

firmware/library/include/usbweb.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#ifndef USBWEB_H
2+
#define USBWEB_H
3+
4+
#include <usb.h>
5+
6+
// {3408b638-09a9-47a0-8bfd-a0768815b665}
7+
#define USB_PLATFORM_CAPABILITY_UUID_WEBUSB \
8+
{0x38, 0xB6, 0x08, 0x34, 0xA9, 0x09, 0xA0, 0x47, 0x8B, 0xFD, 0xA0, 0x76, 0x88, 0x15, 0xB6, 0x65}
9+
10+
struct usb_desc_webusb_platform_capability {
11+
uint8_t bLength;
12+
uint8_t bDescriptorType;
13+
uint8_t bDevCapabilityType;
14+
uint8_t bReserved;
15+
uint8_t PlatformCapablityUUID[16];
16+
uint16_t bcdVersion;
17+
uint8_t bVendorCode;
18+
uint8_t iLandingPage;
19+
};
20+
21+
typedef __code const struct usb_desc_webusb_platform_capability
22+
usb_desc_webusb_platform_capability_c;
23+
24+
#endif

0 commit comments

Comments
 (0)