2015-10-14 01:57 PM
I'm using the STM32F0308-DISCO board and want to have an interrupt generated on both edges of a PWM (generated by TIM15). Using STM32CubeMX, I found how to generate the TIM15_IRQHandler. Then, a search here showed a few examples that call the function TIM_GetITStatus() - but that's where I get lost.
Can someone point me to where that function is documented? (And what other functions might be relevant to a Timer interrupt?)Thanks!2015-10-14 02:23 PM
It's part of a different, older library, the SPL (Standard Peripheral Library), so download that one if you want to see its helpfile.
But it does not anything else than masking out individual bits from the status register, TIMx_SR, (if the respective interrupt has been enabled in TIMx_DIER): /** * @brief Checks whether the TIM interrupt has occurred or not. * @param TIMx: where x can be 1 to 14 to select the TIM peripheral. * @param TIM_IT: specifies the TIM interrupt source to check. * This parameter can be one of the following values: * @arg TIM_IT_Update: TIM update Interrupt source * @arg TIM_IT_CC1: TIM Capture Compare 1 Interrupt source * @arg TIM_IT_CC2: TIM Capture Compare 2 Interrupt source * @arg TIM_IT_CC3: TIM Capture Compare 3 Interrupt source * @arg TIM_IT_CC4: TIM Capture Compare 4 Interrupt source * @arg TIM_IT_COM: TIM Commutation Interrupt source * @arg TIM_IT_Trigger: TIM Trigger Interrupt source * @arg TIM_IT_Break: TIM Break Interrupt source * * @note TIM6 and TIM7 can generate only an update interrupt. * @note TIM_IT_COM and TIM_IT_Break are used only with TIM1 and TIM8. * * @retval The new state of the TIM_IT(SET or RESET). */ ITStatus TIM_GetITStatus(TIM_TypeDef* TIMx, uint16_t TIM_IT) { ITStatus bitstatus = RESET; uint16_t itstatus = 0x0, itenable = 0x0; /* Check the parameters */ assert_param(IS_TIM_ALL_PERIPH(TIMx)); assert_param(IS_TIM_GET_IT(TIM_IT)); itstatus = TIMx->SR & TIM_IT; itenable = TIMx->DIER & TIM_IT; if ((itstatus != (uint16_t)RESET) && (itenable != (uint16_t)RESET)) { bitstatus = SET; } else { bitstatus = RESET; } return bitstatus; } Its Cube counterpart is presumably __HAL_TIM_GET_FLAG() (but without the DIER-checking part):#define __HAL_TIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR &(__FLAG__)) == (__FLAG__))
I don't use Cube nor SPL. JW2015-10-14 02:33 PM
Thanks. So I guess I should have gone back a step and asked: ''Where can I find documentation for the Cube-generated IRQ Handlers?''
For the ''normal'' code that Cube generates, there's a PDF that documents all the functions you can call - but for the interrupt handlers, I've found nothing...