cancel
Showing results for 
Search instead for 
Did you mean: 

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 method?

Kavin
Associate
 
2 REPLIES 2
KnarfB
Principal III

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

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 Venmo Up vote any posts that you find helpful, it shows what's working..