PWM, interrupt and call-back
Hello,
I am studyng (first time) PWM using a Nucleo_401RE, STMCubeIDE, and HAL drivers;
I write some example using interrupt TIM2 and its TIM2_CH1 and PA5 to control the green led LD2.
The counter count UP, in the TIM2_IRQHandler , for the moment , I do nothing.
The signal is correct, but I have some question about HAL_TIM_OC_Start_IT and HAL_TIM_PWM_Start_IT , the first is:
where read complete documents about this Hal functions?
The user manual UM1725 say:
HAL_TIM_PWM_Start_IT
Starts the PWM signal generation in interrupt mode. (Very interesting)
HAL_TIM_OC_Start_IT
Starts the TIM Output Compare signal generation in interrupt mode. (Ah! interesting)
Why I ask this?
I want use a call back due to the interrupt call;the STMCubeIDE in NVIC have only one kind of interrupt: TIM2 global interrupt
I SUPPOSE that some differernts call back are possible only in base of the type of ____start, but what?
The famous UM1725 say, for example:
HAL_TIM_PeriodElapsedCallback
Period elapsed callback in non blocking mode. (Very interesting ...)
In details:
I want have DIFFERENTS call back when counter reach CCR and when when counter reload from ARR (I SUPPOSE there are two different IRQ calls) ;
Or recognize the two moments.
I have tryed different combination of kind of ____start and kind of call back: No valid results.
Many thanks and excuse for my english, but after Brexit ...
Luciano