I need confirmation if I have correctly implemented an output report. My descriptor looks like this:
/*Endpoint*/ 0x07, /*bLength: Endpoint Descriptor size*/ USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/ 0x81, /*bEndpointAddress: Endpoint Address (IN) */ 0x03, /*bmAttributes: Interrupt endpoint*/ 0x40, 0x00, /*wMaxPacketSize: 64 Byte max */ 0x01, /*bInterval: Polling Interval (1 ms)*/ /*Endpoint*/ 0x07, /*bLength: Endpoint Descriptor size*/ USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/ 0x01, /*bEndpointAddress: Endpoint Address (OUT) */ 0x03, /*bmAttributes: Interrupt endpoint*/ 0x40, 0x00, /*wMaxPacketSize: 64 Byte max */ 0x01, /*bInterval: Polling Interval (1 ms)*/
usb_prop.c:
/* Initialize Endpoint 1 */ SetEPType(ENDP1, EP_INTERRUPT); SetEPTxAddr(ENDP1, ENDP1_TXADDR); SetEPRxAddr(ENDP1, ENDP1_RXADDR); SetEPTxCount(ENDP1, 64); SetEPRxCount(ENDP1, 64); SetEPRxStatus(ENDP1, EP_RX_VALID); SetEPTxStatus(ENDP1, EP_TX_NAK);
usb_conf.h
/* EP0 */ /* rx/tx buffer base address */ #define ENDP0_RXADDR (0x18) #define ENDP0_TXADDR (0x58) /* EP1 */ /* tx buffer base address */ #define ENDP1_RXADDR (0X104) #define ENDP1_TXADDR (0x100)
The device is enumerating correct. Do I need any more changes? Will I handle the data here?
//--------------------------------------------------------------- case SET_REPORT: switch( pInformation->USBwValue1 ) // report type { case HID_FEATURE: CopyRoutine = CustomHID_SetReport_Feature; Request = SET_REPORT; break; case HID_OUTPUT: //CopyRoutine = ?; break; } break; default: break; }
Why not continue in your existing thread?
http://www.keil.com/forum/64436
The code is now much more advanced. I'm trying to implement ForceFeedback, but I do not know much about Report in and ReportOut.