Skip to main content
Kavin
Visitor II
May 7, 2023
Question

I working on a project, that uses UART transmission, So as I am using stm32 MCU, And I am using receive call back function successfully by interrupt method, But i want to know, Can we use user-defined receive call-back function with an interrupt met

  • May 7, 2023
  • 2 replies
  • 749 views

..

This topic has been closed for replies.

2 replies

KnarfB
Super User
May 7, 2023

Yes, that's the way to do. If you work with HAL, you define your own HAL_UART_RxCpltCallback which overrides the weak "do nothing" callback in HAL. Alternatively, you find the native interrupt handlers like USART2_IRQHandler in a generated *_it.c file.

hth

KnarfB

Tesla DeLorean
Guru
May 7, 2023

You have ALL the source, you can implement it any way you want.

Most STM32 interrupt on every received character.

You don't need to call into the HAL call-back mechanics.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..