Keil Logo

MCB2140: CHANGE MESSAGE SIZE OF USBHID EXAMPLE


Information in this article applies to:

  • MCB2140 Evaluation Boards

QUESTION

I need help with the USBHID example which is part of the the Keil MCB2140 Evaluation Board (using the Philips LPC2148 ARM processor).

We want to re-use this source code in our project, but this example sends only one byte at a time. We need to send a packet of 16 bytes. It looks like the source code is prepared to handle more than one byte, however during the identification of the USB to the host computer, the length is fixed to one byte.  How do I change the packet length for this example?

ANSWER

The HID project can be easily adapted to support reports with sizes up to 64 bytes. The necessary changes are:

  • Modify the functions HID_GetReport and HID_SetReport in HIDUser.c. These functions are very easy to adapt since the 1 byte handling just needs to be expanded.
  • Modify the HID_ReportDescriptor in USBDesc.c. Changing the HID Report Descriptor requires some knowledge about HID class. This is available in the documentation from usb.org.

MORE INFORMATION

Last Reviewed: Wednesday, September 21, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.