Fixed error in PrinterHost preventing the full page data from being sent to the attac...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / HID.h
index 1959fd2..48cdcb0 100644 (file)
@@ -47,6 +47,7 @@
        /* Includes: */\r
                #include "../../USB.h"\r
                #include "../Common/HID.h"\r
        /* Includes: */\r
                #include "../../USB.h"\r
                #include "../Common/HID.h"\r
+               #include "HIDParser.h"\r
                \r
        /* Enable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
                \r
        /* Enable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
                                {\r
                                        uint8_t  DataINPipeNumber; /**< Pipe number of the HID interface's IN data pipe */\r
                                        uint8_t  DataOUTPipeNumber; /**< Pipe number of the HID interface's OUT data pipe */\r
                                {\r
                                        uint8_t  DataINPipeNumber; /**< Pipe number of the HID interface's IN data pipe */\r
                                        uint8_t  DataOUTPipeNumber; /**< Pipe number of the HID interface's OUT data pipe */\r
-                                       \r
-                                       bool     MatchInterfaceProtocol;\r
-                                       uint8_t  HIDInterfaceProtocol;\r
+\r
+                                       uint8_t  HIDInterfaceProtocol; /**< HID interface protocol value to match against if a specific\r
+                                                                       *   boot subclass protocol is required (e.g. keyboard, mouse), or\r
+                                                                       *   leave as 0 to match against the first HID interface found\r
+                                                                       */\r
                                } Config; /**< Config data for the USB class interface within the device. All elements in this section\r
                                           *   <b>must</b> be set or the interface will fail to enumerate and operate correctly.\r
                                           */\r
                                struct\r
                                {\r
                                } Config; /**< Config data for the USB class interface within the device. All elements in this section\r
                                           *   <b>must</b> be set or the interface will fail to enumerate and operate correctly.\r
                                           */\r
                                struct\r
                                {\r
+                                       bool Active; /**< Indicates if the current interface instance is connected to an attached device, valid\r
+                                                     *   after \ref HID_Host_ConfigurePipes() is called and the Host state machine is in the\r
+                                                     *   Configured state\r
+                                                     */\r
+                                       uint8_t InterfaceNumber; /**< Interface index of the HID interface within the attached device */\r
+\r
                                        uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe */\r
                                        uint16_t DataOUTPipeSize;  /**< Size in bytes of the HID interface's OUT data pipe */\r
                                        uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe */\r
                                        uint16_t DataOUTPipeSize;  /**< Size in bytes of the HID interface's OUT data pipe */\r
+                                       \r
+                                       bool SupportsBootSubClass; /**< Indicates if the current interface instance supports the HID Boot\r
+                                                                   *   Protocol when enabled via \ref USB_HID_Host_SetProtocol()\r
+                                                                   */\r
                                } State; /**< State data for the USB class interface within the device. All elements in this section\r
                                                  *   <b>may</b> be set to initial values, but may also be ignored to default to sane values when\r
                                                  *   the interface is enumerated.\r
                                } State; /**< State data for the USB class interface within the device. All elements in this section\r
                                                  *   <b>may</b> be set to initial values, but may also be ignored to default to sane values when\r
                                                  *   the interface is enumerated.\r
                        } USB_ClassInfo_HID_Host_t;\r
 \r
                /* Enums: */\r
                        } USB_ClassInfo_HID_Host_t;\r
 \r
                /* Enums: */\r
-                       enum\r
+                       enum HIDHost_EnumerationFailure_ErrorCodes_t\r
                        {\r
                                HID_ENUMERROR_NoError                    = 0, /**< Configuration Descriptor was processed successfully */\r
                                HID_ENUMERROR_InvalidConfigDescriptor    = 1, /**< The device returned an invalid Configuration Descriptor */\r
                                HID_ENUMERROR_NoHIDInterfaceFound        = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor */\r
                        {\r
                                HID_ENUMERROR_NoError                    = 0, /**< Configuration Descriptor was processed successfully */\r
                                HID_ENUMERROR_InvalidConfigDescriptor    = 1, /**< The device returned an invalid Configuration Descriptor */\r
                                HID_ENUMERROR_NoHIDInterfaceFound        = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor */\r
-                               HID_ENUMERROR_EndpointsNotFound          = 3, /**< Compatible HID endpoints were not found in the device's CDC interface */\r
-                       } CDCHost_EnumerationFailure_ErrorCodes_t;\r
+                               HID_ENUMERROR_EndpointsNotFound          = 3, /**< Compatible HID endpoints were not found in the device's HID interface */\r
+                       };\r
        \r
                /* Function Prototypes: */\r
        \r
                /* Function Prototypes: */\r
-                       void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo);\r
+                       void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
                        uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, uint16_t ConfigDescriptorLength,\r
                        uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, uint16_t ConfigDescriptorLength,\r
-                                                       uint8_t* DeviceConfigDescriptor);\r
+                                                       uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3);\r
+\r
+                       bool    HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
+                       uint8_t USB_HID_Host_SetProtocol(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, bool UseReportProtocol) ATTR_NON_NULL_PTR_ARG(1);\r
                \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r
                \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r
 \r
                /* Function Prototypes: */\r
                        #if defined(INCLUDE_FROM_HID_CLASS_HOST_C)\r
 \r
                /* Function Prototypes: */\r
                        #if defined(INCLUDE_FROM_HID_CLASS_HOST_C)\r
-                               static uint8_t DComp_HID_Host_NextHIDInterface(void* CurrentDescriptor);\r
-                               static uint8_t DComp_HID_Host_NextInterfaceHIDDataEndpoint(void* CurrentDescriptor);\r
+                               static uint8_t DComp_HID_Host_NextHIDInterface(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);\r
+                               static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);\r
                        #endif  \r
        #endif  \r
        \r
                        #endif  \r
        #endif  \r
        \r