![](http://datasheet.mmic.net.cn/260000/PPSMMANUAL_datasheet_15946768/PPSMMANUAL_145.png)
26-6
UART Communication Tools
Programmer’s Manual
26.5
UARTReadData
Syntax
STATUS
UARTReadData
(P_U8 pData, U16 bufSize, P_U16 sizeRead)
Description
Reads data received from the UART.
An application can initiate a receive request to start receiving data from the
UART by calling UARTReceive() (Section 26.6 - UARTReceive). When PPSM
receives data from the UART, it will post an interrupt message to notify the
calling application. The calling application can then read the data by calling
UARTReadData().
The calling application needs to pass a buffer, with its size, to PPSM for storing
the received data. PPSM will pass back to the calling application the actual
number of bytes of data read into the application buffer.
An error condition will be returned if the calling application was not granted
permission to use the UART, or no receive request has been initiated when
UARTReadData() is called.
If RTS/CTS is enabled, RTS pin is negated when PPSM running UARTRead-
Data() and asserted after data reading completed.
Parameter
Return Value
26.6
UARTReceive
Syntax
STATUS
UARTReceive
(U8 receiveFlag)
Name
Description
pData
Pointer to buffer for storing received data
bufSize
Size of data buffer (in number of bytes)
sizeRead
Number of bytes of data read
Name
Description
PPSM_OK
Successful operation
PPSM_ERR_INVALID_ACCESS
Invalid access of UART
PPSM_ERR_NO_REQUEST
Receive request was not initiated
Personal Portable System Manager
Programmer’s Manual
26-3
Syntax
STATUS
UARTFlowCtrl
Description
Enable or disable hardware flow control in UART data communication. PPSM
can handle data communication with another device by UART with RTS/CTS
hardware flow control. An application can enable hardware control by calling
UARTFlowCtrl() with appropriate flag.
Parameter
Return Value
26.3
UARTInquire
Syntax
PPSM_ERR_INVALID_ACCESS
Invalid access of UART
PPSM_ERR_MODE
Invalid operating mode flag
PPSM_ERR_BAUD
Invalid baud rate flag
PPSM_ERR_PARITY
Invalid parity flag
PPSM_ERR_STOPBIT
Invalid number of stop bits flag
PPSM_ERR_CHARLEN
Invalid character length flag
Name
Description
controlType
Name
Description
PPSM_OK
Successful operation
PPSM_ERR_INVALID_ACCESS
Invalid access of UART
PPSM_ERROR
Invalid input argument
Name
Description
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.