2023-04-17 04:25 AM
These functions above are are functional identical. And they are calling weak functions "(Base/IC)_MspInitCallback" and "HAL_TIM_(Base/IC)_MspInit". "HAL_TIM_Base_Init" is actually used in my generated code and the weak function is actually replaced with a generated one in "Core/Src/stm32f3xx_hal_msp.c".
As getting into STM32 and HAL is quite a task, these duplicated functions are annoying as ****. But maybe someone knows a good tutorial with some good insight? I havent came across a good source for this topic from STM...
2023-04-17 04:45 AM
Hello @Tobias Köhler
First let me thank you for posting.
The "HAL_TIM_IC_Init" and "HAL_TIM_Base_Init" functions are similar because they both initialize timers in the STM32 microcontroller, but they have different functionalities.
1- "HAL_TIM_IC_Init" initializes the input capture (IC) mode of a timer, which is used to capture the value of an external signal at a specific time.
2- "HAL_TIM_Base_Init" initializes the timer in base time base mode, which is used to generate periodic interruptions or trigger events at a fixed frequency.
The reason for having separate functions for these modes is to provide the user with a more efficient way to control timer modes. By separating the initialization functions, the user can choose the mode to initialize according to his specific needs, without having to include unnecessary code.
Thx
Ghofrane