TianoCore EDK2 master
|
#include "UsbMouse.h"
Go to the source code of this file.
Functions | |
UINT8 * | GetNextHidItem (IN UINT8 *StartPos, IN UINT8 *EndPos, OUT HID_ITEM *HidItem) |
UINT32 | GetItemData (IN HID_ITEM *HidItem) |
VOID | ParseHidItem (IN USB_MOUSE_DEV *UsbMouse, IN HID_ITEM *HidItem) |
EFI_STATUS | ParseMouseReportDescriptor (OUT USB_MOUSE_DEV *UsbMouse, IN UINT8 *ReportDescriptor, IN UINTN ReportSize) |
Helper functions to parse HID report descriptor and items.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MouseHid.c.
Get data from HID item.
This function retrieves data from HID item. It only supports short items, which has 4 types of data: 0, 1, 2, or 4 bytes.
HidItem | Pointer to the HID item. |
Definition at line 131 of file MouseHid.c.
Get next HID item from report descriptor.
This function retrieves next HID item from report descriptor, according to the start position. According to USB HID Specification, An item is piece of information about the device. All items have a one-byte prefix that contains the item tag, item type, and item size. There are two basic types of items: short items and long items. If the item is a short item, its optional data size may be 0, 1, 2, or 4 bytes. Only short item is supported here.
StartPos | Start position of the HID item to get. |
EndPos | End position of the range to get the next HID item. |
HidItem | Buffer for the HID Item to return. |
Definition at line 32 of file MouseHid.c.
VOID ParseHidItem | ( | IN USB_MOUSE_DEV * | UsbMouse, |
IN HID_ITEM * | HidItem | ||
) |
Parse HID item from report descriptor.
There are three item types: Main, Global, and Local. This function parses these types of HID items according to tag info.
UsbMouse | The instance of USB_MOUSE_DEV |
HidItem | The HID item to parse |
Definition at line 162 of file MouseHid.c.
EFI_STATUS ParseMouseReportDescriptor | ( | OUT USB_MOUSE_DEV * | UsbMouse, |
IN UINT8 * | ReportDescriptor, | ||
IN UINTN | ReportSize | ||
) |
Parse Mouse Report Descriptor.
According to USB HID Specification, report descriptors are composed of pieces of information. Each piece of information is called an Item. This function retrieves each item from the report descriptor and updates USB_MOUSE_DEV.
UsbMouse | The instance of USB_MOUSE_DEV |
ReportDescriptor | Report descriptor to parse |
ReportSize | Report descriptor size |
EFI_SUCCESS | Report descriptor successfully parsed. |
EFI_UNSUPPORTED | Report descriptor contains long item. |
Definition at line 242 of file MouseHid.c.