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 controller

I use usb controller in Lpc2148. I get example code from keil website in HID class. I need adapt InReport up to 64 byte( InReport[0],InReport[1]....,InReport[64]) for send more data but I donn't good enough in C programming. How can I do? pleas give code. How can I develop application software in the host side. I need Visual Basic 6
thanks you

Parents
  • "Don't I have to configure the endpoint in the usbcfg?"

    I don't think so.
    If there is anything to modify on usbcfg.h, it's USB_EP_EVENT

    usbcfg.h
    
    #define USB_EP_EVENT        0x0003
    

    This constant works as a mask to the Events Callback function table in usbuser.c
    Please note, the logical endpoint number (joined IN and OUT) is applied here.

    usbuser.c
    
    #define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL)
    
    /* USB Endpoint Events Callback Pointers */
    void (* const USB_P_EP[16]) (DWORD event) = {
      P_EP(0),
      P_EP(1),
      P_EP(2),
      P_EP(3),
      P_EP(4),
      P_EP(5),
      P_EP(6),
      P_EP(7),
      P_EP(8),
      P_EP(9),
      P_EP(10),
      P_EP(11),
      P_EP(12),
      P_EP(13),
      P_EP(14),
      P_EP(15),
    };
    

    Fortunately in this case, the USB_EndPoint1 has been already enabled for EP1 IN. Then, no specific modification for EP1 OUT is required.

    Tsuneo

Reply
  • "Don't I have to configure the endpoint in the usbcfg?"

    I don't think so.
    If there is anything to modify on usbcfg.h, it's USB_EP_EVENT

    usbcfg.h
    
    #define USB_EP_EVENT        0x0003
    

    This constant works as a mask to the Events Callback function table in usbuser.c
    Please note, the logical endpoint number (joined IN and OUT) is applied here.

    usbuser.c
    
    #define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL)
    
    /* USB Endpoint Events Callback Pointers */
    void (* const USB_P_EP[16]) (DWORD event) = {
      P_EP(0),
      P_EP(1),
      P_EP(2),
      P_EP(3),
      P_EP(4),
      P_EP(5),
      P_EP(6),
      P_EP(7),
      P_EP(8),
      P_EP(9),
      P_EP(10),
      P_EP(11),
      P_EP(12),
      P_EP(13),
      P_EP(14),
      P_EP(15),
    };
    

    Fortunately in this case, the USB_EndPoint1 has been already enabled for EP1 IN. Then, no specific modification for EP1 OUT is required.

    Tsuneo

Children