Tool/software: TI-RTOS
TI-RTOS: v2.01.00.03
CCS: v6.0.1.0040
Hello,
I am working on project in which dont Know the Recived Data Length. I intialize Uart Parameter as Below.
Void com0TaskFxn(UArg arg0, UArg arg1)
{
char rxBuffer[256], txBuffer[256];
int ret, i;
UART_Handle handle = NULL;
UART_Params params;
UART_Params_init(¶ms);
params.baudRate = usr_s.uart[STRUCT_INDEX_COM0].baud_rate; // baud rate is configure By user.
params.dataLength = UART_LEN_8;
params.parityType = UART_PAR_NONE;
params.stopBits = UART_STOP_ONE;
params.writeDataMode = UART_DATA_BINARY;
params.readDataMode = UART_DATA_BINARY;
params.writeMode = UART_MODE_CALLBACK;
params.writeCallback = (UART_Callback)(&com0WriteCompleteCallbackFunction);
params.readReturnMode = UART_RETURN_FULL;
params.readEcho = UART_ECHO_OFF;
params.readTimeout = ?
handle = UART_open(STRUCT_INDEX_COM0, ¶ms);
if (!handle) {
System_printf("COM 0 UART did not open");
}
else
{
System_printf("COM 0 UART_initialised\n");
}
/* Clear store buffer */
rxBuffer[0] = 0;
while(1)
{
if(!GPIO_read(FACTORY_RESET_AND_UART_CONFIG_MODE_SWITCH))
{
uart0_mode = UART0_MODE_UIMANAGER;
goto com0_re_initialise_position;
}
ret = UART_read(handle, &rxBuffer, 250);
if(ret > 0)
{
/* Add null pointer to buffer for string sending */
rxBuffer[ret + 1] = 0;
if(sys_state.tcpServer1_is_active == true)
{
Mailbox_post(mboxCom0Rx4S1, rxBuffer, TCP_SERVER_TASK_MAIN_LOOP_DELAY_IN_MS + 5);//500);
}
}
if(Mailbox_pend(mboxCom0Tx, txBuffer, BIOS_NO_WAIT))
{
ret = UART_write(handle, &(txBuffer[1]), (int)txBuffer[0]);
}
}
}
As per TI User Manual:
The receive timeout interrupt is asserted when the receive FIFO is not empty, and no further data is received over a 32-bit period when the HSE bit is clear or over a 64-bit period when the HSE bit is set.
The receive timeout interrupt is cleared either when the FIFO becomes empty through reading all the data (or by reading the holding register), or when a 1 is written to the corresponding bit in the UARTICR register.
My question is
<1> read Timeout is the timeout is in "milliseconds" or in "seconds".
<2> read Timeout is for 1 Byte or for whole 250 Bytes.
<3> As In my code baud rate is not fix, In that case What should be read Timeout?
<4> In case of No data to read, After How much time UART_READ() return 0.