aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/protocol/lufa/descriptor.h
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol/lufa/descriptor.h')
-rw-r--r--tmk_core/protocol/lufa/descriptor.h88
1 files changed, 73 insertions, 15 deletions
diff --git a/tmk_core/protocol/lufa/descriptor.h b/tmk_core/protocol/lufa/descriptor.h
index 4fd81a0e8..24ce420e6 100644
--- a/tmk_core/protocol/lufa/descriptor.h
+++ b/tmk_core/protocol/lufa/descriptor.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
* This file is based on:
* LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse
@@ -71,6 +71,14 @@ typedef struct
USB_Descriptor_Endpoint_t Extrakey_INEndpoint;
#endif
+#ifdef RAW_ENABLE
+ // Raw HID Interface
+ USB_Descriptor_Interface_t Raw_Interface;
+ USB_HID_Descriptor_HID_t Raw_HID;
+ USB_Descriptor_Endpoint_t Raw_INEndpoint;
+ USB_Descriptor_Endpoint_t Raw_OUTEndpoint;
+#endif
+
#ifdef CONSOLE_ENABLE
// Console HID Interface
USB_Descriptor_Interface_t Console_Interface;
@@ -104,6 +112,21 @@ typedef struct
USB_MIDI_Descriptor_Jack_Endpoint_t MIDI_Out_Jack_Endpoint_SPC;
#endif
+#ifdef VIRTSER_ENABLE
+ USB_Descriptor_Interface_Association_t CDC_Interface_Association;
+
+ // CDC Control Interface
+ USB_Descriptor_Interface_t CDC_CCI_Interface;
+ USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header;
+ USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM;
+ USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union;
+ USB_Descriptor_Endpoint_t CDC_NotificationEndpoint;
+
+ // CDC Data Interface
+ USB_Descriptor_Interface_t CDC_DCI_Interface;
+ USB_Descriptor_Endpoint_t CDC_DataOutEndpoint;
+ USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
+#endif
} USB_Descriptor_Configuration_t;
@@ -114,18 +137,24 @@ typedef struct
# define MOUSE_INTERFACE (KEYBOARD_INTERFACE + 1)
#else
# define MOUSE_INTERFACE KEYBOARD_INTERFACE
-#endif
+#endif
#ifdef EXTRAKEY_ENABLE
# define EXTRAKEY_INTERFACE (MOUSE_INTERFACE + 1)
#else
# define EXTRAKEY_INTERFACE MOUSE_INTERFACE
-#endif
+#endif
+
+#ifdef RAW_ENABLE
+# define RAW_INTERFACE (EXTRAKEY_INTERFACE + 1)
+#else
+# define RAW_INTERFACE EXTRAKEY_INTERFACE
+#endif
#ifdef CONSOLE_ENABLE
-# define CONSOLE_INTERFACE (EXTRAKEY_INTERFACE + 1)
+# define CONSOLE_INTERFACE (RAW_INTERFACE + 1)
#else
-# define CONSOLE_INTERFACE EXTRAKEY_INTERFACE
+# define CONSOLE_INTERFACE RAW_INTERFACE
#endif
#ifdef NKRO_ENABLE
@@ -141,15 +170,22 @@ typedef struct
# define AS_INTERFACE NKRO_INTERFACE
#endif
+#ifdef VIRTSER_ENABLE
+# define CCI_INTERFACE (AS_INTERFACE + 1)
+# define CDI_INTERFACE (AS_INTERFACE + 2)
+#else
+# define CDI_INTERFACE AS_INTERFACE
+#endif
+
/* nubmer of interfaces */
-#define TOTAL_INTERFACES AS_INTERFACE + 1
+#define TOTAL_INTERFACES (CDI_INTERFACE + 1)
// Endopoint number and size
#define KEYBOARD_IN_EPNUM 1
#ifdef MOUSE_ENABLE
-# define MOUSE_IN_EPNUM (KEYBOARD_IN_EPNUM + 1)
+# define MOUSE_IN_EPNUM (KEYBOARD_IN_EPNUM + 1)
#else
# define MOUSE_IN_EPNUM KEYBOARD_IN_EPNUM
#endif
@@ -157,15 +193,22 @@ typedef struct
#ifdef EXTRAKEY_ENABLE
# define EXTRAKEY_IN_EPNUM (MOUSE_IN_EPNUM + 1)
#else
-# define EXTRAKEY_IN_EPNUM MOUSE_IN_EPNUM
+# define EXTRAKEY_IN_EPNUM MOUSE_IN_EPNUM
+#endif
+
+#ifdef RAW_ENABLE
+# define RAW_IN_EPNUM (EXTRAKEY_IN_EPNUM + 1)
+# define RAW_OUT_EPNUM (EXTRAKEY_IN_EPNUM + 2)
+#else
+# define RAW_OUT_EPNUM EXTRAKEY_IN_EPNUM
#endif
#ifdef CONSOLE_ENABLE
-# define CONSOLE_IN_EPNUM (EXTRAKEY_IN_EPNUM + 1)
-# define CONSOLE_OUT_EPNUM (EXTRAKEY_IN_EPNUM + 1)
-//# define CONSOLE_OUT_EPNUM (EXTRAKEY_IN_EPNUM + 2)
+# define CONSOLE_IN_EPNUM (RAW_OUT_EPNUM + 1)
+//# define CONSOLE_OUT_EPNUM (RAW_OUT_EPNUM + 2)
+# define CONSOLE_OUT_EPNUM (RAW_OUT_EPNUM + 1)
#else
-# define CONSOLE_OUT_EPNUM EXTRAKEY_IN_EPNUM
+# define CONSOLE_OUT_EPNUM RAW_OUT_EPNUM
#endif
#ifdef NKRO_ENABLE
@@ -180,19 +223,34 @@ typedef struct
# define MIDI_STREAM_OUT_EPNUM (NKRO_IN_EPNUM + 2)
# define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM)
# define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM)
+#else
+# define MIDI_STREAM_OUT_EPNUM NKRO_IN_EPNUM
#endif
+#ifdef VIRTSER_ENABLE
+# define CDC_NOTIFICATION_EPNUM (MIDI_STREAM_OUT_EPNUM + 1)
+# define CDC_IN_EPNUM (MIDI_STREAM_OUT_EPNUM + 2)
+# define CDC_OUT_EPNUM (MIDI_STREAM_OUT_EPNUM + 3)
+# define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM)
+# define CDC_IN_EPADDR (ENDPOINT_DIR_IN | CDC_IN_EPNUM)
+# define CDC_OUT_EPADDR (ENDPOINT_DIR_OUT | CDC_OUT_EPNUM)
+#else
+# define CDC_OUT_EPNUM MIDI_STREAM_OUT_EPNUM
+#endif
-#if defined(__AVR_ATmega32U2__) && MIDI_STREAM_OUT_EPADDR > 4
-# error "Endpoints are not available enough to support all functions. Remove some in Makefile.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI)"
+#if defined(__AVR_ATmega32U2__) && CDC_OUT_EPNUM > 4
+# error "Endpoints are not available enough to support all functions. Remove some in Makefile.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, SERIAL)"
#endif
#define KEYBOARD_EPSIZE 8
#define MOUSE_EPSIZE 8
#define EXTRAKEY_EPSIZE 8
+#define RAW_EPSIZE 32
#define CONSOLE_EPSIZE 32
-#define NKRO_EPSIZE 16
+#define NKRO_EPSIZE 32
#define MIDI_STREAM_EPSIZE 64
+#define CDC_NOTIFICATION_EPSIZE 8
+#define CDC_EPSIZE 16
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,