161 lines
3.8 KiB
C
161 lines
3.8 KiB
C
|
|
/********************************************************************************
|
|||
|
|
* Copyright (c) 2016, Beijing Tongfang Microelectroics Co., Ltd.
|
|||
|
|
* All rights reserved.
|
|||
|
|
* Module: HID descripter and global parameter
|
|||
|
|
* Author: Yang Song
|
|||
|
|
* Version: V1.0
|
|||
|
|
* History:
|
|||
|
|
* 2016-09-22 Original version
|
|||
|
|
********************************************************************************/
|
|||
|
|
#include "global.h"
|
|||
|
|
|
|||
|
|
const u8 usbHidPosInterfaceDescriptor[] = {
|
|||
|
|
0x09,0x04,0x00,0x00,0x02,0x03,0x00,0x00,0x00,//<2F><>ǰ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0x07,<2C><><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD>Ͳ<EFBFBD><CDB2>ְ<EFBFBD><EFBFBD><D7BF><EFBFBD><EFBFBD>ȡʧ<C8A1>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⣬<EFBFBD><E2A3AC>֧<EFBFBD>ֵ<EFBFBD><D6B5>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д00<30>ͺá<CDBA>
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
const u8 usbHidKbdInterfaceDescriptor[] = {
|
|||
|
|
0x09,0x04,0x00,0x00,0x01,0x03,0x01,0x01,0x00,//<2F>ַ<EFBFBD><D6B7><EFBFBD>û<EFBFBD>У<EFBFBD><D0A3>Ͳ<EFBFBD>Ҫд0x07<30>ˣ<EFBFBD><CBA3>ᵼ<EFBFBD><E1B5BC>ö<EFBFBD>ٲ<EFBFBD><D9B2>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>е<EFBFBD><D0B5>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>д0.
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
const u8 usbHidPosDeviceClassDescriptor[] = {
|
|||
|
|
0x09,0x21,0x10,0x01,0x00,0x01,0x22,HID_POS_RPT_LEN,0x00,
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
const u8 usbHidKbdDeviceClassDescriptor[] = {
|
|||
|
|
0x09,0x21,0x10,0x01,0x00,0x01,0x22,HID_KBD_RPT_LEN,0x00,
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
const u8 usbHidPosEndpointDescriptor[] = {
|
|||
|
|
14,
|
|||
|
|
0x07,0x05,0x82,0x03,HIDINTPKTSIZE,0x00,0x04,
|
|||
|
|
0x07,0x05,0x01,0x03,HIDINTPKTSIZE,0x00,0x04,
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
const u8 usbHidKbdEndpointDescriptor[] = {
|
|||
|
|
6,
|
|||
|
|
0x07,0x05,0x82,0x03,HIDINTPKTSIZE,0x00,//IN ep
|
|||
|
|
//0x07,0x05,0x01,0x03,HIDINTPKTSIZE,0x00,0x02,
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//====================================================
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(input report/output report)
|
|||
|
|
//const u8 hidReportDescriptor[HID_RPT_LEN] =
|
|||
|
|
//{
|
|||
|
|
// 0x05, 0x01, // Usage Page (vendor defined FFA0) (Global)
|
|||
|
|
// 0x09, 0x06, // Usage (vendor defined) (Local)
|
|||
|
|
// 0xa1, 0x01, // Collection (Application) (Main)
|
|||
|
|
|
|||
|
|
// 0x05, 0x07, // Usage Page (vendor defined FFA1) (Global)
|
|||
|
|
|
|||
|
|
// //The input report
|
|||
|
|
// 0x19, 0xe0, // usage - vendor defined (Local)
|
|||
|
|
// 0x29, 0xe7, // logical minimum (0) (Local)
|
|||
|
|
// 0x15, 0x00, // logical maximum (255) (Local)
|
|||
|
|
// 0x25, 0x01, // Report Size (8) (bits) (Local)
|
|||
|
|
// 0x95, 0x08, // Report Count (255) (fields) (Local)
|
|||
|
|
// 0x75, 0x01, // Input (Data, Variable, Absolute) (Main)
|
|||
|
|
|
|||
|
|
// //The output report
|
|||
|
|
// 0x81, 0x02, // usage - vendor defined (Local)
|
|||
|
|
// 0x95, 0x01, // logical minimum (0) (Local)
|
|||
|
|
// 0x75, 0x08, // logical maximum (255) (Local)
|
|||
|
|
// 0x81, 0x03, // Report Size (8) (bits) (Local)
|
|||
|
|
// 0x95, 0x06, // Report Count (255) (fields) (Local)
|
|||
|
|
// 0x75, 0x08, // Output (Data, Variable, Absolute) (Main)
|
|||
|
|
//0x15, 0x00,
|
|||
|
|
//0x25, 0xff,
|
|||
|
|
//0x05, 0x07,
|
|||
|
|
//0x19, 0x00,
|
|||
|
|
//0x29, 0x65,
|
|||
|
|
//0x81, 0x00,
|
|||
|
|
//0x25, 0x01,
|
|||
|
|
//0x95, 0x05,
|
|||
|
|
//0x75, 0x01,
|
|||
|
|
//0x05, 0x08,
|
|||
|
|
//0x19, 0x01,
|
|||
|
|
//0x29, 0x05,
|
|||
|
|
//0x91, 0x02,
|
|||
|
|
//0x95, 0x01,
|
|||
|
|
//0x75, 0x03,
|
|||
|
|
//0x91, 0x03,
|
|||
|
|
// 0xC0 // End Collection (Main)
|
|||
|
|
//};
|
|||
|
|
|
|||
|
|
const u8 usbHidKbdReportDescriptor[HID_KBD_RPT_LEN] =
|
|||
|
|
{
|
|||
|
|
0x05, 0x01,
|
|||
|
|
0x09, 0x06,
|
|||
|
|
0xa1, 0x01,
|
|||
|
|
0x05, 0x07,
|
|||
|
|
0x19, 0xe0,
|
|||
|
|
0x29, 0xe7,
|
|||
|
|
0x15, 0x00,
|
|||
|
|
0x25, 0x01,
|
|||
|
|
0x75, 0x01,
|
|||
|
|
0x95, 0x08,
|
|||
|
|
0x81, 0x02,
|
|||
|
|
0x95, 0x01,
|
|||
|
|
0x75, 0x08,
|
|||
|
|
0x81, 0x03,
|
|||
|
|
0x95, 0x05,
|
|||
|
|
0x75, 0x01,
|
|||
|
|
|
|||
|
|
0x05, 0x08,
|
|||
|
|
0x19, 0x01,
|
|||
|
|
0x29, 0x05,
|
|||
|
|
0x91, 0x02,
|
|||
|
|
0x95, 0x01,
|
|||
|
|
0x75, 0x03,
|
|||
|
|
0x91, 0x03,
|
|||
|
|
0x95, 0x06,
|
|||
|
|
0x75, 0x08,
|
|||
|
|
0x15, 0x00,
|
|||
|
|
0x25, 0xFF,
|
|||
|
|
0x05, 0x07,
|
|||
|
|
0x19, 0x00,
|
|||
|
|
0x29, 0x65,
|
|||
|
|
0x81, 0x00,
|
|||
|
|
0xc0
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
const u8 usbHidPosReportDescriptor[HID_POS_RPT_LEN] =
|
|||
|
|
{
|
|||
|
|
0x05, 0x8c,
|
|||
|
|
0x09, 0x01,
|
|||
|
|
0xa1, 0x01,
|
|||
|
|
0x09, 0x07,
|
|||
|
|
0xa1, 0x02,
|
|||
|
|
0x85, 0x01,
|
|||
|
|
0x15, 0x00,
|
|||
|
|
0x26, 0xff,
|
|||
|
|
0x00, 0x75,
|
|||
|
|
0x08, 0x95,
|
|||
|
|
0x3f, 0x09,
|
|||
|
|
0xfe, 0x82,
|
|||
|
|
0x02, 0x01,
|
|||
|
|
0xc0, 0x09,
|
|||
|
|
0x08, 0xa1,
|
|||
|
|
0x02, 0x85,
|
|||
|
|
0x02, 0x15,
|
|||
|
|
0x00, 0x26,
|
|||
|
|
0xff, 0x00,
|
|||
|
|
0x75, 0x08,
|
|||
|
|
0x95, 0x3f,
|
|||
|
|
0x09, 0xfe,
|
|||
|
|
0x82, 0x02,
|
|||
|
|
0x01, 0xc0,
|
|||
|
|
0x09, 0x06,
|
|||
|
|
0xa1, 0x02,
|
|||
|
|
0x85, 0x04,
|
|||
|
|
0x15, 0x00,
|
|||
|
|
0x26, 0xff,
|
|||
|
|
0x00, 0x75,
|
|||
|
|
0x08, 0x95,
|
|||
|
|
0x3f, 0x09,
|
|||
|
|
0x00, 0x91,
|
|||
|
|
0x96, 0xc0,
|
|||
|
|
0xc0
|
|||
|
|
};
|
|||
|
|
|