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.

[参考译文] CCS/TM4C123GE6PM:函数"非阻塞"UART

Guru**** 2380860 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/767236/ccs-tm4c123ge6pm-functions-nonblocking-uart

器件型号:TM4C123GE6PM

工具/软件:Code Composer Studio

您好!

我有一个问题。

在"UART.h"库中、我有以下函数:"int32_t UARTCharGet (uint32_t ui32Base)"和"UARTCharGetNonBlocking (uint32_t ui32Base)"或"UARTCharPut"和"UARTCharPutNonBlocking"。

它们之间有何差异?

函数“非阻塞”在接口上运行?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    大家好、Pawel、

    即使缓冲区中没有字符、UARTCharGetNonBlocking 函数也始终会立即返回、这就是它是非阻塞函数的原因。 同时、UARTCharGet 将等待一个字符可用。

    同样、如果 FIFO 中没有空间、UARTCharPutNonBlocking 返回失败、而 UARTCharPut 将等待直到有空间可加载数据。