Where can I read more about the syntax of callback function (or just about any function)?
I have been trying to learn the STM32 for the past week. As someone started with Arduino, this is quite frankly overwhelming to me.
Anyways, what I couldn't wrap my head around is where do people find all the reference for the callback function.
I'm currently follow the book Mastering STM32. It seems like after generate the skeleton code from CubeMx, the author write some callback function in the main() and for some reason, these function will just be used when an event happened. Can someone explain to me why in layman terms?
Another section of STM32 I felt quite overwhelming is the Timers. I'm working through the Input Capture function of a General Purpose Timer. I (think) I understand the gist of it. And as a way for me to evaluate my knowledge, I would like to measure the frequency of a square wave signal generated from a signal generator. However, different tutorial are using different way (for example the Mastering STM32 are using DMA, which added another level of complexity) and I just couldn't really understand why so and so.
My current understanding is if we enable one of the timer's channel (let's say channel 1), and enable the interrupt in NVIC settings, we can detect the rising edge of each pulse to calculate the period T of the signal. But how do we actually do so, in term of coding? Does the timer call a callback function (I'm guessing in this case HAL_TIM_IC_CaptureCallback) everytime an edge is detect? Can someone explain this concept to me?
Thank you so much!
