HID用作滑鼠的報告描述符解析
const uint8_t HID_ReportDescriptor[] = {
USAGE_PAGE(Generic Desktop) //全域性專案,用途頁用作通用桌面
USAGE (Mouse) //區域性專案,說明接下來的應用集合用途用作滑鼠
COLLECTION (Application) //集合開始,是一個應用集合
USAGE (Pointer) //區域性專案,說明用途為指標
COLLECTION (Physical) //物理集合,用途由前面的區域性專案定義為指標集合
USAGE_PAGE (Button) //全域性專案,選擇用途頁為按鍵
USAGE_MINIMUM (Button 1) //用法的最小值為1,實際上是滑鼠左鍵
USAGE_MAXIMUM (Button 3) //用法的最大值為3,實際上是滑鼠中鍵
LOGICAL_MINIMUM (0) //返回的資料域最小值
LOGICAL_MAXIMUM (1) //返回的資料域最大值
REPORT_SIZE (1) //說明每個資料域的長度為1個位
REPORT_COUNT (3) //資料域的數目為3個
INPUT (Data,Var,Abs) //主專案,說明三個長度為1位的資料域(數量和長度由前面兩個全域性專案定義)用來作為輸 //入,屬性資料可變動,獨立的變數
USAGE_PAGE (Generic Desktop) //下面是定義X軸和Y軸
USAGE (X)
LOGICAL_MINIMUM (0)
LOGICAL_MAXIMUM (1365)
PHYSICAL_MINIMUM (0)
PHYSICAL_MAXIMUM (1365)
REPORT_SIZE (16)
REPORT_COUNT (1)
INPUT (Data,Var,Abs)
USAGE (Y)
LOGICAL_MINIMUM (0)
LOGICAL_MAXIMUM (767)
PHYSICAL_MINIMUM (0)
PHYSICAL_MAXIMUM (767)
REPORT_SIZE (16)
REPORT_COUNT (1)
INPUT (Data,Var,Abs)
END_COLLECTION
END_COLLECTION
}