cancel
Showing results for 
Search instead for 
Did you mean: 

I am not sure about the difference between the following two HAL_TIM_IC_Start(&htimX, TIM_CHANNEL_Y) HAL_TIM_IC_Start_IT(&htimX, TIM_CHANNEL_Y)

Najam
Associate II
 
5 REPLIES 5

Cube is open source, so you can look it up yourself. Also, functions in Cube have descriptions as comments before them. Also, the naming follows a convention described in each Cube's User Manual, e.g. for 'F4 in UM1725 (where the description of individual functions is repeated, too).

JW

Sarra.S
ST Employee

Hello @Najam​,

As you can see in any product HAL user manual or any CubeFW example;

HAL_TIM_IC_Start: Starts the TIM Input Capture measurement.

HAL_TIM_IC_Start_IT: Starts the TIM Input Capture measurement in interrupt mode.

if in your application, it is required to know when a PWM pulse starts or stops, the way to do it is by generating an interrupt by calling the IT version of the function.

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.

Najam
Associate II

I am still not able to understand the difference between "TIM Input Capture measurement". and "TIM Input Capture measurement in interrupt mode". I have not been able to find code examples.

The UM1758 document has one line definitions it does not explain, there is not detail.

The UM1758 (Description of STM32F0 HAL and low-layer drivers) document has one line definitions it does not explain. There is not description.

This answer was very helpful thanks.

Had I understood this from the documentation I would have not asked the question.

As I've said, Cube is open source, so you can compare the content of those two functions.

JW

PS. Here is an example using HAL_TIM_IC_Start_IT() - they may be more, I did not search thoroughly