Subject: Re: LEDs, LCDs and so on (was Re: More SPARCbook insanity )
To: Jonathan Perkin <jonathan@perkin.org.uk>
From: Michael <macallan18@earthlink.net>
List: port-sparc
Date: 04/18/2005 07:50:29
--Signature_Mon__18_Apr_2005_07_50_29_-0400_52fU4QQmBggv+bf=
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

> > Hmm, we'd have to come up with a generic interface to CPU-controlled
> > LCDs, LEDs and do on found on various hardware - we don't want
> > anything Tadpole-specific in - say - sd...
>=20
> FreeBSD 5.2 has led(4) which may or may not be useful to you.

Having a look at it can't hurt :)
Wow, funky userland interface:

The lamp can be controlled by opening and writing ASCII strings to the /dev=
/led/bla device.
...
Three high-level commands are available:

           d%d     Numbers.  Each digit is blinked out at 1/10th second, ze=
ro
                   as ten pulses.  Between digits a one second pause and af=
ter
                   the last digit a two second pause after which the sequen=
ce
                   is repeated.

           s%s     String.  This gives full control over the annunciator.
                   Letters `A' ... `J' turn the annunciator on for from 1/1=
0th
                   to one full second.  Letters `a' ... `j' turn the annunc=
ia-
                   tor off for 1/10th to one full second.  Unless terminated
                   with a `.', the sequence is immediately repeated.

           m%s     Morse.

                         `.'     becomes `_*'
                         `-'     becomes `_***'
                         ` '     becomes `__'
                         `\n'    becomes `____'

     The sequence is repeated after a one second pause.

I didn't think about supporting morse code, but imagine a kernel panic on a=
 box without serial interface(s) or any other way to get a 2nd console, the=
 display taken over by XFree which decides to panic. Flashing the panic mes=
sage suddenly sounds like a good idea.
Not /quite/ what I was thinking about ( low-overhead but still generic inte=
rface for internal use by the kernel ) but why not give it a userland inter=
face too. We'd probably need a few ioctl()s to gather information about a g=
iven indicator, like type, label ( well, most of the time we /will/ know th=
e original purpose. Doesn't necessary mean we'd stick to it though ), statu=
s ( on/off, in use by some kernel driver or not... )
PCish Port 80 cards would also be something we could (ab)use, even on non-P=
C hardware.

have fun
Michael

--Signature_Mon__18_Apr_2005_07_50_29_-0400_52fU4QQmBggv+bf=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBQmOfBcpnzkX8Yg2nAQKm8gf+LCgNCmnh9itRL5/nxPB4EJKUtkth2Any
NFB606i3CylgS60nGPVZZdm5zdDHH49MRmF7WbMHYGH1PYWjl3lCd0V7YZKd/PfG
k270RArlpUqOfgGt93Un6avUt2nwAQ+ldF2MKOiichpNWmwQAwx/Fhqafz9ooNvN
VngtQp6F5ly+a+SzWJIFePFiN1oUhVY354UsERvsReltwXPjo3m3dSM+bwkumxh6
ghEJwrIHFUQvHMjkJhXzjwWKrrGZ6NalOp4ipvuxOFka9jKGstQL4xFv15vIB/b0
qd+jq/0dqD8aKdm3h/IeCoPVPPRW6NDAz0KO6mob9ae6mmUaRkZzUg==
=rGlj
-----END PGP SIGNATURE-----

--Signature_Mon__18_Apr_2005_07_50_29_-0400_52fU4QQmBggv+bf=--