I used the CDC driver, added a class definition as follows:
// USB2SERIAL (FT232R USB-Serial (UART) IC )
{{0x00,0x00}, {0x00,0x00}, USB_PROTOCOL_COM_VENDOR, 0, 0, 0, CUsbHostManager::UsbHostEvent },
// USB Data
{{0x00,0x00}, {0x00,0x00}, USB_CLASS_DATA, 0xFF, USB_PROTOCOL_DATA_CDC, 0, CUsbHostManager::UsbHostDataEvent },
I get an attach and detach calls when I plug the device in, but when I call these two functions they fail:
if (USB_OK != usb_class_cdc_get_acm_descriptors(dev_handle,
intf_handle,
&acm_desc,
&cm_desc,
&header_desc,
&union_desc))
{
break;
}
if (USB_OK != _usb_hostdev_select_interface(dev_handle, intf_handle, (pointer) & device_info[ulDeviceIndex].ccs))
{
break;
}
Is there a completed FTDI (FT232RQ device) driver code for usb host?
Thanks!
Dan.
已解决! 转到解答。