📄 lmidrv.h
字号:
#ifndef _LMIDRV_H_
#define _LMIDRV_H_
#include <windows.h> // Main include file for Windows development
#include <ceddk.h> // CE device driver types, constants, and functions
#include <platform.h>
#include <board.h>
#include <oalintr.h>
#include "LMI.h"
typedef struct __TX_BUFFER_INFO
{
DWORD Permissions; /* @field Current permissions */
ULONG Read; /* @field Current Read index. */
ULONG Length; /* @field Length of buffer */
ULONG * TxBuffer; /* @field Start of buffer */
CRITICAL_SECTION CS; /* @field Critical section */
} TX_BUFFER_INFO, *PTX_BUFFER_INFO;
#define TxEnterCS(pSH) EnterCriticalSection (&(pSH->TxBufferInfo.CS))
#define TxLeaveCS(pSH) LeaveCriticalSection (&(pSH->TxBufferInfo.CS))
#define TxRead(pSH) (pSH->TxBufferInfo.Read)
#define TxLength(pSH) (pSH->TxBufferInfo.Length)
#define TxBytesAvail(pSH) (TxLength(pSH)-TxRead(pSH))
#define TxBuffRead(pSH) (pSH->TxBufferInfo.TxBuffer+pSH->TxBufferInfo.Read)
typedef struct tagLMI_DMAInfo
{
DWORD OpenCnt; // @field Protects use of this port
//Rx
HANDLE hRxUDmaISTEvent;
DWORD dwRxDMASysIntr;
UCHAR ucRxDMAChannel;
PDWORD pdwRxDestPageList;
PVOID pvRxDestBuffer;
DWORD dwRxDestSize;
//Tx
HANDLE hTxUDmaISTEvent;
DWORD dwTxDMASysIntr;
UCHAR ucTxDMAChannel;
PDWORD pdwTxSourcePageList;
PVOID pvTxSourceBuffer;
DWORD dwTxSourceSize;
}LMI_DMA_INFO, *PLMI_DMA_INFO;
typedef struct __LMI_Header
{
CRITICAL_SECTION TransmitCritSec;// @field Protects tx action
HANDLE hLMIEvent; // @field LMI event, both rx and tx
HANDLE hTransmitEvent; // @field transmit event, both rx and tx
HANDLE pDispatchThread;// @field ReceiveThread
DWORD OpenCnt; // @field Protects use of this port
TX_BUFFER_INFO TxBufferInfo;
PUCHAR temp;
ULONG TxBytes; // @field Record of total bytes transmitted.
ULONG TxBytesPending; // @field Record of total bytes awaiting transmit.
ULONG TxBytesSent; // @field Record of bytes sent in one transmission
LMIReg * pLMI;
LCDReg * pLcd;
CRITICAL_SECTION OpenCS;
LMI_DMA_INFO DmaInfo; //the point for dma info
DWORD DMA_Enable;
} LMI_Header, *PLMI_Header;
typedef struct __LMI_OpenHead
{
PLMI_Header LmiHeader;
CRITICAL_SECTION cs; // For using this context, thread-safely
}LMIOpenHead,*PLMIOpenHead;
#ifdef DEBUG
#define ZONE_INIT DEBUGZONE(0)
#define ZONE_HARD DEBUGZONE(1)
#define ZONE_WRITE DEBUGZONE(2)
#define ZONE_READ DEBUGZONE(3)
#define ZONE_CHAIN DEBUGZONE(4)
#define ZONE_NOTHING1 DEBUGZONE(5)
#define ZONE_NOTHING2 DEBUGZONE(6)
#define ZONE_NOTHING3 DEBUGZONE(7)
#define ZONE_NOTHING4 DEBUGZONE(8)
#define ZONE_NOTHING5 DEBUGZONE(9)
#define ZONE_NOTHING6 DEBUGZONE(10)
#define ZONE_NOTHING7 DEBUGZONE(11)
#define ZONE_ALLOC DEBUGZONE(12)
#define ZONE_FUNC DEBUGZONE(13)
#define ZONE_WARNING DEBUGZONE(14)
#define ZONE_ERROR DEBUGZONE(15)
#else
#define ZONE_INIT 0
#define ZONE_HARD 0
#define ZONE_WRITE 0
#define ZONE_READ 0
#define ZONE_CHAIN 0
#define ZONE_NOTHING2 0
#define ZONE_THREAD 0
#define ZONE_EVENTS 0
#define ZONE_CRITSEC 0
#define ZONE_FLOW 0
#define ZONE_IR 0
#define ZONE_NOTHING 0
#define ZONE_ALLOC 0
#define ZONE_FUNC 0
#define ZONE_WARNING 0
#define ZONE_ERROR 0
#endif
#define IOCTL_RESETPT 1
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -