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 Reply
  • The problem seems to lie in your understanding on USB rather than C itself.
    On the USB side, the descriptor work will finish it, as follows.

    On the Axelson's HID page, you'll find host app examples for C#, VB6 and VC6
    http://www.lvr.com/hidpage.htm

    Tsuneo

    #define INREPORT_SIZE    64
    BYTE InReport[ INREPORT_SIZE ];             /* HID Input Report */
    
    /* 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(3),      // increase the size of report
    //    HID_ReportSize(1),
        HID_ReportCount( INREPORT_SIZE ),   // bytes
        HID_ReportSize(8),                  // bits
        HID_Input(HID_Data | HID_Variable | HID_Absolute),
    //    HID_ReportCount(1),      //  <------ comment out these three lines
    //    HID_ReportSize(5),
    //    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,
    };
    
    
    /* USB Configuration Descriptor */
    /*   All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
    const BYTE USB_ConfigDescriptor[] = {
       ...
       ...
    /* Endpoint, HID Interrupt In */
      USB_ENDPOINT_DESC_SIZE,            /* bLength */
      USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
      USB_ENDPOINT_IN(1),                /* bEndpointAddress */
      USB_ENDPOINT_TYPE_INTERRUPT,       /* bmAttributes */
    //  WBVAL(0x0004),                     /* wMaxPacketSize */ // increase the max packet size
      WBVAL( 0x0040 ),                   /* wMaxPacketSize */   // = 64, this value is not directly
      0x20,          /* 32ms */          /* bInterval */        //  concerned to INREPORT_SIZE
    /* Terminator */
      0                                  /* bLength */
    };
    

Children
More questions in this forum