28335,中断在gpio0-7上可以实现,在14,15上不能实现,求解。
代码如下:
PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
PieCtrlRegs.PIEIER1.bit.INTx4 = 1;
PieCtrlRegs.PIEIER1.bit.INTx5 = 1;
IER |= M_INT1;
EINT;
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO0 = 0;
GpioCtrlRegs.GPAQSEL1.bit.GPIO0 = 0;
GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO1 = 0;
GpioCtrlRegs.GPAQSEL1.bit.GPIO1 = 0;
GpioCtrlRegs.GPACTRL.bit.QUALPRD0 = 0x02;
EDIS;
// GPIO0 is XINT1, GPIO1 is XINT2
EALLOW;
GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 0;
GpioIntRegs.GPIOXINT2SEL.bit.GPIOSEL = 1;
EDIS;
// Configure XINT1
XIntruptRegs.XINT1CR.bit.POLARITY = 1;
XIntruptRegs.XINT2CR.bit.POLARITY = 1;
// Enable XINT1 and XINT2
XIntruptRegs.XINT1CR.bit.ENABLE = 1;
XIntruptRegs.XINT2CR.bit.ENABLE = 1;
在gpio0、1上可以实现;
PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
PieCtrlRegs.PIEIER1.bit.INTx4 = 1;
PieCtrlRegs.PIEIER1.bit.INTx5 = 1;
IER |= M_INT1;
EINT;
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO14 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO14 = 0;
GpioCtrlRegs.GPAQSEL1.bit.GPIO14 = 0;
GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO15 = 0;
GpioCtrlRegs.GPAQSEL1.bit.GPIO15 = 0;
GpioCtrlRegs.GPACTRL.bit.QUALPRD1 = 0x02;
EDIS;
// GPIO0 is XINT1, GPIO1 is XINT2
EALLOW;
GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 14;
GpioIntRegs.GPIOXINT2SEL.bit.GPIOSEL = 15;
EDIS;
// Configure XINT1
XIntruptRegs.XINT1CR.bit.POLARITY = 1;
XIntruptRegs.XINT2CR.bit.POLARITY = 1;
// Enable XINT1 and XINT2
XIntruptRegs.XINT1CR.bit.ENABLE = 1;
XIntruptRegs.XINT2CR.bit.ENABLE = 1;
在gpio14、15上不能进中断,求各位大神指点! |