我现在用ISP1581开发USB2.0,固件程序参考了别人的代码,驱动用的是ISP1581通用驱动程序,现在用VC++开发一个应用程序,实现了中断及批量传输,但是都是在全速模式低下(FullSpeed),固件程序中全速到高速的转换程序己经有了,现在我不懂在应用程序中哪个命令是要进行高速传输的,我的头文件中只有以下的命令,望高手赐教,或给个建议,谢谢!
#define XXGDRV_IOCTL_DRV_VERSION CTL_CODE(FILE_DEVICE_UNKNOWN, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_DEV_VERSION CTL_CODE(FILE_DEVICE_UNKNOWN, 0x801, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_SYS_INIT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x802, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_DEV_INIT CTL_CODE(FILE_DEVICE_UNKNOWN, 0x803, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_READ_DATA CTL_CODE(FILE_DEVICE_UNKNOWN, 0x804, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_WRITE_DATA CTL_CODE(FILE_DEVICE_UNKNOWN, 0x805, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_SET_CMD CTL_CODE(FILE_DEVICE_UNKNOWN, 0x806, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_GET_CMD CTL_CODE(FILE_DEVICE_UNKNOWN, 0x807, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_CONTROL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x808, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_ENABLE_ISO_MODE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x809, METHOD_BUFFERED, FILE_ANY_ACCESS) #define XXGDRV_IOCTL_READ_WRITE_REGISTER CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80a, METHOD_BUFFERED, FILE_ANY_ACCESS)
HANDLE CUSBApp::OpenDevice(DWORD dwInstance, PDWORD pdwError) { HANDLE hDev; // Class GUID used to open device // GUID ClassGuid = XXGDrvDevice_CLASS_GUID; CDeviceInterfaceClass DevClass(&ClassGuid, pdwError); if(*pdwError != ERROR_SUCCESS) return INVALID_HANDLE_VALUE; CDeviceInterface DevInterface(&DevClass, dwInstance, pdwError); if(*pdwError != ERROR_SUCCESS) return INVALID_HANDLE_VALUE; hDev = CreateFile( DevInterface.DevicePath(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); //if(lpszDevicePath) // _tcscpy(lpszDevicePath, DevInterface.DevicePath()); if(hDev == INVALID_HANDLE_VALUE) *pdwError = GetLastError(); return hDev; } |