[Soekris] Soekris NET4501 I/O Connector
Brian Candler
B.Candler at pobox.com
Thu Nov 1 15:03:35 UTC 2007
On Wed, Oct 31, 2007 at 10:49:44PM +0100, Eternity wrote:
> I am running Linux on the NET4501. I want to be able to use the I/O
> Connector as input to get values from some external relays.
>
> Are there any driver or code example on how to read status on the I/O
> connector?
This code might give you a starting point:
http://lists.soekris.com/pipermail/soekris-tech/2003-February/001954.html
It configures the I/O pins as outputs and lets you set them as high/low.
However by reading the SC520 processor manual you may be able to work out
how to configure them as inputs and read them instead.
As a guess: setting the PIODIR bits to 0 instead of 1, and reading from the
PIODATA register rather than writing to it, may be all that's required.
> My hope was to be able to retrieve status from inside PHP code, to present
> it on a webpage.
The program linked above has to be run as root, but you could spawn it from
PHP. The result could be passed back via the program's exit code, or by
capturing its stdout.
HTH,
Brian.
More information about the Soekris-tech
mailing list