📄 piodio.h
字号:
#include "Windows.h"
#ifndef EXPORTS
#ifdef __cplusplus
#define EXPORTS extern "C" __declspec (dllimport)
#else
#define EXPORTS __declspec (dllimport)
#endif
#endif
#ifndef __PIO_DIO_HEADER__
#define __PIO_DIO_HEADER__
// return code#define PIODIO_NoError 0#define PIODIO_DriverOpenError 1#define PIODIO_DriverNoOpen 2#define PIODIO_GetDriverVersionError 3#define PIODIO_InstallIrqError 4#define PIODIO_ClearIntCountError 5#define PIODIO_GetIntCountError 6#define PIODIO_RegisterApcError 7#define PIODIO_RemoveIrqError 8#define PIODIO_FindBoardError 9#define PIODIO_ExceedBoardNumber 10#define PIODIO_ResetError 11#define PIODIO_IrqMaskError 12#define PIODIO_ActiveModeError 13#define PIODIO_GetActiveFlagError 14#define PIODIO_ActiveFlagEndOfQueue 15// define the interrupt signal source#define PIOD144_P2C0 0 // pin29 of CN1(37 pin D-type, pin1 to pin37)#define PIOD144_P2C1 1 // pin28 of CN1(37 pin D-type, pin1 to pin37)#define PIOD144_P2C2 2 // pin27 of CN1(37 pin D-type, pin1 to pin37)#define PIOD144_P2C3 3 // pin26 of CN1(37 pin D-type, pin1 to pin37)// Interrupt Channel for PIO-D48#define PIOD48_INTCH0 1 // INT_CHAN_0#define PIOD48_INTCH1 2 // INT_CHAN_1#define PIOD48_INTCH2 4 // INT_CHAN_2#define PIOD48_INTCH3 8 // INT_CHAN_3// Interrupt ActiveMode for PIOD48_XXX functions#define PIOD48_ActiveLow 1 // Active When Low#define PIOD48_ActiveHigh 2 // Active When High// to trigger a interrupt when high -> low#define PIODIO_ActiveLow 0// to trigger a interrupt when low -> high#define PIODIO_ActiveHigh 1// ID#define PIO_D168 0x98800150 // 168 * D/I/O#define PIO_D168A 0x800150 // 168A * D/I/O#define PIO_D144 0x800100 // 144 * D/I/O#define PIO_D96 0x800110 // 96 * D/I/O#define PIO_D64 0x800120 // 64 * D/I/O#define PIO_D56 0x800140 // D24 + 16I + 16O#define PIO_D48 0x800130 // 48 * D/I/O#define PIO_D24 0x800140 // 24 * D/I/O// Test functionsEXPORTS float CALLBACK PIODIO_FloatSub(float fA, float fB);EXPORTS short CALLBACK PIODIO_ShortSub(short nA, short nB);EXPORTS WORD CALLBACK PIODIO_GetDllVersion(void);// Driver functionsEXPORTS WORD CALLBACK PIODIO_DriverInit(void);EXPORTS void CALLBACK PIODIO_DriverClose(void);EXPORTS WORD CALLBACK PIODIO_SearchCard(WORD *wBoards, DWORD dwPIOCardID);EXPORTS WORD CALLBACK PIODIO_GetDriverVersion(WORD *wDriverVersion);EXPORTS WORD CALLBACK PIODIO_GetConfigAddressSpace( WORD wBoardNo, DWORD *wAddrBase, WORD *wIrqNo, WORD *wSubVendor, WORD *wSubDevice, WORD *wSubAux, WORD *wSlotBus, WORD *wSlotDevice);EXPORTS WORD CALLBACK PIODIO_ActiveBoard( WORD wBoardNo );EXPORTS WORD CALLBACK PIODIO_WhichBoardActive(void);// DIO functionsEXPORTS void CALLBACK PIODIO_OutputWord(DWORD wPortAddress, DWORD wOutData);EXPORTS void CALLBACK PIODIO_OutputByte(DWORD wPortAddr, WORD bOutputValue);EXPORTS DWORD CALLBACK PIODIO_InputWord(DWORD wPortAddress);EXPORTS WORD CALLBACK PIODIO_InputByte(DWORD wPortAddr);// Interrupt functionsEXPORTS WORD CALLBACK PIODIO_IntInstall(WORD wBoardNo, HANDLE *hEvent, WORD wInterruptSource, WORD wActiveMode);EXPORTS WORD CALLBACK PIODIO_IntRemove(void);EXPORTS WORD CALLBACK PIODIO_IntResetCount(void);EXPORTS WORD CALLBACK PIODIO_IntGetCount(DWORD *dwIntCount);// PIOD48 Counter functionsEXPORTS void CALLBACK PIOD48_SetCounter (DWORD dwBase, WORD wCounterNo, WORD bCounterMode, DWORD wCounterValue);EXPORTS DWORD CALLBACK PIOD48_ReadCounter (DWORD dwBase, WORD wCounterNo, WORD bCounterMode);EXPORTS void CALLBACK PIOD48_SetCounterA (WORD wCounterNo, WORD bCounterMode, DWORD wCounterValue);EXPORTS DWORD CALLBACK PIOD48_ReadCounterA(WORD wCounterNo, WORD bCounterMode);// PIOD48 Interrupt functionsEXPORTS WORD CALLBACK PIOD48_IntInstall (WORD wBoardNo, HANDLE *hEvent, WORD wIrqMask, WORD wActiveMode);EXPORTS WORD CALLBACK PIOD48_IntRemove();EXPORTS WORD CALLBACK PIOD48_IntGetActiveFlag (WORD *bActiveHighFlag, WORD *bActiveLowFlag);EXPORTS WORD CALLBACK PIOD48_IntGetCount(DWORD *dwIntCount);// PIOD64 Counter functionsEXPORTS void CALLBACK PIOD64_SetCounter (DWORD dwBase, WORD wCounterNo, WORD bCounterMode, DWORD wCounterValue);EXPORTS DWORD CALLBACK PIOD64_ReadCounter (DWORD dwBase, WORD wCounterNo, WORD bCounterMode);EXPORTS void CALLBACK PIOD64_SetCounterA (WORD wCounterNo, WORD bCounterMode, DWORD wCounterValue);EXPORTS DWORD CALLBACK PIOD64_ReadCounterA(WORD wCounterNo, WORD bCounterMode);// PIOD48 Frequency Measurement functionsEXPORTS DWORD CALLBACK PIOD48_Freq(DWORD dwBase);EXPORTS DWORD CALLBACK PIOD48_FreqA();
#endif // end define __PIO_DIO_HEADER__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -