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

📄 pmdtrans.h

📁 一个机器人的源代码.软件设计得超级好!是商业级代码.
💻 H
字号:
#ifndef PMD_Transport
#define	PMD_Transport

//  "Base Class" definitions for IOTransport
//
//  Performance Motion Devices, Inc.
//

//#include "PMDtypes.h"

typedef enum {
	InterfaceParallel,
	InterfaceDriver,
	InterfacePCI,
	InterfaceSerial,
	InterfaceCAN,
} PMDInterfaceType;


typedef struct tagPMDIOTransport {

// these have not yet been defined in any interface classes
//	void (*DisableInterrupt)(void*);
//	void (*EnableInterrupt)(void*);

	PMDresult (*SendCommand)(void*, PMDuint8 xCt, PMDuint16* xDat, PMDuint8 rCt, PMDuint16* rDat);

	void (*Close)(void*);

	PMDuint16 (*GetStatus)(void*);
	PMDuint16 (*IsReady)(void*);
	PMDuint16 (*HasInterrupt)(void*);
	PMDuint16 (*HasError)(void*);
	PMDuint16 (*HardReset)(void*);

} PMDIOTransport;

typedef struct tagPMDAxisHandle {
	PMDAxis	axis;
	PMDIOTransport transport;
	void* transport_data;
	PMDresult result;
	PMDInterfaceType InterfaceType;
} PMDAxisHandle;

typedef PMDAxisHandle* PMDAxisInterface;

#ifdef PMD_PARALLEL_INTERFACE
#include "PMDpar.h"
#endif

#ifdef PMD_SERIAL_INTERFACE
#include "PMDser.h"
#endif

#ifdef PMD_DRIVER_INTERFACE
#include "PMDdrv.h"
#endif

#ifdef PMD_PCI_INTERFACE
#ifndef _LINUX
#include "PMDpci.h"
#endif
#endif

PMDuint16 BuildCommand(PMDuint16 OPCode, PMDAxis axis);

PMDresult SendCommand(PMDAxisInterface axis_intf, PMDuint16 OPCode);
PMDresult SendCommandWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 data1);
PMDresult SendCommandWordWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 data1, PMDuint16 data2);
PMDresult SendCommandWordWordWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 data1, PMDuint16 data2, PMDuint16 data3);
PMDresult SendCommandLong(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint32 data1);
PMDresult SendCommandLongWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint32 data1, PMDuint16 data2);
PMDresult SendCommandWordLong(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 data1, PMDuint32 data2);
PMDresult SendCommandGetWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 *data1);
PMDresult SendCommandGetWordWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 *data1, PMDuint16 *data2);
PMDresult SendCommandGetWordWordWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 *data1, PMDuint16 *data2, PMDuint16 *data3);
PMDresult SendCommandGetLong(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint32 *data1);
PMDresult SendCommandGetWordLong(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 *data1, PMDuint32 *data2);
PMDresult SendCommandWordGetWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 data1, PMDuint16 *data2);
PMDresult SendCommandWordGetLong(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint16 data1, PMDuint32 *data2);
PMDresult SendCommandLongGetWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, PMDuint32 data1, PMDuint16* data2);
PMDresult SendCommandWordWordGetWord(PMDAxisInterface axis_intf, PMDuint16 OPCode, 
									 PMDuint16 data1, PMDuint16 data2, PMDuint16 *data3);


#endif

⌨️ 快捷键说明

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