Reading the button from the shell

Hi:
  I’m following the instructions at :
http://groups.google.com/group/beagleboard/msg/c623a16637625685?hl=en

to read a switch. However

cd /sys/class/gpio
echo 7 > export

doesn’t cause gpio7 to appear. What’s up?

--Mark

p.s. The LEDs blink fine.

Fri, 12 Mar 2010, Mark A. Yoder wrote:

cd /sys/class/gpio
echo 7 > export

doesn�t cause gpio7 to appear. What�s up?

GPIO 7 has been defined in beagle's board file in the kernel. See board-omap3beagle.c for more details.
GPIOs which are defined there cannot be exported to /sys/class/gpio. In this case you can use the user button with event interface,

Thanks for the quick response.

Can you point me to an example of reading the user button with the
event interface?

--Mark

Sat, 13 Mar 2010, Mark A. Yoder wrote:

Can you point me to an example of reading the user button with the
event interface?

One example:
  http://beagleboard.googlecode.com/files/evtest.c

A very simplified (and propably flawed) example:
  http://hervanta.com/~antti/temp/readkey.c.txt

Thanks again for the quick reply.

The code looks interesting, however I'm wanting to read the USER
button from the shell prompt via the /sys file system. I can blink
the LEDs that way, but I don't know how to read the button.

--Mark

Sat, 13 Mar 2010, Mark A. Yoder wrote:

The code looks interesting, however I'm wanting to read the USER
button from the shell prompt via the /sys file system. I can blink
the LEDs that way, but I don't know how to read the button.

At least one option is to remove the reference to GPIO 7 from the board file and then recompile kernel. That will let you use the /sys method.