InstallCom()
Function: Installs the driver for the COM Port.
Syntax:
int InstallCom(int port, unsigned long baud, int data,
int parity, int stop);
Header: #include
”7188xc.h”
Description: Installs the driver for the COM Port. The COM Port
number is not assigned and can be modified using the
“port” parameter.
port: assigns the COM port number
baud: Baud Rate, the default Baud Rate for the
I-7188XC(D) is 115200
Example:
#include “7188xc.h”
void main()
{
int quit=0, data, i, port=1; /*port=1, uses COM1*/
InitLib();
InstallCom(port,115200,8,0,1); /*installs the COM port driver*/
for(i=0; i<10; i++)
printCom(port,"Test %d\n\r",i); /*prints data to the COM Port*/
while(!quit) {
if(IsCom(port)) { /*checks if any data is in the COM Port buffer*/
data=ReadCom(port); /*reads data from the COM Port buffer*/
ToCom(port,data); /*sends data to the COM Port buffer*/
ClearCom(port); /*clears all the data in the COM Port buffer*/
if(data=='Q') quit=1; /*if 'Q' is received, exit the program*/
}
}
RestoreCom(port); /*uninstalls the driver for COM Port */
}
InstallCom1()
Function: Installs the driver for COM1.
Syntax:
int InstallCom1(unsigned long baud, int data, int
parity, int stop);
Header: #include
”7188xc.h”
Description: Installs the driver for COM1, and is assigned to COM1
baud: Baud Rate, the default Baud Rate for the
I-7188XC(D) is 115200
Example:
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
102
Summary of Contents for I-7188XC Series
Page 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Page 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Page 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Page 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...