Hello,
I have be fighting with this problem for the past two days. I wanted to interface my ldr circuit( a timer cirucit, whose output is a pulse with a dc shift 4v) with the lm3s811 evm using the Gpio pins. I have problem in accessing the voltage that has been write in the port pin.
First i enabled and configured the port pin as input using the following configuration fuctions, as
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
GPIOPinTypeGPIOInput(GPIO_PORTA_BASE, GPIO_PIN_0);
GPIODirModeSet(GPIO_PORTA_BASE, GPIO_PIN_0, GPIO_DIR_MODE_IN);
Is that above configuration correct, or should i use someother alternate fuctions? The problem now is, incase if the port pin cofiguration is correct, where does the voltage in the port pin gets stored, or can i simply used the port pin directly in the fuctions like "if", "while" as below?
while(GPIO_PORTA_BASE, GPIO_PIN_0= //reference voltage)
{
}
or if i want to use the state of the port pin in my program for subroutine execution, what should i do? I read through all the examples and the driverlib->gpio.c files and further i tried the stellarisware->inc->hw_gpio.h file, no use. there was no specific port configuration program that uses the external circuit configuration.
can anyone help me please,