diff options
author | Florian Didron <fd@librem.one> | 2019-11-04 18:50:06 +0900 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2019-12-05 16:03:53 -0800 |
commit | ea6f99e05dbc617354fb5c503b31d46c8bf5cb18 (patch) | |
tree | 1aaa52dc94bd351a0654cf977c9f33240a700caf /tmk_core/protocol/usb_descriptor.h | |
parent | 5400211a9adf17e328f4d6962ddbf18c8f9026d9 (diff) |
feat: adds webusb
Diffstat (limited to 'tmk_core/protocol/usb_descriptor.h')
-rw-r--r-- | tmk_core/protocol/usb_descriptor.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h index b2423fa7e6..224068b674 100644 --- a/tmk_core/protocol/usb_descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h @@ -48,6 +48,9 @@ #ifdef PROTOCOL_CHIBIOS # include "hal.h" #endif +#ifdef WEBUSB_ENABLE +#include "webusb.h" +#endif /* * USB descriptor structure @@ -92,6 +95,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 @@ -164,6 +173,10 @@ enum usb_interfaces { CDI_INTERFACE, #endif +#ifdef WEBUSB_ENABLE + INTERFACE_ID_WebUSB, +#endif + TOTAL_INTERFACES }; @@ -224,6 +237,13 @@ enum usb_endpoints { # define CDC_IN_EPADDR (ENDPOINT_DIR_IN | CDC_IN_EPNUM) # define CDC_OUT_EPADDR (ENDPOINT_DIR_OUT | CDC_OUT_EPNUM) #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 PROTOCOL_LUFA @@ -248,6 +268,7 @@ enum usb_endpoints { #define MIDI_STREAM_EPSIZE 64 #define CDC_NOTIFICATION_EPSIZE 8 #define CDC_EPSIZE 16 +#define WEBUSB_EPSIZE 64 uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const void** const DescriptorAddress); #endif |