This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/MSP432P4111:为什么 GPIO 中断无法转至 P2.4上的回调功能?

Guru**** 2526840 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/842221/ccs-msp432p4111-why-the-gpio-interrupt-can-not-goto-the-callback-function-on-p2-4

器件型号:MSP432P4111

工具/软件:Code Composer Studio

你(们)好。

我在带有 RTOS 的 P2.4上有一个 GPIO 中断、代码是:

{
…
…
GPIO_setConfig (P_GPIO_P2_4、GPIO_CFG_IN_pu | GPIO_CFG_IN_INT_FALLING);
//安装按钮回调*/
GPIO_setCallback (P_GPIO_P2_4、gpioFpgaFxn0);
//启用中断*/
GPIO_enableInt (P_GPIO_设置 回








调4);*//开始回调*(*);* BIOS 回读*******/回调函数*。
*/
void gpioFpgaFxn0 (uint_least8_t index)
{
Semaphore_post (semaphore_handle (&FPGA_spiTaskAlert));
} 

我看到 REG:

它的 P2IFG = 0x10、P2IV = P2IFG4。

但代码无法转至回调函数......

我接下来应该怎么做?  

非常感谢。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Andoon、您好!

    您是否看过 SDK 中的 gpiointerrupt 示例? 如果没有、我将从以下位置开始: http://dev.ti.com/tirex/explore/node?node=AMCIoqQ1EBk6pk.C5GpxzA__z-lQYNj__LATEST 

    通常建议在 RTOS 启动之前不要使用任何 TI 驱动程序 API 调用、因此我建议将您的 GPIO API 调用移至任务。  

    谢谢、

    Alexis

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    Alexis。

    感谢您的建议。

    我找到了问题。

    当您将引脚定义为输入中断功能时、您必须注意到三个错误。

    在 MSP_EXP432P4111.h 中枚举 GPIO 名称您最好先放置中断引脚。

    我们   都知道 MSP_EXP432P4111.c 中的引脚配置数组。

    这是重要的事情。

    引脚配置的顺序必须与 MSP_EXP432P4111.h 中定义的顺序一致


    就这些。

    非常感谢。