📄 bpskdevice.h
字号:
// BPSKDevice.h
//
// Generated by DriverWizard version DriverStudio 3.1.0 (Build 1722)
// Requires Compuware's DriverWorks classes
//
#ifndef __BPSKDevice_h__
#define __BPSKDevice_h__
// TODO: The wizard creates a single driver managed queue class.
// You may choose to create additional classes derived from
// KDriverManagedQueueEx to help manage Irp processing.
typedef unsigned char BYTE;
typedef unsigned int WORD;
typedef unsigned long DWORD;
typedef struct
{
DWORD ControlWord[10];//控制字,有效位为最低字节,格式 000000xx(十六进制);
DWORD BytesCount;
}AD9851_CONTROL_STRUCT;
typedef struct
{
DWORD ControlWord[100];//控制字,有效位为最低字节,格式 000000xx(十六进制);
DWORD BytesCount;
}SYMBOL_RATE_STRUCT;
typedef struct
{
DWORD ControlWord[10];//控制字,有效位为最低字节,格式 000000xx(十六进制);
DWORD BytesCount;
}IF_FRE_STRUCT;
class BPSKDevice : public KPnpDevice
{
// Constructors
public:
SAFE_DESTRUCTORS;
BPSKDevice(PDEVICE_OBJECT Pdo, ULONG Unit);
~BPSKDevice();
//Pdo(phycial device object)物理设备对象
// Member Functions
public:
DEVMEMBER_DISPATCHERS
DEVMEMBER_DMAREADY(BPSKDevice, OnDmaReady)
DEVMEMBER_CANCELIRP(BPSKDevice, CancelQueuedIrp)
DEVMEMBER_SYNCHCRITSECTION (BPSKDevice,TestAndClearNotifyApp)
// The ISR (interrupt service routine)
MEMBER_ISR(BPSKDevice, Isr_Irq);
// The DPC (deferred procedure call) for the ISR
MEMBER_DPC(BPSKDevice, DpcFor_Irq);
virtual NTSTATUS OnStartDevice(KIrp I);
virtual NTSTATUS OnStopDevice(KIrp I);
virtual NTSTATUS OnRemoveDevice(KIrp I);
VOID Invalidate(void);
virtual NTSTATUS DefaultPnp(KIrp I);
virtual NTSTATUS DefaultPower(KIrp I);
virtual NTSTATUS OnDevicePowerUp(KIrp I);
virtual NTSTATUS OnDeviceSleep(KIrp I);
void SerialRead(KIrp I);
void SerialWrite(KIrp I);
NTSTATUS CONFIG_SYMBOL_RATE_Handler(KIrp I);
NTSTATUS MODULATE_MODE_Handler(KIrp I);
NTSTATUS SET_IF_FRE_Handler(KIrp I);
NTSTATUS CTRL_AD9851_INIT_Handler(KIrp I);
NTSTATUS IOCTL_SET_NOTIFICATION_EVENT_Handler(KIrp I);
NTSTATUS START_COLLECT_Handler(KIrp I);
NTSTATUS STOP_COLLECT_Handler(KIrp I);
VOID StartDMA(ULONG PAddress,ULONG NBytes);
#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.
VOID OnDmaReady(KDmaTransfer* pXfer, KIrp I); // COMMENT_ONLY
BOOLEAN TestAndClearNotifyApp(PVOID pIrp);
BOOLEAN Isr_Irq(void); // COMMENT_ONLY
VOID DpcFor_Irq(PVOID Arg1, PVOID Arg2); // COMMENT_ONLY
VOID CancelQueuedIrp(KIrp I);
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
virtual VOID StartIo(KIrp I);
#endif
// Member Data
protected:
// Unit number for this device (0-9)
ULONG m_Unit;
KPnpLowerDevice m_Lower;//底层设备对象
// TODO: Create additional driver managed queues. These might be
// of the same class (BPSKDevice_DriverManagedQueue),
// or you might choose to derive another class.
// The following members correspond to hardware resources in the
// device.
KMemoryRange m_MemoryRange0;//内存范围
KIoRange m_IoPortRange0;//端口范围
KIoRange m_IoPortRange1;
KDmaAdapter m_Dma;//DMA适配器对象
KInterrupt m_Irq;//中断对象
KDeferredCall m_DpcFor_Irq;//DPC对象
//添加
KDmaTransfer* m_CurrentTransfer;//DMA传输对象
KCommonDmaBuffer m_Buffer;//通用缓冲区对象
KEvent* m_pEvent;//事件对象,包括存在、清除、查询等
KEvent* m_pEvent1;
KMemory* m_TheMdl;//内存对象
BOOLEAN m_bNotifyApp;
BOOLEAN LocInt;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -