How to disable a STM32 UART interrupt?
I know one can enable a UART receive interrupt using
HAL_UART_Receive_IT(&huart2, (uint8_t *)rx_buffer, expectedNumberOfBytes)
- But once started how does one stop it, "manually"?
We can disable the UART interrupt using HAL_NVIC_EnableIRQ . This will prevent it from raising an interrupt, but the state set by the function HAL_UART_Receive_IT which is HAL_UART_STATE_BUSY_RX need to be set back to HAL_UART_STATE_READY for the
UART handle to go back to a state that can accept a new HAL_UART_Receive_ITs.
Question
How to reset the state of the UART interrupt if we wish to disable a Rx interrupt after some time.
