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.
This commit is contained in:
parent
cd0adb7574
commit
51566d1a81
18 changed files with 265 additions and 31 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue