lpcware

LPC1343 USB HID example

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by deBoogle on Tue May 21 04:33:29 MST 2013
Hi folks,
Just did a search for USB and got an error back from the engine, so in lieu of being able to search for my topic first....

I am new to USB and could do with a few pointers on something.  I have programmed the LPC1343 with the USB HID example and can read and connect to it fine using some C# code I have got from Jan Axelson's page (which is a great resource).

But i need a rough idea of which areas I need to look at modifying in order to  create an InReport of about 255 bytes in the LPC example code.

1). HID report descripto will need to modified, exspecially report count and size and probably logical max as it will be numerical vals up to maximum binary val.  But, which bits need changing as there are a few report count/size parts to the descriptor:

const uint8_t HID_ReportDescriptor[] = {
  HID_UsagePageVendor(0x00),
  HID_Usage(0x01),
  HID_Collection(HID_Application),
    HID_UsagePage(HID_USAGE_PAGE_BUTTON),
    HID_UsageMin(1),
    HID_UsageMax(3),
    [COLOR=Blue]HID_LogicalMin(0),
    HID_LogicalMax(1),
    HID_ReportCount(3),
    HID_ReportSize(1),[/COLOR]
    HID_Input(HID_Data | HID_Variable | HID_Absolute),
    HID_ReportCount(1),
    HID_ReportSize(5),
    HID_Input(HID_Constant),
    HID_UsagePage(HID_USAGE_PAGE_LED),
    HID_Usage(HID_USAGE_LED_GENERIC_INDICATOR),
[COLOR=Lime]    HID_LogicalMin(0),
    HID_LogicalMax(1),
    HID_ReportCount(8),
    HID_ReportSize(1),[/COLOR]
    HID_Output(HID_Data | HID_Variable | HID_Absolute),
  HID_EndCollection,
};

The bit marked in green seems to be the OutReport which the LPC receives, if I modify the first reference to report counts sizes (in Blue) I fail to enumerate.

2).  Which other functions will require modification?, I have seen the GetInReport fumction, which is called by the USB_EndPoint1 when it receives a request for InReport and also the USB_WriteEP function.  Are there any other parts I should be looking at...

if anybody has written some code that already does something similar that I could take a peek at, I would be very grateful. Many thanks in advance
D

Outcomes