Configure gpio for external interrupt issue- SN8000 evk

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi

I want to configure a gpio of SN8000 evk for external interrupt.I used the following code for this purpose (WICED SDK 2.4.1)

static void gpio_irq_handler( void* arg )

{

    UNUSED_PARAMETER(arg);

    if(EXTI_GetITStatus(EXTI_Line3) != RESET)

    {

        //Handle the interrupt

        EXTI_ClearITPendingBit(EXTI_Line3);

    }

}

void application_start( )

{

    wiced_init( );

    wiced_gpio_init(WICED_GPIO_4,INPUT_PULL_DOWN);   //WICED_GPIO_4 is A3

    gpio_irq_enable(GPIOA, 3, IRQ_TRIGGER_RISING_EDGE, gpio_irq_handler, 0);

    //custom_irq_pin_config();

    while(1);

}

I connected a MSP430 board which simulates HIGH->LOW and LOW->HIGH transitions to the ST17 (A3 as per schematics of SN8000 evk) and I was able to the interrupt is getting triggered for both Rising and Falling edge even-though I have configured it for Rising edge only (checked by putting a break point inside the ISR).

What might be causing this issue? How can I solve it?

Regards

Hariprasad C R

1 Solution

Hi,

What you are trying is already implemented in the SDK and you can take advantage of it. To setup and register GPIO events driver interrupt, there are several examples for the WICED SDK.

The ...\apps\demo\temp_control is released with SDK. You can find following sample in the forum: "push2scan" a new and simple snip that starts and stop WiFi scanning, Email State Changes Of Input (Push2Email) and Switching from WiFi Client To AP Mode.

Seyhan

View solution in original post

0 Likes
3 Replies
VikramR_26
Employee
Employee
25 sign-ins 10 sign-ins 10 comments on KBA

Hi Hari,

Want to make sure you have declared these accrodingly?

IRQ_TRIGGER_RISING_EDGE  = 0x1, /* Interrupt triggered at input signal's rising edge  */

IRQ_TRIGGER_FALLING_EDGE = 0x2, /* Interrupt triggered at input signal's falling edge */

thnx

vik86

0 Likes
Anonymous
Not applicable

Hi Vik,

Thanks for your reply,

When I click on go-to declaration of that IRQ_TRIGGER_RISING_EDGE ,it navigates to wiced_platform.h file and there I can see those declarations,

typedef enum

{

    IRQ_TRIGGER_RISING_EDGE  = 0x1, /* Interrupt triggered at input signal's rising edge  */

    IRQ_TRIGGER_FALLING_EDGE = 0x2, /* Interrupt triggered at input signal's falling edge */

    IRQ_TRIGGER_BOTH_EDGES   = IRQ_TRIGGER_RISING_EDGE | IRQ_TRIGGER_FALLING_EDGE,

} wiced_gpio_irq_trigger_t;

Then what else might be causing the issue?

Regards

HpC

0 Likes

Hi,

What you are trying is already implemented in the SDK and you can take advantage of it. To setup and register GPIO events driver interrupt, there are several examples for the WICED SDK.

The ...\apps\demo\temp_control is released with SDK. You can find following sample in the forum: "push2scan" a new and simple snip that starts and stop WiFi scanning, Email State Changes Of Input (Push2Email) and Switching from WiFi Client To AP Mode.

Seyhan

0 Likes