Re: Low-level help needed with leds

Abraham vd Merwe (abraham@2d3d.co.za)
Tue, 30 Oct 2001 14:54:30 +0200


--R3G7APHDIzY6R/pk
Content-Type: multipart/mixed; boundary="82I3+IH0IqGh5yIs"
Content-Disposition: inline

--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi david.heremans!

I browsed through linux/drivers/char/pc_keyb.c and linux/drivers/keyboard.c
and it doesn't seem like it's caching sets/gets. I quickly browsed through
your code, but I didn't really look for errors. Instead, I hacked a quick
program for you which does exactly what you want. I don't have an ipac, but
I tested it on my PC (just pressed the keys, etc.) and it should work. If it
doesn't you should check the datasheet and see whether there shouldn't be
any delays between settings the leds.

PS: The program is attached

> I'm writing to this maillinglist as a last resort, since reading books
> and other peoples code didn't solve my problem, and it is on the vague
> boundary of userspace/kernel.
>=20
> I recently got hold of a nice little piece of hardware that must be
> connected between the computer and the keyboard. You can program this
> device by sending it bytes trough the keyboard-leds.
> More about this device at http://www.andywarne.pwp.blueyonder.co.uk/,
> the device is called the I-Pac.
>=20
> The programming protocol description I got from the maker of this hardwar=
e states this
> sequence.
> 1. Set any led combination execpt all leds on.
> 2. Send five times all leds on.
> 3. The I-Pac will send a key-down code for the 'Y' (ready to program) or
> 'J' (jumper set to fixed) key.
>=20
> I don't get this key code back.
> I was wondering if I misunderstood the way the Linux kernel sends this
> LEDs commands. Does it send extra led commands that I don't know about?
> Maybe it doesn't send twice the same led formation since it would be a
> logical optimisation? Honestly, I'm completely clueless by now, and
> digging into the Linux source code is way to complicated for me, I
> honestly tried but got lost in it (tasklets et all) :-(
>=20
> I took the liberty of attaching a simplified version of
> my programming tool. If some of the more knowledgable people here could
> please help me out, thanks.
>=20
> Sincerely,
> David Heremans
>=20
> PS: I'm not subscribed to this list, I just scan the archieves and
> digests from time to time. So I you reply please put me in CC.
> PPS: When compiling the c program I also got redefine warnings in
> headers, sugestions to solve these are also welcomme, the include list I
> use is a mix of other example programs, so I'm not sure which are the
> exact ones to use.

> -rw-r--r-- david/david 3131 2001-10-16 09:47:33 console-lib-program-ip=
ac.inc
> -rw------- david/david 3491 2001-10-16 22:28:02 program-ipac.c

--=20

Regards
Abraham

Work is the crab grass in the lawn of life.
-- Schulz

__________________________________________________________
Abraham vd Merwe - 2d3D, Inc.

Device Driver Development, Outsourcing, Embedded Systems

Cell: +27 82 565 4451 Snailmail:
Tel: +27 21 761 7549 Block C, Antree Park
Fax: +27 21 761 7648 Doncaster Road
Email: abraham@2d3d.co.za Kenilworth, 7700
Http: http://www.2d3d.com South Africa

--82I3+IH0IqGh5yIs
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="ipac.tar.gz"
Content-Transfer-Encoding: base64

H4sIAL6h3jsAA+1Ye1MbNxDnX/QptoQkPuLzI8EwYwcaYkzixNiMDU3Tl0fodKDhfHLvZBOa
x2fvSndnn1/QtEMznd7O4JNW+9L+Vi/EkLLi2v1SqbRd2t2t4NfQ/Ddq7z7b2a08Le3s7KyV
yqVKeXcNKvccl6FRqGgAsBZIqW6Tu2v8P0pC4z+gwi+we/OBeCKu26vwr5R0bST4P3uG8uWd
UmUNSvcWUYr+5/iTB8Jn3sjh8Dy8CYtKDHjhcn+OKyRT3iJb3Qx5OMt2mT8vOfJFqJw5beUI
ucDyxPksT/FgIOScC0/4ow/FK2ORFLcIbEGrcQiBHCnh8xD7RUIQVCUYCF8Bk37Ydx3YA7tc
SwbYJYIe0jF3+h7+hVyh8kVYm2iOpXBADzFPhhxyFvlIAMBkAnKxzfzbw17jFL3nF01ZNS0f
a8fyyPu86EEOuT914EIuNw05GtsoOnxc1Fzp8Y18p989fNe1LHgOJYusw0eyvj7kQSADFNUa
ubR8Ir6B3tfX+QehINf4sXnaPzpots66Dc2Gz4nvhQm+iib4aMkMl/o3BnKJXux1IQ23B0JV
NDrJ//LEXQdCaasaS+yPqZdK4iqkYsFbY++lY18Z6Oek/N7ym+XlF6pgxBTEZRzXm+n51FtV
dFf8Zq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87rTfV0G7YR6nPp5FtlDGrcPx
YHQAD6JLO2qHpoOviaRPCApWpzo6Wfx3yBXi8fxm7lp4DqOBAwkPT7DkvZywyMRAdcYd4V7I
5wfT7uP8z7Gry0InJGrg2RQMwHanztf1sWfzmjnTj/C2gLhg9Vg1nJeGqG6BfXysWwYcS7fi
qsP25hHs70+MaR2fRxFNw9nMYeFZhETfalSVeJBHxmfMTZ38Bja6f4Gs1mGr+bJn5E2NaLFp
sWDvBSEGvIW5wdaX2FkcA1wMJK6OkQKqf7NjMqOMMsooo4wyyiijjDLKKKOMMsooo29HfwLt
ocPYACgAAA==

--82I3+IH0IqGh5yIs--

--R3G7APHDIzY6R/pk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE73qMGzNXhP0RCUqMRAvFqAKCJpcqHJUUa0ceVoD5fMJPbOcbAFACdH1W8
4UAIHsv4dXda1l5JW4Y4j/o=
=8ghM
-----END PGP SIGNATURE-----

--R3G7APHDIzY6R/pk--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/