diff options
author | kstailey <kstailey@cvs.openbsd.org> | 1997-01-13 00:29:29 +0000 |
---|---|---|
committer | kstailey <kstailey@cvs.openbsd.org> | 1997-01-13 00:29:29 +0000 |
commit | 4ee7d65d63fd7c44c12e5fd045fde86b7ca648ef (patch) | |
tree | c4d333c0348e4eb1a5acc266988517619c2ce48c /share/man/man4/man4.sun3/leds.4 | |
parent | aa1d7761d73e912c4a251a0b59620889e8f157c7 (diff) |
back-panel LED control device derived from code by der Mouse
Diffstat (limited to 'share/man/man4/man4.sun3/leds.4')
-rw-r--r-- | share/man/man4/man4.sun3/leds.4 | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/share/man/man4/man4.sun3/leds.4 b/share/man/man4/man4.sun3/leds.4 new file mode 100644 index 00000000000..18002808525 --- /dev/null +++ b/share/man/man4/man4.sun3/leds.4 @@ -0,0 +1,59 @@ +.\" $OpenBSD: leds.4,v 1.1 1997/01/13 00:29:27 kstailey Exp $ +.\" +.Dd March 2, 1996 +.Dt LEDS 4 sun3 +.Os OpenBSD 2.0 +.Sh NAME +.Nm leds +.Nd back-panel LEDs +.Sh DESCRIPTION +The file +.Nm /dev/leds +is an interface to the diagnostic array of 8 light-emitting diodes on +the back of the computer. +.Pp +This file contains two +.Sy unsigned int Ns s +(in native byte order, as would be written by passing the address of an +.Sy unsigned int +to +.Xr write 2 , +which on a Sun-3 means big-endian), followed by a string of bytes. The +string of bytes gives the successive patterns to be displayed on the +LEDs; each byte's bits are taken and used to drive the LEDs. A 0 bit +illuminates the corresponding LED; a 1 bit leaves the corresponding LED +dark. The first +.Sy unsigned int +gives the number of clock ticks that are skipped after each pattern is +loaded before the next is loaded. For example, if this value is 0, a +new pattern is loaded each clock tick; if it is 3, a new pattern will +be loaded every fourth clock tick (ie, three ticks will be skipped +between loads). The second +.Sy unsigned int +gives the number of patterns in the list, that is, the number of bytes +following the two +.Sy unsigned int Ns s. +.Pp +There are limits on the two integer values; attempting a write that +would cause either of them to take on too large a value causes the +write to return EIO without affecting anything. The limits are +compiled into the kernel; as of this writing, the first one can be at +most 128, the second at most 10240. +.Sh EXAMPLES +This example displays a single lit LED scrolling from one end of the +display to the other, over and over, moving every six clock ticks. The +first eight bytes supply the two +.Sy unsigned int Ns s +mentioned above; the other eight specify the patterns. (Convert them +to binary, and remember that 0 bits mean lit LEDs.) +.Bd -ragged -offset -ident +# echo 0 0 0 5 0 0 0 8 254 253 250 247 239 223 175 127 | + awk '{ for (i=1;i<=NF;i++) printf("%c",$i+0); }' > /dev/leds +.Ed +.Sh FILES +.Bl -tag -width /dev/leds -compact +.It Pa /dev/leds +.El +.Sh HISTORY +.Nm /dev/leds +appeared in post-2.0 OpenBSD. |