我用lm3s2412 Portc,PortD口检测外部的开关量,输入上拉到3.3v,初始化都一样GPIOPinTypeGPIOInput,物理连接也没问题,但是Portc检测的高低电平都正常PortD读到的数据一直是0,请问这是怎么回事?
我用lm3s2412 Portc,PortD口检测外部的开关量,输入上拉到3.3v,初始化都一样GPIOPinTypeGPIOInput,物理连接也没问题,但是Portc检测的高低电平都正常PortD读到的数据一直是0,请问这是怎么回事?
请问初始化流程如何。
下面是一个参考。
//
// Enable the peripherals used by this application.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
//
// Configure the push button as an input and enable the pin to interrupt on
// the falling edge (i.e. when the push button is pressed).
//
ROM_GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_7);
ROM_GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_STRENGTH_2MA,
GPIO_PIN_TYPE_STD_WPU);
ROM_GPIOIntTypeSet(GPIO_PORTB_BASE, GPIO_PIN_7, GPIO_FALLING_EDGE);
ROM_GPIOPinIntEnable(GPIO_PORTB_BASE, GPIO_PIN_7);
ROM_IntEnable(INT_GPIOB);