summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/usb_descriptor.h
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol/usb_descriptor.h')
-rw-r--r--tmk_core/protocol/usb_descriptor.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h
index f8b7a863aa..fd25376f90 100644
--- a/tmk_core/protocol/usb_descriptor.h
+++ b/tmk_core/protocol/usb_descriptor.h
@@ -51,6 +51,9 @@
# define USB_ENDPOINTS_ARE_REORDERABLE
# endif
#endif
+#ifdef WEBUSB_ENABLE
+# include "webusb_descriptor.h"
+#endif
/*
* USB descriptor structure
@@ -100,6 +103,12 @@ typedef struct {
USB_Descriptor_Endpoint_t Console_OUTEndpoint;
#endif
+#ifdef WEBUSB_ENABLE
+ USB_Descriptor_Interface_t WebUSB_Interface;
+ USB_Descriptor_Endpoint_t WebUSB_DataInEndpoint;
+ USB_Descriptor_Endpoint_t WebUSB_DataOutEndpoint;
+#endif
+
#ifdef MIDI_ENABLE
USB_Descriptor_Interface_Association_t Audio_Interface_Association;
// MIDI Audio Control Interface
@@ -187,6 +196,10 @@ enum usb_interfaces {
CDI_INTERFACE,
#endif
+#ifdef WEBUSB_ENABLE
+ INTERFACE_ID_WebUSB,
+#endif
+
#if defined(JOYSTICK_ENABLE)
JOYSTICK_INTERFACE,
#endif
@@ -265,6 +278,14 @@ enum usb_endpoints {
CDC_OUT_EPNUM = NEXT_EPNUM,
# endif
#endif
+
+#ifdef WEBUSB_ENABLE
+ WEBUSB_IN_EPNUM = NEXT_EPNUM,
+ WEBUSB_OUT_EPNUM = NEXT_EPNUM,
+# define WEBUSB_IN_EPADDR (ENDPOINT_DIR_IN | WEBUSB_IN_EPNUM)
+# define WEBUSB_OUT_EPADDR (ENDPOINT_DIR_OUT | WEBUSB_OUT_EPNUM)
+#endif
+
#ifdef JOYSTICK_ENABLE
JOYSTICK_IN_EPNUM = NEXT_EPNUM,
# ifdef USB_ENDPOINTS_ARE_REORDERABLE
@@ -310,6 +331,7 @@ enum usb_endpoints {
#define MIDI_STREAM_EPSIZE 64
#define CDC_NOTIFICATION_EPSIZE 8
#define CDC_EPSIZE 16
+#define WEBUSB_EPSIZE 64
#define JOYSTICK_EPSIZE 8
#define DIGITIZER_EPSIZE 8