xref: /netbsd-src/share/man/man4/man4.sun3/leds.4 (revision ec184f3bfb1748cb9888890166d23cf91dc27cf8)
1.\"	$NetBSD: leds.4,v 1.14 2022/08/28 10:48:16 hgutch 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.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd March 2, 1996
31.Dt LEDS 4 sun3
32.Os
33.Sh NAME
34.Nm leds
35.Nd sun3 diagnostic Light Emitting Diodes driver
36.Sh SYNOPSIS
37.In machine/leds.h
38.Sh DESCRIPTION
39With the exception of the Sun 3/80, all sun3 machines are equipped
40a diagnostic display of eight Light Emitting Diodes (LEDs), located
41on the back of the system unit.
42The Sun 3/80 has a single LED, which is located on the front panel.
43.Pp
44The kernel changes the display during periods of idle processor activity
45according to a stored sequential pattern list.
46The
47.Pa /dev/leds
48interface provides a way of manipulating the pattern list via simple file I/O.
49.Pp
50The structure of the file is as follows:
51.Bd -literal
52struct led_patterns {
53        u_char divisor;
54        u_char patlen;
55        u_char pat[256];
56};
57.Ed
58.Bl -tag -width divisor
59.It Sy divisor
60The number of idle periods to wait before switching to the next pattern in
61the array.
62.It Sy patlen
63The number of patterns stored in the array.
64.It Sy pat
65The array of patterns to display.
66.El
67.Pp
68When a clock interrupt occurs while the processor is idle, a pattern
69countdown timer is decremented.
70When the countdown timer reaches zero
71it is reset with the
72.Sy divisor
73value and the next pattern in the array is selected and displayed.
74.Pp
75Each 8-bit pattern describes the state of the diagnostic LEDs.
76With the exception of the 3/80, a set bit in a pattern indicates that its
77corresponding LED should be extinguished,
78while a reset bit indicates an LED to be illuminated.
79On the 3/80 the polarity of the bits is reversed and only the lowest order bit
80is used.
81.Sh FILES
82.Bl -tag -width /dev/leds -compact
83.It Pa /dev/leds
84.El
85.Sh EXAMPLES
86The following example uses
87.Xr awk 1
88to display the repeating animation of a single lit LED scrolling from one end
89of the display to the other, using six clock ticks between each update.
90.Bd -ragged -offset indent
91# echo 5 8 254 253 251 247 239 223 191 127 |
92  awk '{ for (i=1;i<=NF;i++) printf("%c",$i+0); }' > /dev/leds
93.Ed
94.Sh ERRORS
95An I/O transfer to
96.Pa /dev/leds
97will complete successfully unless:
98.Bl -tag -width Er
99.It Bq Er EIO
100A read or write starting beyond the end of the file was attempted.
101.El
102.Sh SEE ALSO
103.Xr ppt 6
104.Sh HISTORY
105.Pa /dev/leds
106first appeared in
107.Nx 1.2 .
108