summaryrefslogtreecommitdiff
path: root/static/netbsd/man4/man4.sun2/leds.4 3.html
blob: 34c499d1b5ec1c06b9f65669fb43fd20106c76c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<table class="head">
  <tr>
    <td class="head-ltitle">LEDS(4)</td>
    <td class="head-vol">Device Drivers Manual (sun2)</td>
    <td class="head-rtitle">LEDS(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">leds</code> &#x2014; <span class="Nd">sun2
    diagnostic Light Emitting Diodes driver</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
    &lt;<a class="In">machine/leds.h</a>&gt;</code></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">All sun2 machines are equipped a diagnostic display of eight Light
    Emitting Diodes (LEDs), located on either the front (deskside chassis) or
    the back (desktop machine) of the system unit.</p>
<p class="Pp">The kernel changes the display during periods of idle processor
    activity according to a stored sequential pattern list. The
    <span class="Pa">/dev/leds</span> interface provides a way of manipulating
    the pattern list via simple file I/O.</p>
<p class="Pp">The structure of the file is as follows:</p>
<div class="Bd Pp Li">
<pre>struct led_patterns {
        u_char divisor;
        u_char patlen;
        u_char pat[256];
};</pre>
</div>
<dl class="Bl-tag">
  <dt id="divisor"><a class="permalink" href="#divisor"><b class="Sy">divisor</b></a></dt>
  <dd>The number of idle periods to wait before switching to the next pattern in
      the array.</dd>
  <dt id="patlen"><a class="permalink" href="#patlen"><b class="Sy">patlen</b></a></dt>
  <dd>The number of patterns stored in the array.</dd>
  <dt id="pat"><a class="permalink" href="#pat"><b class="Sy">pat</b></a></dt>
  <dd>The array of patterns to display.</dd>
</dl>
<p class="Pp">When a clock interrupt occurs while the processor is idle, a
    pattern countdown timer is decremented. When the countdown timer reaches
    zero it is reset with the <b class="Sy">divisor</b> value and the next
    pattern in the array is selected and displayed.</p>
<p class="Pp">Each 8-bit pattern describes the state of the diagnostic LEDs. A
    set bit in a pattern indicates that its corresponding LED should be
    extinguished, while a reset bit indicates an LED to be illuminated.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
<dl class="Bl-tag Bl-compact">
  <dt><span class="Pa">/dev/leds</span></dt>
  <dd style="width: auto;">&#x00A0;</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">The following example uses <a class="Xr">awk(1)</a> to display the
    repeating animation of a single lit LED scrolling from one end of the
    display to the other, using six clock ticks between each update.</p>
<div class="Bd Pp Bd-indent"># echo 5 8 254 253 251 247 239 223 191 127 |
<br/>
 awk '{ for (i=1;i&lt;=NF;i++) printf(&quot;%c&quot;,$i+0); }' &gt;
  /dev/leds</div>
</section>
<section class="Sh">
<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
<p class="Pp">An I/O transfer to <span class="Pa">/dev/leds</span> will complete
    successfully unless:</p>
<dl class="Bl-tag">
  <dt id="EIO">[<a class="permalink" href="#EIO"><code class="Er">EIO</code></a>]</dt>
  <dd>A read or write starting beyond the end of the file was attempted.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">ppt(6)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp"><span class="Pa">/dev/leds</span> first appeared in
    <span class="Ux">NetBSD 1.2</span>.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">March 2, 1996</td>
    <td class="foot-os">NetBSD 10.1</td>
  </tr>
</table>