cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 - External interrupt PD4 (Only LL)

Pilous Droip
Senior
Posted on November 09, 2017 at 11:55

Hi friend.

I try create program working with external interrupt. And I have a problem. Interrupt never work....

int8_t InitPin(void)

{

LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOD);

LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG);

LL_GPIO_SetPinMode(GPIOD, LL_GPIO_PIN_4, LL_GPIO_MODE_INPUT);

LL_GPIO_SetPinPull(GPIOD, LL_GPIO_PIN_4, LL_GPIO_PULL_UP);

NVIC_EnableIRQ(EXTI4_IRQn);

SYSCFG->EXTICR[1] &= SYSCFG_EXTICR2_EXTI4_PD;

LL_EXTI_EnableFallingTrig_0_31(LL_EXTI_LINE_4);

LL_EXTI_EnableIT_0_31(LL_EXTI_LINE_4);

NVIC_SetPriority(EXTI4_IRQn,0);

NVIC_ClearPendingIRQ(EXTI4_IRQn);

NVIC_EnableIRQ(EXTI4_IRQn);

/* LED out PIN */

LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOD);

LL_GPIO_SetPinMode(GPIOD,LL_GPIO_PIN_14,LL_GPIO_MODE_OUTPUT);

return 0;

}

void EXTI4_IRQHandler (void)

{

LL_GPIO_TogglePin(GPIOD,LL_GPIO_PIN_14);

//LL_EXTI_ClearFlag_0_31(LL_EXTI_LINE_4);

NVIC_ClearPendingIRQ(EXTI4_IRQn);

}

Any idea, what is wrong??? Thank you

#stm32f407 #external-interrupt #ll-drivers
1 REPLY 1
Posted on November 09, 2017 at 12:30

https://community.st.com/0D70X000006SvjISAS

  ?

JW