// ICP DAS CO., LTD. #ifndef __VXCOMM_H__ #define __VXCOMM_H__ // BAUD #define Baud_50 0x00 #define Baud_75 0x01 #define Baud_110 0x02 #define Baud_134 0x03 #define Baud_150 0x04 #define Baud_300 0x05 #define Baud_600 0x06 #define Baud_1200 0x07 #define Baud_1800 0x08 #define Baud_2400 0x09 #define Baud_4800 0x0A #define Baud_7200 0x0B #define Baud_9600 0x0C #define Baud_19200 0x0D #define Baud_38400 0x0E #define Baud_57600 0x0F #define Baud_115200 0x10 #define Baud_230400 0x11 #define Baud_460800 0x12 #define Baud_921600 0x13 // MODE #define MODE_BIT_5 0x00 #define MODE_BIT_6 0x01 #define MODE_BIT_7 0x02 #define MODE_BIT_8 0x03 // STOP BIT #define STOP_BIT_1 0x00 #define STOP_BIT_1_5 0x04 #define STOP_BIT_2 0x04 // PARITY #define PAR_NONE 0x00 #define PAR_ODD 0x08 #define PAR_EVEN 0x18 #define PAR_MRK 0x28 #define PAR_SPC 0x38 // MODEM CONTROL setting #define MODEM_CONTROL_DTR 0x01 #define MODEM_CONTROL_RTS 0x02 // MODEM LINE STATUS #define LINE_STATUS_CTS 0x01 #define LINE_STATUS_DSR 0x02 #define LINE_STATUS_RI 0x04 #define LINE_STATUS_CD 0x08 // ERROR CODE #define vxc_NO_ERROR 0 #define vxc_ERR_PORT_NO -1 // Port Number Error #define vxc_ERR_WIN32_API -2 // WIN32 API Call Error #define vxc_ERR_OPEN_COM -3 // Open Com Error #define vxc_ERR_BAD_PARAM -4 #define vxc_ERR_NO_DATA -5 #define vxc_ERR_WRITE_FAIL -6 #define vxc_ERR_ABORT_WRITE -7 #define vxc_ERR_WRITE_TIMEOUT -8 #define vxc_ERR_BOARD_NOT_SUPPORT -9 #define vxc_ERR_OUT_CONTROL -10 #define vxc_ERR_GET_MODE -11 #define vxc_ERR_HANDLE_EOF -12 #define vxc_ERR_IO_PENDING -13 #define vxc_ERR_RTS_BY_HW -14 #define vxc_ERR_DTR_BY_HW -15 #define vxc_ERR -100 #ifdef __cplusplus extern "C" { #endif int APIENTRY vxc_COM_Status(int port); int APIENTRY vxc_Open(int); int APIENTRY vxc_Close(int); int APIENTRY EventRXchar(int port); int APIENTRY vxc_ConfigPort(int port, int baud, int mode); char APIENTRY vxc_Getch(int port); int APIENTRY vxc_Read(int port, char *buf, int len); int APIENTRY vxc_Putch(int port, char term); int APIENTRY vxc_Write(int port, char *buf, int len); int APIENTRY vxc_Flush(int port, int func); unsigned long APIENTRY vxc_InpQueueLen(int port); long APIENTRY vxc_OutQueueLen(int port); int APIENTRY vxc_LineStatus(int port); int APIENTRY vxc_RtsDtr(int port, int mode); int APIENTRY vxc_ReachCntEvent(int port, VOID (CALLBACK *func)(int port), int count); int APIENTRY vxc_ModemEvent(int port, VOID (CALLBACK *func)(int port)); int APIENTRY vxc_BreakEvent(int port, VOID (CALLBACK *func)(int port)); int APIENTRY vxc_TxEmptyEvent(int port, VOID (CALLBACK *func)(int port)); int APIENTRY vxc_Break(int port, int time); int APIENTRY vxc_FlowCtrl(int port, int mode); int APIENTRY vxc_WhyTxErr(int port); long APIENTRY vxc_GetBaud(int port); int APIENTRY vxc_GetPortConfig(int port); int APIENTRY vxc_GetFlowSet(int port); int APIENTRY vxc_GetFlowSet2(int port, int member); int APIENTRY vxc_Dtr(int port, int mode); int APIENTRY vxc_Rts(int port, int mode); int APIENTRY vxc_Baud(int port, long speed); int APIENTRY vxc_WhyRxErr(int port); int APIENTRY vxc_TermCharEvent(int port, VOID (CALLBACK *func)(int port), char code); int APIENTRY vxc_ReadTillTerm(int port, char *buf, int lne, int term); int APIENTRY vxc_AbortWrite(int port); int APIENTRY vxc_SetWriteTimeouts(int port, DWORD TotalTimeouts); int APIENTRY vxc_GetWriteTimeouts(int port, DWORD *TotalTimeouts); int APIENTRY vxc_SetReadTimeouts(int port, DWORD TotalTimeouts, DWORD IntervalTimeouts); int APIENTRY vxc_GetReadTimeouts(int port, DWORD *TotalTimeouts, DWORD *IntervalTimeouts); int APIENTRY vxc_AbortRead(int port); int APIENTRY vxc_RTSFlowCtrl(int port, int mode); int APIENTRY vxc_ParityErrorCheck(int port, int mode, char cErrorChar); //[05/05/24] by Sean #ifdef __cplusplus } #endif #endif // __VXCOMM_H__