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
Hello Tsuneo Chinzei,
I've implemented the code you suggested and I got it working just fine.
Could you please let me have details about modifiyng the OutReport so I can send 64byte to the board as well.
Thank you Aqua
The problem seems to lie in your understanding on USB rather than C itself. On the USB side, the descriptor work will finish it, as follows.
On the Axelson's HID page, you'll find host app examples for C#, VB6 and VC6 http://www.lvr.com/hidpage.htm
Tsuneo
#define INREPORT_SIZE 64 BYTE InReport[ INREPORT_SIZE ]; /* HID Input Report */ /* 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(3), // increase the size of report // HID_ReportSize(1), HID_ReportCount( INREPORT_SIZE ), // bytes HID_ReportSize(8), // bits HID_Input(HID_Data | HID_Variable | HID_Absolute), // HID_ReportCount(1), // <------ comment out these three lines // HID_ReportSize(5), // HID_Input(HID_Constant), HID_UsagePage(HID_USAGE_PAGE_LED), HID_Usage(HID_USAGE_LED_GENERIC_INDICATOR), HID_LogicalMin(0), HID_LogicalMax(1), HID_ReportCount(8), HID_ReportSize(1), HID_Output(HID_Data | HID_Variable | HID_Absolute), HID_EndCollection, }; /* USB Configuration Descriptor */ /* All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */ const BYTE USB_ConfigDescriptor[] = { ... ... /* Endpoint, HID Interrupt In */ USB_ENDPOINT_DESC_SIZE, /* bLength */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_ENDPOINT_IN(1), /* bEndpointAddress */ USB_ENDPOINT_TYPE_INTERRUPT, /* bmAttributes */ // WBVAL(0x0004), /* wMaxPacketSize */ // increase the max packet size WBVAL( 0x0040 ), /* wMaxPacketSize */ // = 64, this value is not directly 0x20, /* 32ms */ /* bInterval */ // concerned to INREPORT_SIZE /* Terminator */ 0 /* bLength */ };
http://www.keil.com/books/genbooks.asp
and any decent bookshop or library will have shelves full of 'C' programming books...
"I donn't good enough in C programming. How can I do?"
There's no way out - you're either going to have to learn 'C', or get someone else to do it for you: http://www.keil.com/condb/search.asp
"pleas give code"
If you don't know 'C', how will you understand it? How will that help?
"How can I develop application software in the host side."
Again, that's another programming task
"I need Visual Basic 6"
Why Visusal Basic? Why specifically 6?
If you're having trouble just learning 'C', why also try to learn another language (VB)?
You can download free "Express" versions of microsoft VisualStudio: msdn2.microsoft.com/.../aa700735.aspx
Borland have a similar arrangement with their "Turbo Explorer" products: www.codegear.com/.../turbo
Probably easier to go for something like that - rather than try to learn 2 different languages at once!
View all questions in Keil forum