cancel
Showing results for 
Search instead for 
Did you mean: 

UART_CheckIdleState

msemegen
Associate II

Hi,

Recently, while reviewing the code for USART handling, I came across the function UART_CheckIdleState. It is called at the end of the peripheral initialization. The name suggests that it checks the IDLE state, but the implementation does something else (checking the TEACK and REACK flag states). I looked a bit deeper and, apart from some differences in implementation, this pattern is repeated across different families of microcontrollers. So why such a name for this function?

Best,
msemegen

2 REPLIES 2
Pavel A.
Evangelist III

This function is not related to "RX idle" or "receive timeout" feature. It just checks that the initialization of the UART is complete and it is ready to work. No idea why they named it so. See in the RM what exactly the TEACK and REACK flags mean.

 

 

 

Guenael Cadier
ST Employee

I confirm @Pavel A. statement. This function aims to check TEACK/REACK status in order to conclude initialisation is properly done. No link with Idle line detection on RX.
I acknowledge that function name might not be the most appropriate one.
Regards