
41
Uart0_Open
Purpose
:
Use
Uart0_Open
function to open the serial port (UART) of collector
or simulator
Syntax
:
void Uart0_Open(void);
Example call
:
Uart0_Open();
Includes
:
#include
“
UserLib.h
"
Description
:
The
Uart0_Open
function opens the serial port (UART) of collector
or simulator. When the serial port is opened, the communication
protocol will be set according to the agreement. You can start the
UART setting by clicking the setup button on the Simulator display.
Uart0_Read
Purpose
:
Use
Uart0_Read
to read a specified number of byte data from the
serial port (UART) of collector or simulator
Syntax
:
Int Uart0_Read(char *pssBuffer, int nNumberOfBytesToRead);
Example call
:
numread = Uart0_Read (inbuffer, 80); // Read 80 byte data
Includes
:
#include
“
UserLib.h
"
Description
:
The
Uart0_Read
function reads number of
nNumberOfBytesToRead
byte data through the serial port (UART) of collector or simulator.
You have to allocate enough memory to
pssBuffer
. The data type of
pssBuffer
is a pointer to
char
.
Returns
:
The
Uart0_Read
function returns the number of data, which was
successfully read.
Uart0_Write
Purpose
:
Use
Uart0_Write
to write a specified number of byte data to the serial
port (UART) of collector or simulator
Syntax
:
int Uart0_Write(char *pssBuffer, int nNumberOfBytesToWrite);
Example call
:
numwrite = Uart0_Write (outbuffer, 80); // Write 80 bytes data
Includes
:
#include
“
UserLib.h
"
Description
:
The
Uart0_Write
function writes number of
nNumberOfBytesToWrite
byte data through the serial port (UART) of collector or simulator.
Returns
:
The
Uart0_Write
function returns the number of data, which was
successfully written.
◆
System Calls for Collector
Delay