Non blocking UART

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Non blocking UART

1,048 次查看
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....)

标记 (2)
0 项奖励
2 回复数

482 次查看
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 项奖励

482 次查看
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 项奖励