本帖最后由 菜鸟同学 于 2016-9-9 16:13 编辑
本人使用STM32 按照修改,<div class="blockcode"><blockquote> /* Initialize Endpoint 1 */
SetEPType(ENDP1, EP_INTERRUPT);
SetEPTxAddr(ENDP1, ENDP1_TXADDR);
SetEPTxCount(ENDP1, 64);
SetEPRxStatus(ENDP1, EP_RX_DIS);
SetEPTxStatus(ENDP1, EP_TX_NAK);
/* Initialize Endpoint 2 */
SetEPRxAddr(ENDP1, ENDP1_RXADDR);
SetEPRxCount(ENDP1, 64);
//SetEPRxStatus(ENDP1, EP_TX_DIS);
SetEPRxStatus(ENDP1, EP_RX_VALID);
/* 27 */
0x07, /*bLength: Endpoint Descriptor size*/
USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/
0x81, /*bEndpointAddress: Endpoint Address (IN)*/
0x03, /*bmAttributes: Interrupt endpoint*/
0x40, /*wMaxPacketSize: 64 Byte max */
0x00,
0x0A, /*bInterval: Polling Interval (2 ms)*/
/* 34 */
/* 27 */
0x07, /*bLength: Endpoint Descriptor size*/
USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/
0x01, /*bEndpointAddress: Endpoint Address (OUT)*/
0x03, /*bmAttributes: Interrupt endpoint*/
0x40, /*wMaxPacketSize: 64 Byte max */
0x00,
0x0A, /*bInterval: Polling Interval (2 ms)*/
0x05,0xFF,// USAGE_PAGE (Generic Desktop)
0x09,0xFF,// USER DEFINE
0xA1,0x01,// COLLECT
0x05,0x01,// USAGE PAGE1
0x19, 0x00, // USAGE_MINIMUM (Keyboard LeftControl)
0x29, 0xFF, // USAGE_MAXIMUM (Keyboard Right GUI)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0xFF, // LOGICAL_MAXIMUM (1)
0x75, 0x08, // REPORT_SIZE (8) // size ÊÇ´óС
0x95, 0x40, // REPORT_COUNT (64) // 64 ¸ö
0x81, 0x02, // INPUT (Cnst,Var,Abs)
0x05, 0x02, // USAGE_PAGE(2)
0x19, 0x00, // USAGE_MINIMUM (Keyboard LeftControl)
0x29, 0xFF, // USAGE_MAXIMUM (Keyboard Right GUI)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0xFF, // LOGICAL_MAXIMUM (1)
0x75, 0x08, // REPORT_SIZE (8) // size ÊÇ´óС
0x95, 0x40, // REPORT_COUNT (64) // 64 ¸ö
0x91, 0x02, // OUTPUT (Cnst,Var,Abs)
0xc0, // END_COLLECTION 25
|