This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[c674x] Uart GIO driver in Async mode with a timeout?

Other Parts Discussed in Thread: SYSBIOS

Is it possible for GIO in asynchronous mode to have a timeout, if so how?

For example, if I have a Uart that I want to function asynchronously so I use the below code. However, I also want a timeout; say I use a huge buffer but I get several smaller buffers that I would like to start parsing.  Is that possible?

#define BUFSIZE (1024)

static struct GIO_AppCallback gCB;

Ptr buf = (Ptr)MEM_calloc(0, BUFSIZE, BUFALIGN);

size_t len = BUFSIZE;

gCB.fxn = (GIO_TappCallback)UartRxCB;
gCB.arg = NULL;

GIO_submit(uartInHandle, IOM_READ, (Ptr)buf, &len, &gCB);

Cheers!

  • Hi Jrvanho,

    Asynchronous and timeout do not fit together in this context. The idea of asynchronous is that it operates in "parallel" with your code execution; freeing up your task to work on something else and therefore eliminating the need for a timeout.

    Jrvanho said:
    GIO_submit(uartInHandle, IOM_READ, (Ptr)buf, &len, &gCB);
    You can simply have buf point to a different location of the large buffer and use a smaller len argument. However, for what you're looking at, you may want to use GIO_read().

    Int GIO_read(GIO_Handle handle, Ptr buf, SizeT *pSize);

    See the ti/sysbios/io/GIO API documentation.

  • It turns out, if I configure the UART to use a different fifo trigger level, I get this to happen.  I get an IOM_ETIMEOUT in my rxCB if I receive less than my GIO_submit buffer size.  So I guess I answered my own questions.