Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

USB HID driver on LPC2148 board

USB HID driver on LPC2148 board

2006-04-05 by Manisha Kalita

Hi all,

I am designing an USB driver in lpc2148 board. i have a sample program for
HID driver. they are sending reports to the host. however, in the code, the
following part i did not understand.

I suppose, to wait for completion of transmission only the first while loop
will be sufficient. i am not getting why they are Getting endpoint status
and again they are checking transmit interrupt bit. if anyone has any
experience in this regard, please help me.


  // Wait to complete of transmition
  while ((ENDPINTS & (1<<EP_REP)) == 0)
  {
    // Get enmdpoint status
    if ((USB_Cmd(CMD_USB_SET_EP_STAT + EP_REP,0) & 1) == 0)
    {
      if((ENDPINTS & (1<<EP_REP)) == 0)
      {
        break;
      }
    }
  }
  USB_Cmd(CMD_USB_SEL_CLR_INT_EP + EP_REP,0);
  ENDPINTCLR = (1<<EP_REP);

Thanks for going through the problem.

Regards,
Manisha

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s)and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender or administrator@...

Re: USB HID driver on LPC2148 board

2006-04-05 by ah_sandiego

I can't contribute much, but if youdo figure this out, please 
comment your code really good. The rest of us could benefit from 
this.

Good Luck,
AH

--- In lpc2000@yahoogroups.com, Manisha Kalita <manisha@...> wrote:
>
> Hi all,
> 
> I am designing an USB driver in lpc2148 board. i have a sample 
program for
> HID driver. they are sending reports to the host. however, in the 
code, the
> following part i did not understand.
> 
> I suppose, to wait for completion of transmission only the first 
while loop
> will be sufficient. i am not getting why they are Getting endpoint 
status
> and again they are checking transmit interrupt bit. if anyone has 
any
> experience in this regard, please help me.
> 
> 
>   // Wait to complete of transmition
>   while ((ENDPINTS & (1<<EP_REP)) == 0)
>   {
>     // Get enmdpoint status
>     if ((USB_Cmd(CMD_USB_SET_EP_STAT + EP_REP,0) & 1) == 0)
>     {
>       if((ENDPINTS & (1<<EP_REP)) == 0)
>       {
>         break;
>       }
>     }
>   }
>   USB_Cmd(CMD_USB_SEL_CLR_INT_EP + EP_REP,0);
>   ENDPINTCLR = (1<<EP_REP);
> 
> Thanks for going through the problem.
> 
> Regards,
> Manisha
> 
> The information contained in this electronic message and any 
attachments to this message are intended for the exclusive use of 
the addressee(s)and may contain confidential or privileged 
information. If you are not the intended recipient, please notify 
the sender or administrator@...
>

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.