3      Copyright (C) Dean Camera, 2018. 
   5   dean [at] fourwalledcubicle [dot] com 
  10   Copyright 2018  Dean Camera (dean [at] fourwalledcubicle [dot] com) 
  11   Copyright 2010  Denver Gingerich (denver [at] ossguy [dot] com) 
  13   Permission to use, copy, modify, distribute, and sell this 
  14   software and its documentation for any purpose is hereby granted 
  15   without fee, provided that the above copyright notice appear in 
  16   all copies and that both that the copyright notice and this 
  17   permission notice and warranty disclaimer appear in supporting 
  18   documentation, and that the name of the author not be used in 
  19   advertising or publicity pertaining to distribution of the 
  20   software without specific, written prior permission. 
  22   The author disclaims all warranties with regard to this 
  23   software, including all implied warranties of merchantability 
  24   and fitness.  In no event shall the author be liable for any 
  25   special, indirect or consequential damages or any damages 
  26   whatsoever resulting from loss of use, data or profits, whether 
  27   in an action of contract, negligence or other tortious action, 
  28   arising out of or in connection with the use or performance of 
  34  *  Header file for Descriptors.c. 
  37 #ifndef _DESCRIPTORS_H_ 
  38 #define _DESCRIPTORS_H_ 
  41                 #include <LUFA/Drivers/USB/USB.h> 
  43                 #include <avr/pgmspace.h> 
  46                 /** Type define for the device configuration descriptor structure. This must be defined in the 
  47                  *  application code, as the configuration descriptor contains several sub-descriptors which 
  48                  *  vary between devices, and which describe the device's usage to the host. 
  52                         USB_Descriptor_Configuration_Header_t Config
; 
  54                         // Keyboard HID Interface 
  55                         USB_Descriptor_Interface_t            HID1_KeyboardInterface
; 
  56                         USB_HID_Descriptor_HID_t              HID1_KeyboardHID
; 
  57                         USB_Descriptor_Endpoint_t             HID1_ReportINEndpoint
; 
  58                         USB_Descriptor_Endpoint_t             HID1_ReportOUTEndpoint
; 
  60                         // Mouse HID Interface 
  61                         USB_Descriptor_Interface_t            HID2_MouseInterface
; 
  62                         USB_HID_Descriptor_HID_t              HID2_MouseHID
; 
  63                         USB_Descriptor_Endpoint_t             HID2_ReportINEndpoint
; 
  64                 } USB_Descriptor_Configuration_t
; 
  66                 /** Enum for the device interface descriptor IDs within the device. Each interface descriptor 
  67                  *  should have a unique ID index associated with it, which can be used to refer to the 
  68                  *  interface from other descriptors. 
  70                 enum InterfaceDescriptors_t
 
  72                         INTERFACE_ID_Keyboard 
= 0, /**< Keyboard interface descriptor ID */ 
  73                         INTERFACE_ID_Mouse    
= 1, /**< Mouse interface descriptor ID */ 
  76                 /** Enum for the device string descriptor IDs within the device. Each string descriptor should 
  77                  *  have a unique ID index associated with it, which can be used to refer to the string from 
  80                 enum StringDescriptors_t
 
  82                         STRING_ID_Language     
= 0, /**< Supported Languages string descriptor ID (must be zero) */ 
  83                         STRING_ID_Manufacturer 
= 1, /**< Manufacturer string ID */ 
  84                         STRING_ID_Product      
= 2, /**< Product string ID */ 
  88                 /** Endpoint address of the Keyboard HID reporting IN endpoint. */ 
  89                 #define KEYBOARD_IN_EPADDR        (ENDPOINT_DIR_IN  | 1) 
  91                 /** Endpoint address of the Keyboard HID reporting OUT endpoint. */ 
  92                 #define KEYBOARD_OUT_EPADDR       (ENDPOINT_DIR_OUT | 2) 
  94                 /** Endpoint address of the Mouse HID reporting IN endpoint. */ 
  95                 #define MOUSE_IN_EPADDR           (ENDPOINT_DIR_IN  | 3) 
  97                 /** Size in bytes of each of the HID reporting IN and OUT endpoints. */ 
 100         /* Function Prototypes: */ 
 101                 uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue
, 
 102                                                     const uint16_t wIndex
, 
 103                                                     const void** const DescriptorAddress
) 
 104                                                     ATTR_WARN_UNUSED_RESULT 
ATTR_NON_NULL_PTR_ARG(3);