AnsweredAssumed Answered

STM32F4 Discovery Integrated LIS302DL Interrupt

Question asked by avon.giuseppe on Oct 22, 2013
Latest reply on Oct 22, 2013 by avon.giuseppe
Hi Everybody and thanks in advance for support.

I'm trying to rewrite code to read LIS302DL to handle/generate an interrupt every Data Ready Signal.

Here is my code

     RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE, ENABLE);
     RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);


     GPIO_InitTypeDef   GPIO_InitStructure;
     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
     GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
     GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
     GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
     GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;


     GPIO_Init(GPIOE, &GPIO_InitStructure);


     SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOE, EXTI_PinSource0);


     EXTI_InitTypeDef EXTI_InitStructure;


     EXTI_InitStructure.EXTI_Line = EXTI_Line0;
     EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
     EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
     EXTI_InitStructure.EXTI_LineCmd = ENABLE;
     EXTI_Init(&EXTI_InitStructure);


     NVIC_InitTypeDef   NVIC_InitStructure;
     NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;
     NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01;
     NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x01;
     NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
     NVIC_Init(&NVIC_InitStructure);

Interrupt is never generated. Any help?

Outcomes