2024-05-28 01:49 PM
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
2024-05-28 04:38 PM - edited 2024-05-28 04:41 PM
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.
2024-05-29 05:15 AM
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