aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Host/HIDParser.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-09-20 12:01:25 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-09-20 12:01:25 +0000
commit51566d1a811f43dc39f38cb597de44ba9363d974 (patch)
tree9dc1b20907accffd98fecec2f0e034331fa41b2d /LUFA/Drivers/USB/Class/Host/HIDParser.c
parentcd0adb7574525978f50eabd536f7563f2d9f9aa7 (diff)
downloadlufa-51566d1a811f43dc39f38cb597de44ba9363d974.tar.gz
lufa-51566d1a811f43dc39f38cb597de44ba9363d974.tar.bz2
lufa-51566d1a811f43dc39f38cb597de44ba9363d974.zip
Added new Pipe_IsFrozen() macro to determine if the currently selected pipe is frozen.
Added new USB_GetHIDReportSize() function to the HID report parser to retrieve the size of a given report by its ID. More additions to the unfinished HID Host Class Driver.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/HIDParser.c')
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDParser.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c
index 4293a3d98..008d173f0 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDParser.c
+++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c
@@ -342,4 +342,25 @@ void USB_SetHIDReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* Repor
}
}
+uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData, uint8_t ReportID, uint8_t ReportType)
+{
+ for (uint8_t i = 0; i < HID_MAX_REPORT_IDS; i++)
+ {
+ if (ParserData->ReportIDSizes[i].ReportID == ReportID)
+ {
+ switch (ReportType)
+ {
+ case REPORT_ITEM_TYPE_In:
+ return ParserData->ReportIDSizes[i].BitsIn;
+ case REPORT_ITEM_TYPE_Out:
+ return ParserData->ReportIDSizes[i].BitsOut;
+ case REPORT_ITEM_TYPE_Feature:
+ return ParserData->ReportIDSizes[i].BitsFeature;
+ }
+ }
+ }
+
+ return 0;
+}
+
#endif