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
  • How about using approporiate code formatting, as per the instructions above the text input window ?

    const BYTE USB_ConfigDescriptor[] = {
    
    /* Configuration 1 */
    
    USB_CONFIGUARTION_DESC_SIZE, /* bLength */
    
    USB_CONFIGURATION_DESCRIPTOR_TYPE, /*DescriptorType */
    
    WBVAL( /* wTotalLength */
    
    USB_CONFIGUARTION_DESC_SIZE +
    
    USB_INTERFACE_DESC_SIZE +
    
    HID_DESC_SIZE +
    
    USB_ENDPOINT_DESC_SIZE +
    
    USB_ENDPOINT_DESC_SIZE ), 0x01, /* bNumInterfaces */
    
    0x01, /* bConfigurationValue */
    
    0x00, /* iConfiguration */
    
    USB_CONFIG_BUS_POWERED /*|*/ /* bmAttributes */
    
    /*USB_CONFIG_REMOTE_WAKEUP*/, USB_CONFIG_POWER_MA(100), /* bMaxPower */
    
    /* Interface 0, Alternate Setting 0, HID Class */
    
    USB_INTERFACE_DESC_SIZE, /* bLength */
    
    USB_INTERFACE_DESCRIPTOR_TYPE, /*bDescriptorType */
    
    0x00, /* bInterfaceNumber */
    
    0x00, /* bAlternateSetting */
    
    0x02, /* bNumEndpoints */
    
    USB_DEVICE_CLASS_HUMAN_INTERFACE,/* bInterfaceClass */
    
    HID_SUBCLASS_NONE, /* bInterfaceSubClass */
    
    HID_PROTOCOL_NONE, /* bInterfaceProtocol */ 0x5C, /* iInterface */
    /* HID Class Descriptor */
    
    /* HID_DESC_OFFSET = 0x0012 */
    
    HID_DESC_SIZE, /* bLength */
    
    HID_HID_DESCRIPTOR_TYPE, /* bDescriptorType */
    
    WBVAL(0x0100), /* 1.00 */ /* bcdHID */
    
    0x00, /* bCountryCode */
    
    0x01, /* bNumDescriptors */
    
    HID_REPORT_DESCRIPTOR_TYPE, /* bDescriptorType */
    
    WBVAL(HID_REPORT_DESC_SIZE),/* wDescriptorLength */
    
    /* 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(0x0040), /* wMaxPacketSize */
    
    0x20, /* 32ms */ /* bInterval */
    
    /* Endpoint, HID Interrupt Out */
    
    USB_ENDPOINT_DESC_SIZE, /* bLength */
    
    USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
    
    USB_ENDPOINT_OUT(1), /* bEndpointAddress */
    
    USB_ENDPOINT_TYPE_INTERRUPT, /* bmAttributes */
    
    WBVAL(0x0040), /* wMaxPacketSize */ // = 64
    
    0x20, /* 32ms */ /* bInterval */
    
    /* Terminator */
    
    0 /* bLength */
    };
    

Reply
  • How about using approporiate code formatting, as per the instructions above the text input window ?

    const BYTE USB_ConfigDescriptor[] = {
    
    /* Configuration 1 */
    
    USB_CONFIGUARTION_DESC_SIZE, /* bLength */
    
    USB_CONFIGURATION_DESCRIPTOR_TYPE, /*DescriptorType */
    
    WBVAL( /* wTotalLength */
    
    USB_CONFIGUARTION_DESC_SIZE +
    
    USB_INTERFACE_DESC_SIZE +
    
    HID_DESC_SIZE +
    
    USB_ENDPOINT_DESC_SIZE +
    
    USB_ENDPOINT_DESC_SIZE ), 0x01, /* bNumInterfaces */
    
    0x01, /* bConfigurationValue */
    
    0x00, /* iConfiguration */
    
    USB_CONFIG_BUS_POWERED /*|*/ /* bmAttributes */
    
    /*USB_CONFIG_REMOTE_WAKEUP*/, USB_CONFIG_POWER_MA(100), /* bMaxPower */
    
    /* Interface 0, Alternate Setting 0, HID Class */
    
    USB_INTERFACE_DESC_SIZE, /* bLength */
    
    USB_INTERFACE_DESCRIPTOR_TYPE, /*bDescriptorType */
    
    0x00, /* bInterfaceNumber */
    
    0x00, /* bAlternateSetting */
    
    0x02, /* bNumEndpoints */
    
    USB_DEVICE_CLASS_HUMAN_INTERFACE,/* bInterfaceClass */
    
    HID_SUBCLASS_NONE, /* bInterfaceSubClass */
    
    HID_PROTOCOL_NONE, /* bInterfaceProtocol */ 0x5C, /* iInterface */
    /* HID Class Descriptor */
    
    /* HID_DESC_OFFSET = 0x0012 */
    
    HID_DESC_SIZE, /* bLength */
    
    HID_HID_DESCRIPTOR_TYPE, /* bDescriptorType */
    
    WBVAL(0x0100), /* 1.00 */ /* bcdHID */
    
    0x00, /* bCountryCode */
    
    0x01, /* bNumDescriptors */
    
    HID_REPORT_DESCRIPTOR_TYPE, /* bDescriptorType */
    
    WBVAL(HID_REPORT_DESC_SIZE),/* wDescriptorLength */
    
    /* 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(0x0040), /* wMaxPacketSize */
    
    0x20, /* 32ms */ /* bInterval */
    
    /* Endpoint, HID Interrupt Out */
    
    USB_ENDPOINT_DESC_SIZE, /* bLength */
    
    USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
    
    USB_ENDPOINT_OUT(1), /* bEndpointAddress */
    
    USB_ENDPOINT_TYPE_INTERRUPT, /* bmAttributes */
    
    WBVAL(0x0040), /* wMaxPacketSize */ // = 64
    
    0x20, /* 32ms */ /* bInterval */
    
    /* Terminator */
    
    0 /* bLength */
    };
    

Children