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.

TMS320F280049: 280049 外部输入中断

Part Number: TMS320F280049

你好,我目前需要一个GPIO输入触发的中断用于硬件故障的检测,但是目前配置完无法触发  代码如下:

void HwErrIsr_Init(void)
{
// 设置输入限定模式
GPIO_setQualificationMode(28, GPIO_QUAL_ASYNC);
// 将GPIO引脚与XINT中断源关联
GPIO_setInterruptPin(28, GPIO_INT_XINT1);

// 设置中断触发类型
GPIO_setInterruptType(GPIO_INT_XINT1, GPIO_INT_TYPE_RISING_EDGE);

Interrupt_register(GPIO_INT_XINT1, &InPutHwErr_Isr);

// 启用中断
GPIO_enableInterrupt(GPIO_INT_XINT1);

}

__attribute__((interrupt)) void InPutHwErr_Isr (void)
{
EALLOW;
#if(TEST_OFF)
EPwm1Regs.AQCSFRC.bit.CSFA = 2; // PWM1A
EPwm1Regs.AQCSFRC.bit.CSFB = 2; // PWM1B
EPwm2Regs.AQCSFRC.bit.CSFA = 2; // PWM2A
EPwm2Regs.AQCSFRC.bit.CSFb = 2; // PWM2B

EPwm7Regs.AQCSFRC.bit.CSFA = 2; // PWM7A
EPwm7Regs.AQCSFRC.bit.CSFB = 2; // PWM7B
EPwm3Regs.AQCSFRC.bit.CSFA = 2; // PWM3A
EPwm3Regs.AQCSFRC.bit.CSFB = 2; // PWM3B
#else
HW_ERR_TEST ++;
EDIS;
#endif
}