diff options
Diffstat (limited to 'keyboard/lufa/Descriptors.h')
| -rw-r--r-- | keyboard/lufa/Descriptors.h | 89 |
1 files changed, 43 insertions, 46 deletions
diff --git a/keyboard/lufa/Descriptors.h b/keyboard/lufa/Descriptors.h index 05b2035bb..03e2426a3 100644 --- a/keyboard/lufa/Descriptors.h +++ b/keyboard/lufa/Descriptors.h | |||
| @@ -37,51 +37,48 @@ | |||
| 37 | #ifndef _DESCRIPTORS_H_ | 37 | #ifndef _DESCRIPTORS_H_ |
| 38 | #define _DESCRIPTORS_H_ | 38 | #define _DESCRIPTORS_H_ |
| 39 | 39 | ||
| 40 | /* Includes: */ | 40 | #include <LUFA/Drivers/USB/USB.h> |
| 41 | #include <LUFA/Drivers/USB/USB.h> | 41 | #include <avr/pgmspace.h> |
| 42 | 42 | ||
| 43 | #include <avr/pgmspace.h> | 43 | |
| 44 | 44 | typedef struct | |
| 45 | /* Type Defines: */ | 45 | { |
| 46 | /** Type define for the device configuration descriptor structure. This must be defined in the | 46 | USB_Descriptor_Configuration_Header_t Config; |
| 47 | * application code, as the configuration descriptor contains several sub-descriptors which | 47 | |
| 48 | * vary between devices, and which describe the device's usage to the host. | 48 | // Keyboard HID Interface |
| 49 | */ | 49 | USB_Descriptor_Interface_t HID1_KeyboardInterface; |
| 50 | typedef struct | 50 | USB_HID_Descriptor_HID_t HID1_KeyboardHID; |
| 51 | { | 51 | USB_Descriptor_Endpoint_t HID1_ReportINEndpoint; |
| 52 | USB_Descriptor_Configuration_Header_t Config; | 52 | USB_Descriptor_Endpoint_t HID1_ReportOUTEndpoint; |
| 53 | 53 | ||
| 54 | // Keyboard HID Interface | 54 | // Mouse HID Interface |
| 55 | USB_Descriptor_Interface_t HID1_KeyboardInterface; | 55 | USB_Descriptor_Interface_t HID2_MouseInterface; |
| 56 | USB_HID_Descriptor_HID_t HID1_KeyboardHID; | 56 | USB_HID_Descriptor_HID_t HID2_MouseHID; |
| 57 | USB_Descriptor_Endpoint_t HID1_ReportINEndpoint; | 57 | USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; |
| 58 | USB_Descriptor_Endpoint_t HID1_ReportOUTEndpoint; | 58 | |
| 59 | 59 | // Generic HID Interface | |
| 60 | // Mouse HID Interface | 60 | USB_Descriptor_Interface_t HID3_GenericInterface; |
| 61 | USB_Descriptor_Interface_t HID2_MouseInterface; | 61 | USB_HID_Descriptor_HID_t HID3_GenericHID; |
| 62 | USB_HID_Descriptor_HID_t HID2_MouseHID; | 62 | USB_Descriptor_Endpoint_t HID3_ReportINEndpoint; |
| 63 | USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; | 63 | USB_Descriptor_Endpoint_t HID3_ReportOUTEndpoint; |
| 64 | USB_Descriptor_Endpoint_t HID2_ReportOUTEndpoint; | 64 | } USB_Descriptor_Configuration_t; |
| 65 | } USB_Descriptor_Configuration_t; | ||
| 66 | |||
| 67 | /* Macros: */ | ||
| 68 | /** Endpoint number of the Keyboard HID reporting IN endpoint. */ | ||
| 69 | #define KEYBOARD_IN_EPNUM 1 | ||
| 70 | |||
| 71 | /** Endpoint number of the Keyboard HID reporting OUT endpoint. */ | ||
| 72 | #define KEYBOARD_OUT_EPNUM 2 | ||
| 73 | |||
| 74 | /** Endpoint number of the Mouse HID reporting IN endpoint. */ | ||
| 75 | #define MOUSE_IN_EPNUM 3 | ||
| 76 | |||
| 77 | /** Size in bytes of each of the HID reporting IN and OUT endpoints. */ | ||
| 78 | #define HID_EPSIZE 8 | ||
| 79 | |||
| 80 | /* Function Prototypes: */ | ||
| 81 | uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, | ||
| 82 | const uint8_t wIndex, | ||
| 83 | const void** const DescriptorAddress) | ||
| 84 | ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); | ||
| 85 | 65 | ||
| 86 | #endif | ||
| 87 | 66 | ||
| 67 | // Endopoint number/size | ||
| 68 | #define KEYBOARD_IN_EPNUM 1 | ||
| 69 | #define KEYBOARD_OUT_EPNUM 2 | ||
| 70 | #define MOUSE_IN_EPNUM 3 | ||
| 71 | #define GENERIC_IN_EPNUM 4 | ||
| 72 | #define GENERIC_OUT_EPNUM 5 | ||
| 73 | |||
| 74 | #define HID_EPSIZE 8 | ||
| 75 | #define GENERIC_EPSIZE 8 | ||
| 76 | #define GENERIC_REPORT_SIZE 8 | ||
| 77 | |||
| 78 | |||
| 79 | uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, | ||
| 80 | const uint8_t wIndex, | ||
| 81 | const void** const DescriptorAddress) | ||
| 82 | ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); | ||
| 83 | |||
| 84 | #endif | ||
