2021-11-09 06:38 AM
2021-11-09 07:03 AM
> __HAL_TIM_ENABLE_IT(INTERRUPT, HANDLE);
Parameters appear to be the other way round https://github.com/STMicroelectronics/STM32CubeL4/blob/5e1553e07706491bd11f4edd304e093b6e4b83a4/Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim.h#L1240 :
#define__HAL_TIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER |= (__INTERRUPT__))
i.e. this enables one particular source of interrupt in TIM, see TIMx_DIER register description in any TIM chapter of RM to your STM32.
There are several sources per timer, and while sometimes they have individual interrupts, in most timers they are simply ORed to one common interrupt; see the Interrupt chapter in RM to your STM32.
> HAL_NVIC_EnableIRQ(interrupt)
This is just a "decorated" Cube/HAL version of the CMSIS-standard NVIC_EnableIRQ(IRQn), i.e. function which enables one particular interrupt in NVIC. Read the NVIC chapter in Programming Manual to the core of your STM32.
JW
2021-11-09 07:03 AM
> __HAL_TIM_ENABLE_IT(INTERRUPT, HANDLE);
Parameters appear to be the other way round https://github.com/STMicroelectronics/STM32CubeL4/blob/5e1553e07706491bd11f4edd304e093b6e4b83a4/Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_tim.h#L1240 :
#define__HAL_TIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER |= (__INTERRUPT__))
i.e. this enables one particular source of interrupt in TIM, see TIMx_DIER register description in any TIM chapter of RM to your STM32.
There are several sources per timer, and while sometimes they have individual interrupts, in most timers they are simply ORed to one common interrupt; see the Interrupt chapter in RM to your STM32.
> HAL_NVIC_EnableIRQ(interrupt)
This is just a "decorated" Cube/HAL version of the CMSIS-standard NVIC_EnableIRQ(IRQn), i.e. function which enables one particular interrupt in NVIC. Read the NVIC chapter in Programming Manual to the core of your STM32.
JW