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

📄 isp1581device_buf.h

📁 这是一个用ISP1581 USB2.0接口芯片作为图像采集接口的驱动程序。该驱动程序支持Endpoint1 Bulk方式 数据输入传输。实际传输速度可以达到24MBYTE/S
💻 H
字号:
// GnganfgDevice.h
//
// Generated by DriverWizard version DriverStudio 2.6.0 (Build 336)
// Requires Compuware's DriverWorks classes
//

#ifndef __GnganfgDevice_h__
#define __GnganfgDevice_h__

	// Forward declaration
class GnganfgDevice;

struct USB_COMPLETION_INFO
{
	PURB m_pUrb;
	GnganfgDevice* m_pClass;
};

class GnganfgDevice : public KPnpDevice
{
	// Constructors
public:
	SAFE_DESTRUCTORS;
	GnganfgDevice(PDEVICE_OBJECT Pdo, ULONG Unit);
	~GnganfgDevice();

	// Member Functions
public:
	DEVMEMBER_DISPATCHERS
	MEMBER_COMPLETEIRPWITHCONTEXT(USB_COMPLETION_INFO, ReadComplete)
	MEMBER_COMPLETEIRPWITHCONTEXT(USB_COMPLETION_INFO, WriteComplete)
	virtual NTSTATUS OnStartDevice(KIrp I);
	virtual NTSTATUS OnStopDevice(KIrp I);
	virtual NTSTATUS OnRemoveDevice(KIrp I);
	virtual NTSTATUS DefaultPnp(KIrp I);
	virtual NTSTATUS DefaultPower(KIrp I);
	virtual NTSTATUS OnDevicePowerUp(KIrp I);
	virtual NTSTATUS OnDeviceSleep(KIrp I);
	NTSTATUS KBUSBDEV_IOCTL_SetDeviceCommands_Handler(KIrp I);
	NTSTATUS KBUSBDEV_IOCTL_GetDeviceStatus_Handler(KIrp I);
	NTSTATUS KBUSBDEV_IOCTL_GetDeviceID_Handler(KIrp I);
	NTSTATUS KBUSBDEV_IOCTL_GetPortStatus_Handler(KIrp I);
	NTSTATUS KBUSBDEV_IOCTL_SoftReset_Handler(KIrp I);
	NTSTATUS KernelModeSetDeviceCommand(USHORT wIndex );
	NTSTATUS KernelModeGetDeviceStatus( USHORT wIndex, PUCHAR bDevStatus );
	NTSTATUS ConfigFpga( VOID );

#ifdef _COMMENT_ONLY

		// The following member functions are actually defined by the
		// a DEVMEMBER_xxx or MEMBER_xxx macro (such as DEVMEMBER_DISPATCHERS).
		// The macro __COMMENT_ONLY never gets defined.  These comment-only
		// definitions simply allow easy navigation to the functions within
		// the Developer Studio using the class browser.
	NTSTATUS __stdcall ReadComplete(KIrp I, USB_COMPLETION_INFO* pContext); // COMMENT_ONLY
	NTSTATUS __stdcall WriteComplete(KIrp I, USB_COMPLETION_INFO* pContext); // COMMENT_ONLY
	virtual NTSTATUS CleanUp(KIrp I);				// COMMENT_ONLY
	virtual NTSTATUS Create(KIrp I);				// COMMENT_ONLY
	virtual NTSTATUS Close(KIrp I);					// COMMENT_ONLY
	virtual NTSTATUS DeviceControl(KIrp I);			// COMMENT_ONLY
	virtual NTSTATUS SystemControl(KIrp I);			// COMMENT_ONLY
	virtual NTSTATUS Read(KIrp I);					// COMMENT_ONLY
	virtual NTSTATUS Write(KIrp I);					// COMMENT_ONLY
#endif

	// Member Data
protected:
		// Unit number for this device (0-9)
	ULONG				m_Unit;
	KUsbLowerDevice		m_Lower;
	KUsbInterface   	m_Interface;

	KFile m_File;

		// Pipe for USB endpoint 1 IN (address 0x81)
	KUsbPipe			m_Endpoint5;
		// Pipe for USB endpoint 1 OUT (address 0x1)
	KUsbPipe			m_Endpoint4;
		// Pipe for USB endpoint 2 IN (address 0x82)
	KUsbPipe			m_Endpoint3;

	ULONG				m_dwFrameLengthInByte;		// 640*(640+8) = 405K;
	CHAR*				m_lpBufferToRead;

	BOOLEAN				m_FPGAConfigSuccessful;

	// Event object. 
	BOOLEAN				m_HasBeenCreated;
    PKEVENT             m_AdapterNotificationEvent;
    HANDLE              NotificationEventHandle;

};

#define KAIBO_USB_DEVICE_INDEX		0x0400;
#define GET_DEVICE_ID_TOTAL			0xffff;
#define READ_STATUS_PACKET_INDEX	0x0400;
// #define DEFAULT_CFG_FILE_NAME		L"\\??\\C:\\sdramctrl.rbf"
#define DEFAULT_CFG_FILE_NAME		L"\\??\\E:\\temp\\sdramctrl.rbf"
// #define DEFAULT_CFG_FILE_NAME		L"\\??\\E:\2002work\\GDI_Printer\\Printer_Controller\\Altera\\MaxII\\sdramctrl.rbf"


const USHORT SET_FPGA_CONFIG_REQUEST	= 0x0400;
const USHORT SET_FPGA_CONFIG_COMPLETE	= 0x0401;
const USHORT READ_PRINTER_STATUS_PACKET	= 0x0402;
const USHORT READ_VIDEO_FIFO_DATA		= 0x0403;
const USHORT GET_FPGA_CONFIG_REQUEST	= 0x0400;
const UCHAR	 CONFIG_FPGA_START_COMMAND  = 0x40;
const UCHAR	 CONFIG_FPGA_END_COMMAND    = 0x41;
const ULONG	 CONFIG_FPGA_COMMAND_LENGTH = 0x0A;	 	

#endif

⌨️ 快捷键说明

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