diff options
Diffstat (limited to 'protocol/lufa/descriptor.h')
| -rw-r--r-- | protocol/lufa/descriptor.h | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/protocol/lufa/descriptor.h b/protocol/lufa/descriptor.h index 09fb24acc..44f20d5a2 100644 --- a/protocol/lufa/descriptor.h +++ b/protocol/lufa/descriptor.h | |||
| @@ -57,24 +57,26 @@ typedef struct | |||
| 57 | USB_HID_Descriptor_HID_t Keyboard_HID; | 57 | USB_HID_Descriptor_HID_t Keyboard_HID; |
| 58 | USB_Descriptor_Endpoint_t Keyboard_INEndpoint; | 58 | USB_Descriptor_Endpoint_t Keyboard_INEndpoint; |
| 59 | 59 | ||
| 60 | // Mouse HID Interface | ||
| 61 | #ifdef MOUSE_ENABLE | 60 | #ifdef MOUSE_ENABLE |
| 61 | // Mouse HID Interface | ||
| 62 | USB_Descriptor_Interface_t Mouse_Interface; | 62 | USB_Descriptor_Interface_t Mouse_Interface; |
| 63 | USB_HID_Descriptor_HID_t Mouse_HID; | 63 | USB_HID_Descriptor_HID_t Mouse_HID; |
| 64 | USB_Descriptor_Endpoint_t Mouse_INEndpoint; | 64 | USB_Descriptor_Endpoint_t Mouse_INEndpoint; |
| 65 | #endif | 65 | #endif |
| 66 | 66 | ||
| 67 | #ifdef EXTRAKEY_ENABLE | ||
| 68 | // Extrakey HID Interface | ||
| 69 | USB_Descriptor_Interface_t Extrakey_Interface; | ||
| 70 | USB_HID_Descriptor_HID_t Extrakey_HID; | ||
| 71 | USB_Descriptor_Endpoint_t Extrakey_INEndpoint; | ||
| 72 | #endif | ||
| 73 | |||
| 74 | #ifdef CONSOLE_ENABLE | ||
| 67 | // Console HID Interface | 75 | // Console HID Interface |
| 68 | USB_Descriptor_Interface_t Console_Interface; | 76 | USB_Descriptor_Interface_t Console_Interface; |
| 69 | USB_HID_Descriptor_HID_t Console_HID; | 77 | USB_HID_Descriptor_HID_t Console_HID; |
| 70 | USB_Descriptor_Endpoint_t Console_INEndpoint; | 78 | USB_Descriptor_Endpoint_t Console_INEndpoint; |
| 71 | USB_Descriptor_Endpoint_t Console_OUTEndpoint; | 79 | USB_Descriptor_Endpoint_t Console_OUTEndpoint; |
| 72 | |||
| 73 | // Extra HID Interface | ||
| 74 | #ifdef EXTRAKEY_ENABLE | ||
| 75 | USB_Descriptor_Interface_t Extra_Interface; | ||
| 76 | USB_HID_Descriptor_HID_t Extra_HID; | ||
| 77 | USB_Descriptor_Endpoint_t Extra_INEndpoint; | ||
| 78 | #endif | 80 | #endif |
| 79 | } USB_Descriptor_Configuration_t; | 81 | } USB_Descriptor_Configuration_t; |
| 80 | 82 | ||
| @@ -89,12 +91,16 @@ typedef struct | |||
| 89 | #endif | 91 | #endif |
| 90 | 92 | ||
| 91 | #ifdef EXTRAKEY_ENABLE | 93 | #ifdef EXTRAKEY_ENABLE |
| 92 | # define EXTRA_INTERFACE (MOUSE_INTERFACE + 1) | 94 | # define EXTRAKEY_INTERFACE (MOUSE_INTERFACE + 1) |
| 93 | #else | 95 | #else |
| 94 | # define EXTRA_INTERFACE MOUSE_INTERFACE | 96 | # define EXTRAKEY_INTERFACE MOUSE_INTERFACE |
| 95 | #endif | 97 | #endif |
| 96 | 98 | ||
| 97 | #define CONSOLE_INTERFACE (EXTRA_INTERFACE + 1) | 99 | #ifdef CONSOLE_ENABLE |
| 100 | # define CONSOLE_INTERFACE (EXTRAKEY_INTERFACE + 1) | ||
| 101 | #else | ||
| 102 | # define CONSOLE_INTERFACE EXTRAKEY_INTERFACE | ||
| 103 | #endif | ||
| 98 | 104 | ||
| 99 | 105 | ||
| 100 | /* nubmer of interfaces */ | 106 | /* nubmer of interfaces */ |
| @@ -103,15 +109,29 @@ typedef struct | |||
| 103 | 109 | ||
| 104 | // Endopoint number and size | 110 | // Endopoint number and size |
| 105 | #define KEYBOARD_IN_EPNUM 1 | 111 | #define KEYBOARD_IN_EPNUM 1 |
| 106 | #define MOUSE_IN_EPNUM 2 | 112 | |
| 107 | #define CONSOLE_IN_EPNUM 3 | 113 | #ifdef MOUSE_ENABLE |
| 108 | #define CONSOLE_OUT_EPNUM 4 | 114 | # define MOUSE_IN_EPNUM (KEYBOARD_IN_EPNUM + 1) |
| 109 | #define EXTRA_IN_EPNUM 5 | 115 | #else |
| 116 | # define MOUSE_IN_EPNUM KEYBOARD_IN_EPNUM | ||
| 117 | #endif | ||
| 118 | |||
| 119 | #ifdef EXTRAKEY_ENABLE | ||
| 120 | # define EXTRAKEY_IN_EPNUM (MOUSE_IN_EPNUM + 1) | ||
| 121 | #else | ||
| 122 | # define EXTRAKEY_IN_EPNUM MOUSE_IN_EPNUM | ||
| 123 | #endif | ||
| 124 | |||
| 125 | #ifdef CONSOLE_ENABLE | ||
| 126 | # define CONSOLE_IN_EPNUM (EXTRAKEY_IN_EPNUM + 1) | ||
| 127 | # define CONSOLE_OUT_EPNUM (EXTRAKEY_IN_EPNUM + 2) | ||
| 128 | #endif | ||
| 129 | |||
| 110 | 130 | ||
| 111 | #define KEYBOARD_EPSIZE 8 | 131 | #define KEYBOARD_EPSIZE 8 |
| 112 | #define MOUSE_EPSIZE 8 | 132 | #define MOUSE_EPSIZE 8 |
| 133 | #define EXTRAKEY_EPSIZE 8 | ||
| 113 | #define CONSOLE_EPSIZE 32 | 134 | #define CONSOLE_EPSIZE 32 |
| 114 | #define EXTRA_EPSIZE 8 | ||
| 115 | 135 | ||
| 116 | 136 | ||
| 117 | uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, | 137 | uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, |
