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

📄 pmdser.h

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

  Performance Motion Devices, Inc.

*/
//#include <PMDtypes.h>
//#include <PMDtrans.h>

#ifdef WIN32
// required because we are using the Win32 API
#include <windows.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

enum {Protocol_PointToPoint,Protocol_ModeAddressBit=2,Protocol_IdleLine};

typedef struct {

  PMDuint8 buffer[40];
  PMDuint16 multiDropAddress;
  PMDuint16 protocol;

  PMDuint8 port;

  HANDLE hPort;
  PMDuint32 baud;
  PMDuint8 parity;
  PMDuint8 stop;

  PMDuint16 bVerifyChecksum;
  PMDuint16 bDiagnostics;

} PMDSerialIOData;

#ifdef WIN32
// forward declaration
typedef struct tagPMDIOTransport PMDIOTransport;
typedef struct tagPMDAxisHandle PMDAxisHandle;
#endif

// functions that can be called externally
void PMDSerial_InitData( PMDSerialIOData* transport_data );
PMDuint16 PMDSerial_Init( PMDAxisHandle* handle );
PMDuint16 PMDSetupAxisInterface_Serial( PMDAxisHandle* axis_handle, PMDAxis axis_number, PMDuint8 port_number, PMDuint8 deviceType );
void PMDCreateMultiDropHandle( PMDAxisHandle* dest_axis_handle, PMDAxisHandle* src_axis_handle, PMDAxis axis_number, PMDuint16 address);

// support functions that may be called directly
// once the port is initialized

BOOL PMDSerial_SetConfig( void* transport_data, PMDuint32 b, PMDuint8 p );
BOOL PMDSerial_SetTimeout( void* transport_data, long msec );
void PMDSerial_SetProtocol( void* transport_data, PMDuint16 mode );
void PMDSerial_SetMultiDropAddress( void* transport_data, PMDuint16 address );
PMDuint16 PMDSerial_WriteByte( void* transport_data, char data );
PMDuint16 PMDSerial_ReadByte( void* transport_data, PMDuint8* data );
PMDuint16 PMDSerial_FlushRecv( void* transport_data );
PMDuint16 PMDSerial_Sync( void* transport_data );

void PMDSerial_Close(void* transport_data);

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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