We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi friends.
My English is very limited.
I am sending data to a computer via USB and LPC2368. but the data comes back to me once, come back I want to stop. Would not help but do?
Thank you.
Link: www.4shared.com/.../USBHID.html
Usb hid in you please advise if you have the example files? I'm very beginner can do.
Follow this thread http://www.keil.com/forum/docs/thread16862.asp
Most of the essence that USB beginner should know is there.
Ah, in above thread, the target MCU is AT91SAM7S256. The code for LPC2368 is almost similar. But minor difference is here. KEIL binds IN and OUT ISR into single USB_EndPointNN function (though I don't think this coding good). Then, you have to check "event" parameter in the EP ISR as follows.
usbuser.c void USB_EndPoint1 (U32 event) { if (event == USB_EVT_IN) { // // IN endpoint ISR // } else if (event == USB_EVT_OUT) { // // OUT endpoint ISR // } }
Tsuneo
I've tried many methods but could not manage. I'm about to go crazy:)
my sample code
void USB_EndPoint1 (DWORD event) {
switch (event) { case USB_EVT_IN: GetInReport(); fg_endpoints &= ~(Bit(1)<<16); //USB_WriteEP(0x81, InReport, sizeof(InReport)); OutReportBufCnt = USB_WriteEP(0x81, InReport, sizeof(OutReport)); break; case USB_EVT_OUT:
OutReportBufCnt = USB_WriteEP(0x81, InReport, sizeof(OutReport)); // fg_endpoints &= ~(Bit(1)<<16); break; } }