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

📄 serial.h

📁 美国Delta Tau公司PMAC多轴运动控制卡的VC++示例程序
💻 H
字号:
/***************************************************************************
	(C) Copyright DELTA TAU DATA SYSTEMS Inc., 1992
		
	Title: 		serial.h

	Version:	1.00

	Date:		08/06/1995

	Author(s):	Dennis Smith

	Header file for PMAC NT serial communications.

	Note(s):

----------------------------------------------------------------------------

	Change log:

	  Date	     Rev	 Who			Description
	---------	-----	-----	--------------------------------------------

***************************************************************************/

#ifndef _SERIAL_H
#define _SERIAL_H

//#include <windows.h>
//#include <windowsx.h>
#include <assert.h>
//#include "resource.h"// Included for serial error code defines which match strings
//#include "mioctl.h"  // Included for status defines, i.e. COMM_TIMEOUT
//#include "common.h"
  #include "download.h"

// Functions --------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif

BOOL  CALLBACK PmacSERIsOpen(DWORD dwDevice);
HANDLE CALLBACK PmacSERGetHandle(DWORD dwDevice);
DWORD CALLBACK PmacSERGetPort(DWORD dwDevice);
BOOL  CALLBACK PmacSERSetPort(DWORD dwDevice,DWORD p);
DWORD CALLBACK PmacSERGetBaudrate(DWORD dwDevice);
BOOL  CALLBACK PmacSERSetBaudrate(DWORD dwDevice,DWORD br);
BOOL  CALLBACK PmacSEROpen(DWORD dwDevice);
BOOL  CALLBACK PmacSERSetComm(DWORD dwDevice,DWORD port,DWORD baud,BOOL odd);
void  CALLBACK PmacSERClose(DWORD dwDevice);
BOOL  CALLBACK PmacSEROnLine(DWORD dwDevice);

BOOL  CALLBACK PmacSERReadReady(DWORD dwDevice);
int   CALLBACK PmacSERSendCharA(DWORD dwDevice,CHAR outch);
int   CALLBACK PmacSERSendCharW(DWORD dwDevice,WCHAR outch);
int   CALLBACK PmacSERSendLineA(DWORD dwDevice,PCHAR outstr);
int   CALLBACK PmacSERSendLineW(DWORD dwDevice,PWCHAR outstr);
int   CALLBACK PmacSERGetLineA(DWORD dwDevice,PCHAR response,UINT maxchar,PUINT num_char);
int   CALLBACK PmacSERGetLineW(DWORD dwDevice,PWCHAR s,UINT maxchar,PUINT num_char);
int   CALLBACK PmacSERGetBufferA( DWORD dwDevice, PCHAR s, UINT maxchar, PUINT num_char );
int   CALLBACK PmacSERGetBufferW( DWORD dwDevice, PWCHAR s, UINT maxchar, PUINT num_char );
int   CALLBACK PmacSERGetResponseA(DWORD dwDevice,PCHAR s,UINT maxchar,PCHAR outstr);
int   CALLBACK PmacSERGetResponseW(DWORD dwDevice,PWCHAR s,UINT maxchar,PWCHAR outstr);
int   CALLBACK PmacSERGetControlResponseA(DWORD dwDevice,PCHAR s,UINT maxchar,CHAR outchar);
int   CALLBACK PmacSERGetControlResponseW(DWORD dwDevice,PWCHAR s,UINT maxchar,WCHAR outchar);
void  CALLBACK PmacSERFlush(DWORD dwDevice);
void  CALLBACK PmacSERSendCommandA(DWORD dwDevice,PCHAR outchar);
void  CALLBACK PmacSERSendCommandW(DWORD dwDevice,PWCHAR outstr);
void  _cdecl PmacSERDownloadFirmware(DWORD dwDevice, PCHAR name);
void SERFlush(DWORD dwDevice);
int  CALLBACK PmacSERGetChar(DWORD dwDevice,PCHAR response);
int  CALLBACK PmacSERDoChecksums(DWORD dwDevice, UINT do_checksums);
BOOL CALLBACK PmacSERCheckSendLine(DWORD dwDevice,char * outchar);
int  CALLBACK PmacSERCheckGetLine(DWORD dwDevice,PCHAR response,UINT maxchar, PUINT num_char);
int  CALLBACK PmacSERCheckResponse(DWORD dwDevice,char * response, UINT maxchar,char * outchar);
int  CALLBACK PmacSerCheckAllWentWell(DWORD dwDevice,int ret,char *cp,char csum);
int  CALLBACK PmacSERDownloadFirmwareFile( DWORD dwDevice, DOWNLOADMSGPROC msgp,
                                       DOWNLOADPROGRESS prgp, LPCTSTR filename );
BOOL CALLBACK PmacSERCheckSendLineA( DWORD dwDevice, char *outchar);
int  CALLBACK PmacSERCheckGetLineA( DWORD dwDevice, PCHAR response, UINT maxchar, PUINT num_char );
int  CALLBACK PmacSERCheckResponseA( DWORD dwDevice, char *response, UINT maxchar, char *outchar );

BOOL ClearTheCommError(DWORD dwDevice,DWORD *dwErrorMask, COMSTAT *comstat);

#ifdef __cplusplus
}
#endif

#ifdef UNICODE
  #define PmacSERSendChar PmacSERSendCharW
  #define PmacSERSendLine PmacSERSendLineW
  #define PmacSERGetLine PmacSERGetLineW
  #define PmacSERGetResponse PmacSERGetResponseW
  #define PmacSERGetControlResponse PmacSERGetControlResponseW
  #define PmacSERSendCommand PmacSERSendCommandW
#else
  #define PmacSERSendChar PmacSERSendCharA
  #define PmacSERSendLine PmacSERSendLineA
  #define PmacSERGetLine PmacSERGetLineA
  #define PmacSERGetResponse PmacSERGetResponseA
  #define PmacSERGetControlResponse PmacSERGetControlResponseA
  #define PmacSERSendCommand PmacSERSendCommandA
#endif // !UNICODE

#endif

⌨️ 快捷键说明

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