On Wed, Mar 16, 2011 at 12:04:06PM +0100, Dominique Goncalves wrote: > Hello, > > I would like to add a switch on/off on GPIO port (JP5 User I/O from > the soekris documentation) on my net4801 board to see its status (on > or off) in FreeBSD 8.2. > I've been reading the PC87366 datasheet and different source code > (OpenBSD and env4801.C) to understand the GPIO usage without success. > > Could someone point me to the right direction if possible with an > example ? (my knowledge in electronics and C code are basic.)
you can get sample schematics how to connect a button in google. for example: http://www.freewebs.com/maheshwankhede/ports.html basically you need a 10k resistor hooked to +5V and a button (: then gpioctl(8) is your friend. set pin as an input: # gpioctl -c <pin number> in read pin state: # gpioctl <pin number> cu -- paranoic mickey (my employers have changed but, the name has remained) _______________________________________________ Soekris-tech mailing list [email protected] http://lists.soekris.com/mailman/listinfo/soekris-tech
