2016-08-17 12:42 AM
Hi guys,
I am currently working on an library myself, and I like the way st is doing certain things, so I am ''lending'' myself ideas from the HAL. One thing in particular caught my eye, the callback implementation and it's registration. In my opinion the implementation is feasible, but I was wondering about one thing. If we look at the xx_hal_dma.c/h we can see the function ''HAL_DMA_RegisterCallback'' which is nice. We certainly expect to find such a function, because we know that the HAL uses callbacks a lot. Now, if we search for the mentioned function, we can't find any usage of it, instead the callbacks are set like this:/* Set the UART DMA transfer complete callback */
huart->hdmatx->XferCpltCallback = UART_DMATransmitCplt;
So now my curiosity kicks in, and my question is why doesn't st use the provided registering-function?
I need to say, I didn't check earlier versions of the HAL to see if the register-function is new.
I would like to know about your opinion on the matter. It could be as simple as the code didn't get updated yet, or maybe you can thing of a technical reason.
Best Regards
#callback #st #hal
2016-08-18 07:46 AM
Hi life_augmented.st,
A different question is asked about HAL_DMA_RegisterCallback in [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Need%20help%20understanding%20HAL_DMA_RegisterCallback%20function¤tviews=37]this discussion, but I provided there examples where it is used.You can refer to it.-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.