From 3969ec09b48026b51e9d7c210b7c8d15dceb3b4b Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 27 Jun 2012 18:31:33 +0900 Subject: Add sendchar with Generic HID to support debug print. --- keyboard/lufa/Descriptors.h | 89 ++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 46 deletions(-) (limited to 'keyboard/lufa/Descriptors.h') diff --git a/keyboard/lufa/Descriptors.h b/keyboard/lufa/Descriptors.h index 05b2035bb1..03e2426a37 100644 --- a/keyboard/lufa/Descriptors.h +++ b/keyboard/lufa/Descriptors.h @@ -37,51 +37,48 @@ #ifndef _DESCRIPTORS_H_ #define _DESCRIPTORS_H_ - /* Includes: */ - #include - - #include - - /* Type Defines: */ - /** Type define for the device configuration descriptor structure. This must be defined in the - * application code, as the configuration descriptor contains several sub-descriptors which - * vary between devices, and which describe the device's usage to the host. - */ - typedef struct - { - USB_Descriptor_Configuration_Header_t Config; - - // Keyboard HID Interface - USB_Descriptor_Interface_t HID1_KeyboardInterface; - USB_HID_Descriptor_HID_t HID1_KeyboardHID; - USB_Descriptor_Endpoint_t HID1_ReportINEndpoint; - USB_Descriptor_Endpoint_t HID1_ReportOUTEndpoint; - - // Mouse HID Interface - USB_Descriptor_Interface_t HID2_MouseInterface; - USB_HID_Descriptor_HID_t HID2_MouseHID; - USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; - USB_Descriptor_Endpoint_t HID2_ReportOUTEndpoint; - } USB_Descriptor_Configuration_t; - - /* Macros: */ - /** Endpoint number of the Keyboard HID reporting IN endpoint. */ - #define KEYBOARD_IN_EPNUM 1 - - /** Endpoint number of the Keyboard HID reporting OUT endpoint. */ - #define KEYBOARD_OUT_EPNUM 2 - - /** Endpoint number of the Mouse HID reporting IN endpoint. */ - #define MOUSE_IN_EPNUM 3 - - /** Size in bytes of each of the HID reporting IN and OUT endpoints. */ - #define HID_EPSIZE 8 - - /* Function Prototypes: */ - uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, - const void** const DescriptorAddress) - ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); +#include +#include + + +typedef struct +{ + USB_Descriptor_Configuration_Header_t Config; + + // Keyboard HID Interface + USB_Descriptor_Interface_t HID1_KeyboardInterface; + USB_HID_Descriptor_HID_t HID1_KeyboardHID; + USB_Descriptor_Endpoint_t HID1_ReportINEndpoint; + USB_Descriptor_Endpoint_t HID1_ReportOUTEndpoint; + + // Mouse HID Interface + USB_Descriptor_Interface_t HID2_MouseInterface; + USB_HID_Descriptor_HID_t HID2_MouseHID; + USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; + + // Generic HID Interface + USB_Descriptor_Interface_t HID3_GenericInterface; + USB_HID_Descriptor_HID_t HID3_GenericHID; + USB_Descriptor_Endpoint_t HID3_ReportINEndpoint; + USB_Descriptor_Endpoint_t HID3_ReportOUTEndpoint; +} USB_Descriptor_Configuration_t; -#endif +// Endopoint number/size +#define KEYBOARD_IN_EPNUM 1 +#define KEYBOARD_OUT_EPNUM 2 +#define MOUSE_IN_EPNUM 3 +#define GENERIC_IN_EPNUM 4 +#define GENERIC_OUT_EPNUM 5 + +#define HID_EPSIZE 8 +#define GENERIC_EPSIZE 8 +#define GENERIC_REPORT_SIZE 8 + + +uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, + const uint8_t wIndex, + const void** const DescriptorAddress) + ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); + +#endif -- cgit v1.2.3