2021-12-09 02:51 AM
Hello,
I want to disable the uart rx interrupt during transmitting the data like the following flow.
Which HAL Library I could use for this process?
Thanks
2021-12-09 03:13 AM
Which STM32?
Assuming 'F4 (and probably good for most of other STM32 families):
https://github.com/STMicroelectronics/STM32CubeF4/blob/4aba24d78fef03d797a82b258f37dbc84728bbb5/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_usart.h#L418 with USART_IT_RXNE.
Note, that this will lead to Rx overflow, which may both trigger an error interrupt if enabled (USART_IT_ERR), and if unhandled, prevents further Rx. So that would need to be handled before turning to Rx again.
You may want, rather than disabling the Rx interrupt, disable Rx altogether, by clearing/setting USART_CR1.RE; while using direct access to registers this is only flipping one bit, there's probably no direct interface to this in Cube/HAL other than complete deinit/init.
JW