Download Vinculum II User Guide

Transcript
Document Reference No.: FT_000289
Vinculum II User Guide
AN_151 User Manual Version 1.4.0-SP1
Clearance No.: FTDI# xxx
usbhost_ioctl_cb_t hc_iocb; // ioctl block
usbhost_ioctl_cb_class_t hc_iocb_class;
usbhost_device_handle ifDev; // handle to the next device interface
hc_iocb_class.dev_class = USB_CLASS_IMAGE;
hc_iocb_class.dev_subclass = USB_SUBCLASS_IMAGE_STILLIMAGE;
hc_iocb_class.dev_protocol = USB_PROTOCOL_IMAGE_PIMA;
usbhost_iocb.ioctl_code = VOS_IOCTL_USBHOST_DEVICE_FIND_HANDLE_BY_CLASS;
usbhost_iocb.handle.dif = NULL;
usbhost_iocb.set = &hc_iocb_class;
usbhost_iocb.get = &ifDev;
vos_dev_ioctl(hUsbHost2, &usbhost_iocb);
4.2.1.2.4.8 VOS_IOCTL_USBHOST_DEVICE_GET_VID_PID
Description
Returns the VID and PID of a device interface from a device interface handle.
Parameters
The device to query is passed in the handle.dif member.
Returns
A structure to receive the VID and PID information for a device is passed in the get member of the
IOCTL structure.
typedef struct _usbhost_ioctl_cb_vid_pid_t {
unsigned short vid;
unsigned short pid;
} usbhost_ioctl_cb_vid_pid_t;
Common values of VID and PID are in the driver header file "usb.h".
Example
usbhost_ioctl_cb_t hc_iocb; // ioctl block
usbhost_device_handle ifDev; // handle to the next device interface
usbhost_ioctl_cb_vid_pid_t hc_iocb_vid_pid;
hc_iocb.ioctl_code = VOS_IOCTL_USBHOST_DEVICE_GET_NEXT_HANDLE;
// find first device interface
hc_iocb.handle.dif = NULL;
hc_iocb.get = &ifDev;
vos_dev_ioctl(hUsbHost, &hc_iocb);
hc_iocb.handle.dif = ifDev;
if (ifDev)
{
hc_iocb.ioctl_code = VOS_IOCTL_USBHOST_DEVICE_GET_VID_PID;
hc_iocb.get = &hc_iocb_vid_pid;
vos_dev_ioctl(hUsbHost, &hc_ioctl);
myVid = hc_iocb_vid_pid.vid;
myPid = hc_iocb_vid_pid.pid;
}
4.2.1.2.4.9 VOS_IOCTL_USBHOST_DEVICE_GET_CLASS_INFO
Description
Returns the class, subclass and protocol of a device interface from a device interface handle.
Copyright © 2011 Future Technology Devices International Ltd.
261