USB Host HID Class Example for LPC2468

Hello,

I am hoping to setup my LPC2468 to act as a USB Host and to work with the HID Class. I am wondering if anyone has suggestions on example code or reading material?

I have gotten Keil's USB HID Client working on my hardware, and have been looking through the Host Lite Mass Storage example provided by Keil/Nxp/OnChip.

Any suggestions would be greatly appreciated.

Thank you,
Eric

Parents Reply
  • Ah, NXP host lite doesn't support interrupt and isoc transfer fully.
    But the handling of interrupt is almost same as bulk, except for its scheduling. You'll easily add interrupt transfer support to host lite.

    OHCI spec
    The host controller (HC) on LPC2468 follows OHCI spec. The spec is downloaded from the link on USB.org
    www.usb.org/.../

    I found many bugs on the original OHCI spec, which have been left unrevised so long. This Renesas app note includes the OHCI spec, in which most of bugs are revised. I recommend you to refer both documents side by side.

    SH7727 USB Host Module Application Note
    documentation.renesas.com/.../rej05b0015_sh7727.pdf
    Section 2, Overview of the Open Host Controller Interface (OpenHCI) Specification

    Scheduling of interrupt transfer
    The polling interval of interrupt transfer is fixed on OHCI;
    1, 2, 4, 8, 16 and 32 ms.
    Your host firmware selects one of interval from this series, so that the interval is less than and nearest to the bInterval field of the target endpoint. This limitation comes from the structure of OHCI HC; 32 members of periodic table (HccaInterruptTable).

    These chapters on the OHCI spec explains the way how the HC handles periodic (interrupt and isoc) using this list.
    3.3.2 Data Structures
    4.4.2.1 HccaInterruptTable

    For an IN interrupt endpoint of 8 ms interval on the host lite,
    1) Firmware reserves an HCED (EDIntIn) and HCTD structures on the memory.
    2) Fill EDIntIn structure just after enumeration, according to the endpoint descriptor of the target device. Link above HCTD to EDIntIn.
    3) Insert the pointer to EDIntIn into hcca->IntTable[] at the index of 0, 8, 16, 24
    4) Set HcPeriodicStart to 0x2A2F
    5) Set HcControl.PeriodicListEnable bit

    For another OUT interrupt endpoint, another HCED and HCTD structures are reserved and initialized.
    a) you may append this ED to EDIntIn.Next. This results the OUT transaction is scheduled just after the IN transaction.
    OR
    b) you may insert the schedule to new series on the hcca->IntTable[], for example, index of 1, 9, 17, 25

    The rest of transaction handling is almost same as bulk one.

    HID host driver always polls the interrupt IN endpoint. You have to recover the interrupt TD immediately after its completion, for next poll.
    On the other hand, interrupt OUT endpoint is used just on demand from host application. sKip bit of HCED.Control enables the transaction without changing the HCED/HCTD structures so much.

    Tsuneo

Children
More questions in this forum