嵌入式爱好者

查看: 2720|回复: 3

[硬件咨询] 中断函数GPIO1_Combined_16_31_IRQHandler不会进入

[复制链接]

1

主题

1

帖子

8

积分

i.MX RT通行证

扫一扫,手机访问本帖
发表于 2023-1-10 16:13:48 | 显示全部楼层 |阅读模式
我选取GPIO1.24(H13)和GPIO1.25(M13)来进行测试,不会进入中断,帮我看看是哪里的问题。我用GPIO1.3(G11)也都没问题的。我是在GPIO口的中断例程中更改的。


配置:
  IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_03_GPIO1_IO03, 0U);
// IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_08_GPIO1_IO24, 0U);  /* GPIO_AD_B1_08(H13) is configured as 输入中断 */
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_09_GPIO1_IO25, 0U);



main.c文件中:


这个0-15的中断可以进入
void GPIO1_Combined_0_15_IRQHandler(void)
{

    /* clear the interrupt status */

    GPIO_PortClearInterruptFlags(GPIO1, 1U << 3);

    /* Change state of switch. */

    g_InputSignal = true;

    /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping

      exception return operation might vector to incorrect interrupt */

#if defined __CORTEX_M && (__CORTEX_M == 4U)

    __DSB();

#endif

}






这个中断一直不会进来
void GPIO1_Combined_16_31_IRQHandler(void)
{

    /* clear the interrupt status */

    GPIO_PortClearInterruptFlags(GPIO1, 1U << 25);

    /* Change state of switch. */

    g_InputSignal = true;

    /* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping

      exception return operation might vector to incorrect interrupt */

#if defined __CORTEX_M && (__CORTEX_M == 4U)

    __DSB();

#endif

}





主函数中的初始化:
/* Define the init structure for the input switch pin */
    gpio_pin_config_t sw_config = {

        kGPIO_DigitalInput,

        0,

        kGPIO_IntRisingEdge,

    };
    /* Init input switch GPIO. */
    EnableIRQ(EXAMPLE_SW_IRQ);

    GPIO_PinInit(EXAMPLE_SW_GPIO, EXAMPLE_SW_GPIO_PIN, &sw_config);


    /* Enable GPIO pin interrupt */

    GPIO_PortEnableInterrupts(EXAMPLE_SW_GPIO, 1U << EXAMPLE_SW_GPIO_PIN);//这里是GPIO1.3


    /* Init input switch GPIO. */

    EnableIRQ(GPIO1_Combined_0_15_IRQn);

    GPIO_PinInit(GPIO1, 3U, &sw_config);


    /* Enable GPIO pin interrupt */

    GPIO_PortEnableInterrupts(GPIO1, 1U << 3);


    /* Init input switch GPIO. */

    EnableIRQ(GPIO1_Combined_16_31_IRQn);

    GPIO_PinInit(GPIO1, 25U, &sw_config);


    /* Enable GPIO pin interrupt */

    GPIO_PortEnableInterrupts(GPIO1, 1U << 25);


有人用过这个GPIO1的16-31中断的吗?帮我看看问题出在哪里,我用相同的方式GPIO1的0-15的可以触发


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-4-26 15:25

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表