⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb_lib.h

📁 不可不看的USB_C51源码 内有C和VC6.0两种方式的编码
💻 H
字号:
//////////////////////////////////////////////////////////////////////
// File - usb_lib.h
//
// Library for accessing the USB device.
// Code was generated by DriverWizard.
// It accesses the hardware via WinDriver functions.
// 
//////////////////////////////////////////////////////////////////////

#ifndef _USB_LIB_H_
#define _USB_LIB_H_

#if !defined(UNIX) && (defined(LINUX) || defined(SOLARIS))
    #define UNIX
#endif

#if defined(__KERNEL__)
    #include "C:/windriver/include/kdstdlib.h"
#endif //__KERNEL__
#include "C:/windriver/include/windrvr.h"
#include "C:/windriver/include/windrvr.h"

#ifdef __cplusplus
extern "C" {
#endif

// this string is set to an error message, if one occurs
extern CHAR USB_ErrorString[];

enum { USB_DEFAULT_VENDOR_ID  = 0x4242 };
enum { USB_DEFAULT_PRODUCT_ID = 0x0100 };
enum { USB_DEFAULT_CONFIG = 0 };
enum { USB_DEFAULT_INTERFACE = 0 };
enum { USB_DEFAULT_ALTERNATE = 0 };

typedef struct USB_STRUCT *USB_HANDLE;

void USB_RegisterWinDriver();
DWORD USB_CountDevices (DWORD dwVendorID, DWORD dwProductID);
USB_HANDLE USB_Open(DWORD uniqueId, DWORD configIndex, DWORD dwInterface, DWORD dwAlternate);
void USB_Close(USB_HANDLE hUSB);
void USB_GetDeviceInfo(USB_HANDLE hUSB, WD_USB_DEVICE_INFO *pDevInfo);
BOOL USB_ResetPipe(USB_HANDLE hUSB, DWORD pipeNum);
void USB_ResetDevice(USB_HANDLE hUSB);
DWORD USB_ReadPipe00(USB_HANDLE hUSB, PVOID pBuffer, DWORD dwSize, BYTE setupPacket[8]);
DWORD USB_WritePipe00(USB_HANDLE hUSB, PVOID pBuffer, DWORD dwSize, BYTE setupPacket[8]);
void USB_StopTransferPipe00(USB_HANDLE hUSB);
DWORD USB_ReadPipe81(USB_HANDLE hUSB, PVOID pBuffer, DWORD dwSize);
void USB_StopTransferPipe81(USB_HANDLE hUSB);

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -