Non blocking UART

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Non blocking UART

1,040 Views
oaf
Contributor IV

Hi,

In the raw MQX examples there is example of non blocking uart input:

uint32_t ser_opts = IO_SERIAL_NON_BLOCKING;

retval = ioctl(ser_device, IO_IOCTL_SERIAL_SET_FLAGS, &ser_opts);
if (retval != MQX_OK)
{
      fputs("TXtask Fatal Error: Unable to setup non-blocking mode.", stderr);
 

Unfortunately I could not find the IO_SERIAL_NON_BLOCKING defined inside my project or the KSDK,

is the non-blockin mode removed, or is the interface just changed?

(I just want to check if a char is available from the UART, and if not just keep on with what I was doing....)

Tags (2)
0 Kudos
2 Replies

474 Views
oaf
Contributor IV

I don't really understand what you mean. My UART is IRQ driven, could you please tell me which API I should use to

figure out if there is a char waiting in the input quee?

0 Kudos

474 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Ole,

Drivers is classic MQX and MQX for KSDK are completeley different.

In MQX for KSDK you need to check for RDRF flash in UARTx Statusx Register. This flag is defined in KSDK as kUartIntRxDataRegFull.

Hope this helps.

Carlos

0 Kudos