UART RX Interrupt timeout
Hi there!
I start to use a UART (RS485) with stm32g031f6 , and i use
HAL_UART_Transmit_IT
HAL_UART_Receive_IT
and both works. So now i want implemet an timeout on RX line. I saw the app note 3109 and i have a couple of question:
- if i use timer input capture thst wanna mean i "lose"" one pin of micro because i need the connect on rx line right ?
- I can use usart interrupt
My goal is use the second one the problem is i have an interrupt when i tx data and when i rx a data.
I read the data sheet and i know there is a ISR register and the bit RXNE:is set when the data is ready is coorect check if is set to one ? and is coorect do in this way USART2-> ISR & 0x20 ? and do in the interrupt UART ? or i need the check in the while loop ? and afther i receive a time out how i can reset the pointer use from the software for save the data in the array ?
Forgive me for this long question but i'm really soo confuse.
Thanks a lot
Sergio