xref: /netbsd-src/share/man/man4/man4.sun3/leds.4 (revision fdecd6a253f999ae92b139670d9e15cc9df4497c)
1.\"	$NetBSD: leds.4,v 1.1 1997/05/21 01:40:03 jeremy 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.1a
40.Sh NAME
41.Nm leds
42.Nd sun3 diagnostic LED(s)
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 3/80, all sun3 machines are equipped a diagnostic
51display of eight Light Emitting Diodes,
52located on the back of the system unit.
53The 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.Nm /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.  When the countdown timer reaches zero
81it is reset with the
82.Sy divisor
83value and the next pattern in the array is selected and displayed.
84.Pp
85Each 8-bit pattern describes the state of the diagnostic LEDs.
86With the exception of the 3/80, a set bit in a pattern indicates that its
87corresponding LED should be be extinguished,
88while a reset bit indicates an LED to be illuminated.
89On the 3/80 the polarity of the bits is reversed and only the lowest order bit
90is used.
91.Sh EXAMPLES
92The following example uses
93.Xr awk 1
94to display the repeating animation of a single lit LED scrolling from one end
95of the display to the other, using six clock ticks between each update.
96.Bd -ragged -offset -ident
97# echo 5 8 254 253 250 247 239 223 191 127 |
98  awk '{ for (i=1;i<=NF;i++) printf("%c",$i+0); }' > /dev/leds
99.Ed
100.Sh "ERRORS"
101An I/O transfer to
102.Nm /dev/leds
103will complete successfully unless:
104.Bl -tag -width Er
105.It Bq Er EIO
106A read or write starting beyond the end of the file was attempted.
107.El
108.Sh FILES
109.Bl -tag -width /dev/leds -compact
110.It Pa /dev/leds
111.El
112.Sh "SEE ALSO"
113.Xr ppt 6
114.Sh HISTORY
115.Nm /dev/leds
116appeared in post-1.1 NetBSD.
117