配置描述符:
USB_CONFIGURATION_DESCRIPTOR config_descr = {
0x09, //bLength
0x02, //bDescriptor 02
SWAP(0x005d), //wTotalLength 86=0x0056 32=0x0020 93=0x5d
0x01, //bNumInterface
0x01, //bConfiguration Value
0x00, //iConfiguration
0x80, //bmAttributes,BUS-POWER
0xfa //bMaxPower,500mA
};
接口描述符:
USB_INTERFACE_DESCRIPTOR inter_descr = {
0x09, //bLength: 0x09 bytes
0x04, //bDescriptorType: INTERFACE
0x00, //bInterfaceNumber: interface 0
0x00, //bAlternateSetting: alternate setting 0
0x03, //bNumEndpoints: 2 endpoint ,not include zero ep
0x0B,
0x00,
0x00,
0x00 //iInterface: index of string
};
CCID类描述符:
BYTE ccid_descr[0x36] = {
0x36, // bLength: CCID Descriptor size
0x21, // bDescriptorType: HID To be updated with CCID specific number
0x00,0x01,// bcdCCID 0x0110
0x00, // bMaxSlotIndex
0x07, // bVoltageSupport: 5v, 3v and 1.8v
0x01,0x00,0x00,0x00, // dwProtocols: supports T=0 and T=1
0xA0,0x0F,0x00,0x00, // dwDefaultClock: 4 Mhz (0x00000FA0)
0xA0,0x0F,0x00,0x00, // dwMaximumClock: 4 Mhz (0x00000FA0)
0x00, // bNumClockSupported => no manual setting
0x80,0x25,0x00,0x00, // dwDataRate: 9600 bps (0x00002A00)
0x80,0x25,0x00,0x00, // dwMaxDataRate: 9600 bps (0x0001F808)
0x00, // bNumDataRatesSupported => no manual setting
0xfe,0x00,0x00,0x00, /* dwMaxIFSD: 0 (T=0 only) */
0x00,0x00,0x00,0x00, /* dwSynchProtocols */
0x00,0x00,0x00,0x00, /* dwMechanical: no special characteristics */
0x30,0x00,0x01,0x00, // dwFeatures: clk, baud rate, voltage : automatic CCID can set ICC in clock stop mode.
0x0f,0x01,0x00,0x00, /* dwMaxCCIDMessageLength : Maximun block size + header*/ /* 261 + 10 */
0x00, /* bClassGetResponse*/
0x00, /* bClassEnvelope */
0x00,0x00, /* wLcdLayout */
0x00, /* bPINSupport : no PIN verif and modif */
0x01 // bMaxCCIDBusySlot
};
端点描述符:
//Endpoint 1
USB_ENDPOINT_DESCRIPTOR ep_descr_in = {
0x07, //bLength: 0x07 bytes
0x05, //bDescriptorType: ENDPOINT
0x81, //bEndpointAddress: IN endpoint 1
0x02, //bmAttributes: BULK-ONLY(00:Control 01:isoch 10:bulk 11:intr
SWAP(0x0040), //wMaxPacketSize: 64 bytes
0x00 //bInterval: polling interval is 1 ms
};
//Endpoint1
USB_ENDPOINT_DESCRIPTOR ep_descr_out = {
0x07, //bLength: 0x07 bytes
0x05, //bDescriptorType: ENDPOINT
0x01, //bEndpointAddress: out endpoint 1
0x02, //bmAttributes: BULK-ONLY
SWAP(0x0040), //wMaxPacketSize: 64 bytes
0x00 //bInterval: polling interval is 1 ms
};
USB_ENDPOINT_DESCRIPTOR ep_descr_intr = {
0x07, //bLength: 0x07 bytes
0x05, //bDescriptorType: ENDPOINT
0x82, //bEndpointAddress: int endpoint 2
0x03, //bmAttributes: intr
SWAP(0x0010), //wMaxPacketSize: 64 bytes
0x18 //bInterval: polling interval is 24 ms
};
|
|
|