xref: /netbsd-src/share/man/man4/man4.sun3/leds.4 (revision 93f9db1b75d415b78f73ed629beeb86235153473)
1.\"	$NetBSD: leds.4,v 1.3 1998/06/11 09:03:46 fair Exp $
2.\"
3.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by der Mouse and Jeremy Cooper.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd March 2, 1996
38.Dt LEDS 4 sun3
39.Os NetBSD 1.2
40.Sh NAME
41.Nm leds
42.Nd sun3 diagnostic Light Emitting Diodes driver
43.Sh SYNOPSIS
44.nf
45.ft B
46#include <machine/leds.h>
47.ft R
48.fi
49.Sh DESCRIPTION
50With the exception of the Sun 3/80, all sun3 machines are equipped
51a diagnostic display of eight Light Emitting Diodes (LEDs), located
52on the back of the system unit.
53The Sun 3/80 has a single LED, which is located on the front panel.
54.Pp
55The kernel changes the display during periods of idle processor activity
56according to a stored sequential pattern list.
57The
58.Pa /dev/leds
59interface provides a way of manipulating the pattern list via simple file I/O.
60.Pp
61The structure of the file is as follows:
62.Bd -literal
63struct led_patterns {
64        u_char divisor;
65        u_char patlen;
66        u_char pat[256];
67};
68.Ed
69.Bl -tag -width divisor
70.It Sy divisor
71The number of idle periods to wait before switching to the next pattern in
72the array.
73.It Sy patlen
74The number of patterns stored in the array.
75.It Sy pat
76The array of patterns to display.
77.El
78.Pp
79When a clock interrupt occurs while the processor is idle, a pattern
80countdown timer is decremented.
81When the countdown timer reaches zero
82it is reset with the
83.Sy divisor
84value and the next pattern in the array is selected and displayed.
85.Pp
86Each 8-bit pattern describes the state of the diagnostic LEDs.
87With the exception of the 3/80, a set bit in a pattern indicates that its
88corresponding LED should be be extinguished,
89while a reset bit indicates an LED to be illuminated.
90On the 3/80 the polarity of the bits is reversed and only the lowest order bit
91is used.
92.Sh EXAMPLES
93The following example uses
94.Xr awk 1
95to display the repeating animation of a single lit LED scrolling from one end
96of the display to the other, using six clock ticks between each update.
97.Bd -ragged -offset -ident
98# echo 5 8 254 253 250 247 239 223 191 127 |
99  awk '{ for (i=1;i<=NF;i++) printf("%c",$i+0); }' > /dev/leds
100.Ed
101.Sh "ERRORS"
102An I/O transfer to
103.Pa /dev/leds
104will complete successfully unless:
105.Bl -tag -width Er
106.It Bq Er EIO
107A read or write starting beyond the end of the file was attempted.
108.El
109.Sh FILES
110.Bl -tag -width /dev/leds -compact
111.It Pa /dev/leds
112.El
113.Sh "SEE ALSO"
114.Xr ppt 6
115.Sh HISTORY
116.Pa /dev/leds
117first appeared in
118.Nx 1.2 .
119