#include   <stdio.h>
#include   <stdlib.h>
#include   <math.h>
#include   <conio.h>
#include   <io.h>
#include   <dos.h>
#include   <stdarg.h>
#include   <string.h>

#define Com1	  0x3f0
#define Com2	  0x2f0
#define Com3	  0x3e0
#define Com4	  0x2e0

#define Txbuf	  0x08	   /* tx buffer */
#define Rxbuf	  0x08	   /* rx buffer */
#define Dll	  0x08	   /* baud lsb */
#define Dlh	  0x09	   /* baud msb */
#define Ier	  0x09	   /* int enable reg */
#define Fcr	  0x0a	   /* FIFO control register */
#define Lcr	  0x0b	   /* line control reg */
#define Dfr	  0x0b	   /* Data format  reg */
#define Mcr	  0x0c	   /* modem control reg */
#define Lsr	  0x0d	   /* line status reg */

int OPEN_COM(int iPort, long int lBaudRate);
int CLOSE_COM(int iPort);
int SEND_CMD(int iPort, char cCmd[], long int lTimeout, int iChksum);
int RECEIVE_CMD(int iPort, char cCmd[], long int lTimeout, int iChksum);

