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.

GPIO中断问题!!

Other Parts Discussed in Thread: TM4C1294NCPDT

我想实现监测一个端口的输入,当监测的上升沿信号时触发中断,可是却实现不出来,代码如下,感谢!!

#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/fpu.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"
#include "inc/tm4c1294ncpdt.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
#include "12864.h"

uint8_t ui8PinData=1;
volatile unsigned long long int clock;
int main(void)
{
SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
GPIODirModeSet(GPIO_PORTP_BASE, GPIO_PIN_4, GPIO_DIR_MODE_IN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP);
GPIOIntTypeSet(GPIO_PORTP_BASE, GPIO_PIN_4,GPIO_RISING_EDGE);
GPIOIntEnable(GPIO_PORTP_BASE, GPIO_PIN_4);
IntMasterEnable();
while(1){}
}
void GPIOPIntHandler(void)
{
clock=SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0|GPIO_PIN_1);
GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0|GPIO_PIN_1, ui8PinData);
delay(clock);
GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0|GPIO_PIN_1, 0x00);
}