From ea6f99e05dbc617354fb5c503b31d46c8bf5cb18 Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Mon, 4 Nov 2019 18:50:06 +0900 Subject: feat: adds webusb --- tmk_core/protocol/usb_descriptor.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tmk_core/protocol/usb_descriptor.h') 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 -- cgit v1.2.3