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

📄 pm5002k_lib.h

📁 pm518采集卡驱动源码
💻 H
字号:
//////////////////////////////////////////////////////////////////////
// File - pm5002k_lib.h
//
// Library for accessing the PM5002K card,
// Code was generated by DriverWizard v6.20 - http://www.jungo.com.
// The library accesses the hardware via WinDriver functions.
// 
// Copyright (c) 2004 Jungo Ltd.  http://www.jungo.com
// 
//////////////////////////////////////////////////////////////////////

#ifndef _PM5002K_LIB_H_
#define _PM5002K_LIB_H_

#include "c:/windriver/include/windrvr.h"
#include "c:/windriver/include/windrvr_int_thread.h"
#include "c:/windriver/samples/shared/bits.h"

#ifdef __cplusplus
extern "C" {
#endif

enum
{
    PM5002K_MODE_BYTE   = 0,
    PM5002K_MODE_WORD   = 1,
    PM5002K_MODE_DWORD  = 2
};
typedef DWORD PM5002K_MODE;

enum
{
    PM5002K_IORange0 = 0,
};
typedef DWORD PM5002K_ADDR;

// Number of IO and memory ranges
enum { PM5002K_ITEMS = 1 };

enum{ PM5002K_Interrupt5 = 1 };
enum{ PM5002K_Interrupt7 = 2 };
enum{ PM5002K_Interrupt10 = 3 };
enum{ PM5002K_Interrupt11 = 4 };
enum{ PM5002K_Interrupt12 = 5 };
enum{ PM5002K_TOTAL_ITEMS = 6 };

// IO ranges definitions
enum { PM5002K_IORange0_ADDR = 0x100 };
enum { PM5002K_IORange0_BYTES = 0x300 };

// Interrupts definitions
enum { PM5002K_Interrupt5_IRQ = 0x5 };
enum { PM5002K_Interrupt5_OPTIONS = 00 };
enum { PM5002K_Interrupt7_IRQ = 0x7 };
enum { PM5002K_Interrupt7_OPTIONS = 00 };
enum { PM5002K_Interrupt10_IRQ = 0xa };
enum { PM5002K_Interrupt10_OPTIONS = 00 };
enum { PM5002K_Interrupt11_IRQ = 0xb };
enum { PM5002K_Interrupt11_OPTIONS = 00 };
enum { PM5002K_Interrupt12_IRQ = 0xc };
enum { PM5002K_Interrupt12_OPTIONS = 00 };

typedef struct PM5002K_STRUCT *PM5002K_HANDLE;

typedef struct
{
    DWORD dwCounter;   // number of interrupts received
    DWORD dwLost;      // number of interrupts yet to be handled
    BOOL fStopped;     // was the interrupt disabled during wait
} PM5002K_Interrupt5_RESULT;

//////////////////////////////////这个是回调函数吧,改一改//////////////////////////////////////
//加一个回调函数用的软件缓冲
//long m_sdata[4096];
//typedef void (DLLCALLCONV *PM5002K_Interrupt5_HANDLER)(PM5002K_HANDLE hPM5002K, PM5002K_Interrupt5_RESULT *intResult,long *pResultArr);
//再改一改
typedef void (DLLCALLCONV *PM5002K_Interrupt5_HANDLER)(PM5002K_HANDLE hPM5002K, PM5002K_Interrupt5_RESULT *intResult,long *pResultArr,int inttimein);
void PM5002K_ReadHFifo(PM5002K_HANDLE hPM5002K,\
					   PM5002K_ADDR addrSpace,\
					   DWORD dwOffset,\
					   unsigned short *buf,\
					   DWORD dwBytes);

//void PM5002K_ReadHFifo(PM5002K_HANDLE hPM5002K, PM5002K_ADDR addrSpace, DWORD dwOffset, unsigned short *buf, DWORD dwBytes);
//////////////////////////////////////////////////////////////////////////////////////////////

typedef struct
{
    DWORD dwCounter;   // number of interrupts received
    DWORD dwLost;      // number of interrupts yet to be handled
    BOOL fStopped;     // was the interrupt disabled during wait
} PM5002K_Interrupt7_RESULT;

typedef void (DLLCALLCONV *PM5002K_Interrupt7_HANDLER)(PM5002K_HANDLE hPM5002K, PM5002K_Interrupt7_RESULT *intResult);

typedef struct
{
    DWORD dwCounter;   // number of interrupts received
    DWORD dwLost;      // number of interrupts yet to be handled
    BOOL fStopped;     // was the interrupt disabled during wait
} PM5002K_Interrupt10_RESULT;

typedef void (DLLCALLCONV *PM5002K_Interrupt10_HANDLER)(PM5002K_HANDLE hPM5002K, PM5002K_Interrupt10_RESULT *intResult);

typedef struct
{
    DWORD dwCounter;   // number of interrupts received
    DWORD dwLost;      // number of interrupts yet to be handled
    BOOL fStopped;     // was the interrupt disabled during wait
} PM5002K_Interrupt11_RESULT;

typedef void (DLLCALLCONV *PM5002K_Interrupt11_HANDLER)(PM5002K_HANDLE hPM5002K, PM5002K_Interrupt11_RESULT *intResult);

typedef struct
{
    DWORD dwCounter;   // number of interrupts received
    DWORD dwLost;      // number of interrupts yet to be handled
    BOOL fStopped;     // was the interrupt disabled during wait
} PM5002K_Interrupt12_RESULT;

typedef void (DLLCALLCONV *PM5002K_Interrupt12_HANDLER)(PM5002K_HANDLE hPM5002K, PM5002K_Interrupt12_RESULT *intResult);

// Function: PM5002K_Open()
//   Register an ISA card to enable working with it.
//   The handle returned from this function is used by most of the functions in this file.
BOOL PM5002K_Open (PM5002K_HANDLE *phPM5002K);

// Function: PM5002K_RegisterWinDriver()
//   Enter a license string into WinDriver module.
DWORD PM5002K_RegisterWinDriver(void);

// Function: PM5002K_Close()
//   Unregister an opened card.
void PM5002K_Close(PM5002K_HANDLE hPM5002K);

// General read/write functions

// Function: PM5002K_ReadWriteBlock()
//   Read/Write data from/to the card's memory/IO into/from a given buffer.
void PM5002K_ReadWriteBlock(PM5002K_HANDLE hPM5002K, PM5002K_ADDR addrSpace,
    DWORD dwOffset, BOOL fRead, PVOID buf, DWORD dwBytes, PM5002K_MODE mode);

// Function: PM5002K_ReadByte()
//   Read a Byte from the card's memory/IO.
BYTE PM5002K_ReadByte (PM5002K_HANDLE hPM5002K, PM5002K_ADDR addrSpace, DWORD dwOffset);

// Function: PM5002K_ReadWord()
//   Read a Word from the card's memory/IO.
WORD PM5002K_ReadWord (PM5002K_HANDLE hPM5002K, PM5002K_ADDR addrSpace, DWORD dwOffset);

// Function: PM5002K_ReadDword()
//   Read a Dword from the card's memory/IO.
UINT32 PM5002K_ReadDword (PM5002K_HANDLE hPM5002K, PM5002K_ADDR addrSpace, DWORD dwOffset);

// Function: PM5002K_WriteByte()
//   Write a Byte to the card's memory/IO.
void PM5002K_WriteByte (PM5002K_HANDLE hPM5002K, PM5002K_ADDR addrSpace, DWORD dwOffset, BYTE data);

// Function: PM5002K_WriteWord()
//   Write a Word to the card's memory/IO.
void PM5002K_WriteWord (PM5002K_HANDLE hPM5002K, PM5002K_ADDR addrSpace, DWORD dwOffset, WORD data);

// Function: PM5002K_WriteDword()
//   Write a Dword to the card's memory/IO.
void PM5002K_WriteDword (PM5002K_HANDLE hPM5002K, PM5002K_ADDR addrSpace, DWORD dwOffset, UINT32 data);


// Interrupts handling functions

// Function: PM5002K_Interrupt5IsEnabled()
//   Check if the interrupt is enabled.
BOOL PM5002K_Interrupt5IsEnabled (PM5002K_HANDLE hPM5002K);

// Function: PM5002K_Interrupt5Enable()
//   Enable the interrupt.
BOOL PM5002K_Interrupt5Enable (PM5002K_HANDLE hPM5002K, PM5002K_Interrupt5_HANDLER funcIntHandler);

// Function: PM5002K_Interrupt5Disable()
//   Disable the interrupt.
void PM5002K_Interrupt5Disable (PM5002K_HANDLE hPM5002K);

// Function: PM5002K_Interrupt7IsEnabled()
//   Check if the interrupt is enabled.
BOOL PM5002K_Interrupt7IsEnabled (PM5002K_HANDLE hPM5002K);

// Function: PM5002K_Interrupt7Enable()
//   Enable the interrupt.
BOOL PM5002K_Interrupt7Enable (PM5002K_HANDLE hPM5002K, PM5002K_Interrupt7_HANDLER funcIntHandler);

// Function: PM5002K_Interrupt7Disable()
//   Disable the interrupt.
void PM5002K_Interrupt7Disable (PM5002K_HANDLE hPM5002K);

// Function: PM5002K_Interrupt10IsEnabled()
//   Check if the interrupt is enabled.
BOOL PM5002K_Interrupt10IsEnabled (PM5002K_HANDLE hPM5002K);

// Function: PM5002K_Interrupt10Enable()
//   Enable the interrupt.
BOOL PM5002K_Interrupt10Enable (PM5002K_HANDLE hPM5002K, PM5002K_Interrupt10_HANDLER funcIntHandler);

// Function: PM5002K_Interrupt10Disable()
//   Disable the interrupt.
void PM5002K_Interrupt10Disable (PM5002K_HANDLE hPM5002K);

// Function: PM5002K_Interrupt11IsEnabled()
//   Check if the interrupt is enabled.
BOOL PM5002K_Interrupt11IsEnabled (PM5002K_HANDLE hPM5002K);

// Function: PM5002K_Interrupt11Enable()
//   Enable the interrupt.
BOOL PM5002K_Interrupt11Enable (PM5002K_HANDLE hPM5002K, PM5002K_Interrupt11_HANDLER funcIntHandler);

// Function: PM5002K_Interrupt11Disable()
//   Disable the interrupt.
void PM5002K_Interrupt11Disable (PM5002K_HANDLE hPM5002K);

// Function: PM5002K_Interrupt12IsEnabled()
//   Check if the interrupt is enabled.
BOOL PM5002K_Interrupt12IsEnabled (PM5002K_HANDLE hPM5002K);

// Function: PM5002K_Interrupt12Enable()
//   Enable the interrupt.
BOOL PM5002K_Interrupt12Enable (PM5002K_HANDLE hPM5002K, PM5002K_Interrupt12_HANDLER funcIntHandler);

// Function: PM5002K_Interrupt12Disable()
//   Disable the interrupt.
void PM5002K_Interrupt12Disable (PM5002K_HANDLE hPM5002K);

// If an error occurs, this string will be set to contain a relevant error message
extern CHAR PM5002K_ErrorString[];

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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