HI,
I am writhing a code to read a gpio pins in lm4f series.for this i followed the procedure
Peripheral selection
setting as input pins
cofiguring
and reading.but it is not reading the port pin,i'm not getting where the actual problem is....................
void digitalinput()
{
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
ROM_GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
ROM_GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7,
GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
ROM_GPIOPinTypeGPIOInput(GPIO_PORTG_BASE, GPIO_PIN_1);
ROM_GPIOPadConfigSet(GPIO_PORTG_BASE,GPIO_PIN_1,
GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
}
void ReadDigitalInput1()
{
if(ROM_GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_4)==GPIO_PIN_4)
{
UARTSend((unsigned char *)"OFF", 3);
}
else
{
UARTSend((unsigned char *)"ON", 2);
}
}