12-18
UUART Communication Support
Programmer’s Manual
Personal Portable System Manager
Programmer’s Manual
12-15
This marks a failed receive request, and the calling application
should determine the recovery actions. The current data reception
is aborted after time out happened.
An application aborts the on-going receive request by calling
UARTReceive() with the abort flag.
The calling application should release the UART access permission as soon as it
is not needed anymore.
It is recommended to force system to Doze mode after terminated a data
reception or a reception is completed for power saving.
Note:
Application swapping is re-enabled after a receive request is
terminated.
12.4.4
Setting Data Reception Time Out
If RTS/CTS is enabled, after UARTReceive() is called, application may receive a
time out error depends on whether CTS is asserted or not. If CTS is negated,
application will not receive time out error because the other communication device
is off. On the other hand, if CTS is asserted, application will receive time out error
if no data arrived within the time out period. For the former case, application
programmer is prefer to set a timeout by RefTimeAlarmId() after called
UARTReceive() to avoid deadlocking as shown in
Example 12-4 Setting initial time out for data reception
.....
IrptRequest(IRPT_UART_FLAG); /* request interrupt */
UARTTimeout(1000); /* set 1 sec time out between two receive interrupts */
UARTReceive(UART_RECEIVE_REQUEST); /* request to receive */
RefTimeAlarmId(&RxAlarmId, RefTimeRead()+2000); /* initiate 2 sec time out */
.....
if(*inData==UART_DATA_RECEIVED)
{
DeleteTimer(gRxAlarmId); /* data arrived, delete init time out */
UARTReadData(gpBuf, gRcvBufSize, &gSizeRead); /* read data */
.....
}
12.5
UART hardware flow control
12.5.1
Enabling RTS/CTS hardware flow control
Applications can enable RTS/CTS hardware flow control by calling
UARTFlowCtrl(UART_RCTS_ENABLE). If hardware flow control is not enabled
when calling RTS/CTS flow control APIs, error code PPSM_ERR_RCTS_IDLE is
returned to the application. RTS is asserted after enabled RTS/CTS flow control.
12.5.2
Disabling RTS/CTS hardware flow control
Applications can disable RTS/CTS hardware flow control by calling
UARTFlowCtrl(UART_RCTS_DISABLE). System negates RTS pin immediately
after disabled hardware flow control. Any further changes in RTS or CTS pin are
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.