#include “7188xc.h”
void main()
{
int quit=0,data;
InitLib();
InstallCom1(115200,8,0,1); /*install the driver for COM1*/
while(!quit) {
if(IsCom1()) { /*checks if any data is in the COM1 buffer*/
data=ReadCom1(); /*reads data from COM1*/
ToCom1(data); /*sends data to COM1*/
if(data==’q’) quit=1; /*if ‘q’ is received, exit the program*/
}
}
RestoreCom1(); /*uninstalls the driver for COM1*/
}
RestoreCom()
Function: Uninstalls the driver for the COM Port. The COM Port
number is not assigned.
Syntax:
int RestoreCom(int port);
Header: #include
”7188xc.h”
Description: Uninstalls 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
Example: Please refer to “InstallCom()” for an example.
RestoreCom1()
Function: Uninstall the driver for COM1.
Syntax:
int RestoreCom1(void);
Header: #include
”7188xc.h”
Description: Uninstall the driver for COM1 and is assigned to COM1
Example: Please refer to “InstallCom1()” for an example.
IsCom()
Function: Checks
whether there is any data stored in the COM Port
buffer. The COM Port number is not assigned.
Syntax:
int IsCom(int port);
Header: #include
”7188xc.h”
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
103
Содержание I-7188XC Series
Страница 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Страница 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Страница 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Страница 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...