I use usb controller in Lpc2148. I get example code from keil website in HID class. I need adapt InReport up to 64 byte( InReport[0],InReport[1]....,InReport[64]) for send more data but I donn't good enough in C programming. How can I do? pleas give code. How can I develop application software in the host side. I need Visual Basic 6 thanks you
Aha, I missed to show the modification of interface descriptor.
/* Interface 0, Alternate Setting 0, HID Class */ USB_INTERFACE_DESC_SIZE, /* bLength */ USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */ 0x00, /* bInterfaceNumber */ 0x00, /* bAlternateSetting */ 0x02, /* bNumEndpoints */ USB_DEVICE_CLASS_HUMAN_INTERFACE, /* bInterfaceClass */ HID_SUBCLASS_NONE, /* bInterfaceSubClass */ HID_PROTOCOL_NONE, /* bInterfaceProtocol */ 0x5C, /* iInterface */
Tsuneo
Okay, according to your directions I now have both in and out 64byte transfer. So far it looks fine. I'm going to involve it in one of my projects.
I just wonder if I did the DESCRIPTOR WORK as expected:
/* HID Report Descriptor */ const BYTE HID_ReportDescriptor[] = { HID_UsagePageVendor(0x00),
HID_Usage(0x01),
HID_Collection(HID_Application),
HID_UsagePage(HID_USAGE_PAGE_BUTTON),
HID_UsageMin(1),
HID_UsageMax(3),
HID_LogicalMin(0),
HID_LogicalMax(1),
HID_ReportCount(INREPORT_SIZE),
HID_ReportSize(8),
HID_Input(HID_Data | HID_Variable | HID_Absolute),
HID_UsagePage(HID_USAGE_PAGE_LED),
HID_Usage(HID_USAGE_LED_GENERIC_INDICATOR),
// HID_ReportCount(8),
// HID_ReportSize(1),
HID_Output(HID_Data | HID_Variable | HID_Absolute),
HID_EndCollection, };
Thank you for helping.
Aqua
I recommend you this simplified report descriptor (same as the report desc in my above (21-Nov-2007 17:02) post))
const BYTE HID_ReportDescriptor[] = { HID_UsagePageVendor( 0x00 ), HID_Usage( 0x01 ), HID_Collection( HID_Application ), HID_LogicalMin( 0 ), HID_LogicalMaxS( 0xFF ), HID_ReportSize( 8 ), // bits HID_ReportCount( INREPORT_SIZE ), // bytes HID_Usage( 0x01 ), HID_Input( HID_Data | HID_Variable | HID_Absolute ), HID_ReportCount( OUTREPORT_SIZE ), // bytes HID_Usage( 0x01 ), HID_Output( HID_Data | HID_Variable | HID_Absolute ), HID_EndCollection, };
You'll find the detailed (maybe too detailed :-) ) definition of the report descriptor here. "Device Class Definition for HID 1.11" - HID spec www.usb.org/.../HID1_11.pdf 6.2.2 Report Descriptor (HID1_11.pdf ver1.11 p23)
You can confirm your report descriptor using this tool. "HID Descriptor Tool" on USB.org www.usb.org/.../dt2_4.zip
If you aren't implementing a specific HID device like mouse and keyboard, however, above simplified report descriptor is enough.
Ummm.. In above posts, I didn't write about USB_Configure_Event() (usbuser.c) as the initialization of USB routines. But I won't write elaborate long post in this forum any more, because of the weird SPAM filter. You'll find me in these fora. See you in these fora again. Bye!!
LPC2000 tech.groups.yahoo.com/.../
USB-IF Developers " href= "http://www.cygnal.org/scripts/Ultimate.cgi?action=intro">www.cygnal.org/.../Ultimate.cgi
8052.com " http://www.keil.com/forum/docs/thread11241.asp