This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC2148 USB HID

How to change report size in USB HID class. I would like to change ReportSize(8) to ReportSize(12) but the error has occur.
Can I chage ReportSize to 12 bit? Now I use only one Enpoint. if I woule like to use many Enpoint.
How to change code?
How about data rate? more or same only one endpoint.

  • Are you talking about the KEIL HID example?
    "LPC2148 USB HID (Human Interface Device) Example"
    http://www.keil.com/download/docs/306.asp

    "Can I chage ReportSize to 12 bit?"

    See this chapter of the USB HID spec.
    6.2.2 Report Descriptor (HID1_11.pdf p24)

    "Device Class Definition for HID 1.11" from USB.org
    www.usb.org/.../HID1_11.pdf

    BYTE InReport[2];        // HID Input Report, low-byte first
    
    /* 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(1),        // <--- number of fields
        HID_ReportSize(12),        // <--- bits
        HID_Input(HID_Data | HID_Variable | HID_Absolute),
        HID_ReportCount(1),
        HID_ReportSize(4),         // <--- padding to the byte boundary
        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,
    };
    

    "Now I use only one Enpoint. if I woule like to use many Enpoint."

    HID interface consists of
    - ONE interrupt IN EP
    - ONE interrupt OUT EP (optional)

    If you want to use more EPs, apply composite device configuration.

    "How about data rate?"

    The maximum speed of HID is 64 byte/ 1msec USB frame on Full-Speed (FS) bus, on each endpoint. See these posts.

    "LPC2148 usb controller"
    http://www.keil.com/forum/docs/thread11137.asp
    "LPC2148HID"
    http://www.keil.com/forum/docs/thread11135.asp

    Tsuneo