/** \ingroup Group_USB\r
* @defgroup Group_HIDParser HID Report Parser\r
*\r
+ * \section Sec_Dependencies Module Source Dependencies\r
+ * The following files must be built with any user project that uses this module:\r
+ * - LUFA/Drivers/USB/Class/Host/HIDParser.c\r
+ *\r
+ * \section Module Description\r
* Functions, macros, variables, enums and types related to the parsing of HID class device report descriptors.\r
*\r
* The processed HID report is presented back to the user application as a flat structure containing each report\r
#if !defined(HID_STATETABLE_STACK_DEPTH) || defined(__DOXYGEN__)\r
/** Constant indicating the maximum stack depth of the state table. A larger state table\r
* allows for more PUSH/POP report items to be nested, but consumes more memory. By default\r
- * this is set to 3 levels (allowing for two PUSHes to be nested) but this can be overridden by\r
+ * this is set to 2 levels (allowing non-nested PUSH items) but this can be overridden by\r
* defining HID_STATETABLE_STACK_DEPTH to another value in the user project makefile, passing the\r
* define to the compiler using the -D compiler switch.\r
*/\r
- #define HID_STATETABLE_STACK_DEPTH 3\r
+ #define HID_STATETABLE_STACK_DEPTH 2\r
#endif\r
\r
#if !defined(HID_USAGE_STACK_DEPTH) || defined(__DOXYGEN__)\r
HID_PARSE_HIDStackOverflow = 1, /**< More than \ref HID_STATETABLE_STACK_DEPTH nested PUSHes in the report. */ \r
HID_PARSE_HIDStackUnderflow = 2, /**< A POP was found when the state table stack was empty. */\r
HID_PARSE_InsufficientReportItems = 3, /**< More than \ref HID_MAX_REPORTITEMS report items in the report. */\r
- HID_PARSE_UnexpectedEndCollection = 4, /**< END COLLECTION found without matching COLLECTION item. */\r
+ HID_PARSE_UnexpectedEndCollection = 4, /**< An END COLLECTION item found without matching COLLECTION item. */\r
HID_PARSE_InsufficientCollectionPaths = 5, /**< More than \ref HID_MAX_COLLECTIONS collections in the report. */\r
HID_PARSE_UsageStackOverflow = 6, /**< More than \ref HID_USAGE_STACK_DEPTH usages listed in a row. */\r
};\r
typedef struct\r
{\r
uint8_t TotalReportItems; /**< Total number of report items stored in the\r
- * ReportItems array. */\r
-\r
+ * ReportItems array.\r
+ */\r
HID_ReportItem_t ReportItems[HID_MAX_REPORTITEMS]; /**< Report items array, including\r
- * all IN, OUT and FEATURE items. */\r
-\r
+ * all IN, OUT and FEATURE items.\r
+ */\r
HID_CollectionPath_t CollectionPaths[HID_MAX_COLLECTIONS]; /**< All collection items, referenced\r
- * by the report items. */\r
+ * by the report items.\r
+ */\r
+ bool UsingMultipleReports; /**< Indicates if the device has at least one REPORT ID\r
+ * element in its HID report descriptor.\r
+ */\r
} HID_ReportInfo_t;\r
\r
/* Function Prototypes: */\r
/** Function to process a given HID report returned from an attached device, and store it into a given\r
* \ref HID_ReportInfo_t structure.\r
*\r
- * \param ReportData Buffer containing the device's HID report table\r
- * \param ReportSize Size in bytes of the HID report table\r
- * \param ParserData Pointer to a \ref HID_ReportInfo_t instance for the parser output\r
+ * \param[in] ReportData Buffer containing the device's HID report table\r
+ * \param[in] ReportSize Size in bytes of the HID report table\r
+ * \param[out] ParserData Pointer to a \ref HID_ReportInfo_t instance for the parser output\r
*\r
* \return A value in the \ref HID_Parse_ErrorCodes_t enum\r
*/\r
/** Extracts the given report item's value out of the given HID report and places it into the Value\r
* member of the report item's \ref HID_ReportItem_t structure.\r
*\r
- * \param ReportData Buffer containing an IN or FEATURE report from an attached device\r
- * \param ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array\r
+ * \param[in] ReportData Buffer containing an IN or FEATURE report from an attached device\r
+ * \param[in,out] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array\r
*\r
* \returns Boolean true if the item to retrieve was located in the given report, false otherwise\r
*/\r
* buffer. The report buffer is assumed to have the appropriate bits cleared before calling\r
* this function (i.e., the buffer should be explicitly cleared before report values are added).\r
*\r
- * If the device has multiple HID reports, the report ID is set to the report ID of the given item.\r
+ * If the device has multiple HID reports, the first byte in the report is set to the report ID of the given item.\r
*\r
- * \param ReportData Buffer holding the current OUT report data\r
- * \param ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array\r
+ * \param[out] ReportData Buffer holding the current OUT or FEATURE report data\r
+ * \param[in] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array\r
*/\r
void USB_SetHIDReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* ReportItem)\r
ATTR_NON_NULL_PTR_ARG(1, 2);\r