diff options
Diffstat (limited to 'static/freebsd/man4/led.4 4.html')
| -rw-r--r-- | static/freebsd/man4/led.4 4.html | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/static/freebsd/man4/led.4 4.html b/static/freebsd/man4/led.4 4.html new file mode 100644 index 00000000..65f29ef0 --- /dev/null +++ b/static/freebsd/man4/led.4 4.html @@ -0,0 +1,179 @@ +<table class="head"> + <tr> + <td class="head-ltitle">LED(4)</td> + <td class="head-vol">Device Drivers Manual</td> + <td class="head-rtitle">LED(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">led</code> — <span class="Nd">API for + manipulating LED's, lamps and other annunciators</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 + <<a class="In">dev/led/led.h</a>></code></p> +<p class="Pp"> + <br/> + <code class="Fd">typedef void led_t(void *priv, int onoff);</code></p> +<p class="Pp"><var class="Ft">struct cdev *</var> + <br/> + <code class="Fn">led_create_state</code>(<var class="Fa" style="white-space: nowrap;">led_t + *func</var>, <var class="Fa" style="white-space: nowrap;">void *priv</var>, + <var class="Fa" style="white-space: nowrap;">char const *name</var>, + <var class="Fa" style="white-space: nowrap;">int state</var>);</p> +<p class="Pp"><var class="Ft">struct cdev *</var> + <br/> + <code class="Fn">led_create</code>(<var class="Fa" style="white-space: nowrap;">led_t + *func</var>, <var class="Fa" style="white-space: nowrap;">void *priv</var>, + <var class="Fa" style="white-space: nowrap;">char const *name</var>);</p> +<p class="Pp"><var class="Ft">void</var> + <br/> + <code class="Fn">led_destroy</code>(<var class="Fa" style="white-space: nowrap;">struct + cdev *</var>);</p> +</section> +<section class="Sh"> +<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> +<p class="Pp">The <code class="Nm">led</code> driver provides generic support + for handling LEDs, lamps and other annunciators.</p> +<p class="Pp">The hardware driver must supply a function to turn the annunciator + on and off and the device <var class="Fa">name</var> of the annunciator + relative to <span class="Pa">/dev/led/</span>. The + <var class="Fa">priv</var> argument is passed back to this on/off function + and can be used however the hardware driver sees fit.</p> +<p class="Pp">The lamp can be controlled by opening and writing ASCII strings to + the <span class="Pa">/dev/led/bla</span> device.</p> +<p class="Pp">In the following, we will use this special notation to indicate + the resulting output of the annunciator:</p> +<p class="Pp"></p> +<div class="Bd-indent"> +<dl class="Bl-tag Bl-compact"> + <dt id="*"><a class="permalink" href="#*"><code class="Ic">*</code></a></dt> + <dd>The annunciator is on for 1/10th second.</dd> + <dt id="_"><a class="permalink" href="#_"><code class="Ic">_</code></a></dt> + <dd>The annunciator is off for 1/10th second.</dd> +</dl> +</div> +<p class="Pp">State can be set directly, and since the change happens + immediately, it is possible to flash the annunciator with very short periods + and synchronize it with program events. It should be noted that there is a + non-trivial overhead, so this may not be usable for benchmarking or + measuring short intervals.</p> +<p class="Pp"></p> +<div class="Bd-indent"> +<dl class="Bl-tag Bl-compact"> + <dt id="0"><a class="permalink" href="#0"><code class="Ic">0</code></a></dt> + <dd>Turn the annunciator off immediately.</dd> + <dt id="1"><a class="permalink" href="#1"><code class="Ic">1</code></a></dt> + <dd>Turn the annunciator on immediately.</dd> +</dl> +</div> +<p class="Pp">Flashing can be set with a given period. The pattern continues + endlessly.</p> +<p class="Pp"></p> +<div class="Bd-indent"> +<dl class="Bl-tag Bl-compact"> + <dt id="f"><a class="permalink" href="#f"><code class="Ic">f</code></a></dt> + <dd>_*</dd> + <dt id="f1"><a class="permalink" href="#f1"><code class="Ic">f1</code></a></dt> + <dd>_*</dd> + <dt id="f2"><a class="permalink" href="#f2"><code class="Ic">f2</code></a></dt> + <dd>__**</dd> + <dt id="f3"><a class="permalink" href="#f3"><code class="Ic">f3</code></a></dt> + <dd>___***</dd> + <dt>...</dt> + <dd style="width: auto;"> </dd> + <dt id="f9"><a class="permalink" href="#f9"><code class="Ic">f9</code></a></dt> + <dd>_________*********</dd> +</dl> +</div> +<p class="Pp">Three high-level commands are available:</p> +<div class="Bd-indent"> +<dl class="Bl-tag"> + <dt id="d_d"><a class="permalink" href="#d_d"><code class="Ic">d%d</code></a></dt> + <dd>Numbers. Each digit is blinked out at 1/10th second, zero as ten pulses. + Between digits a one second pause and after the last digit a two second + pause after which the sequence is repeated.</dd> + <dt id="s_s"><a class="permalink" href="#s_s"><code class="Ic">s%s</code></a></dt> + <dd>String. This gives full control over the annunciator. Letters + ‘<code class="Li">A</code>’ <span class="No">...</span> + ‘<code class="Li">J</code>’ turn the annunciator on for from + 1/10th to one full second. Letters + ‘<code class="Li">a</code>’ <span class="No">...</span> + ‘<code class="Li">j</code>’ turn the annunciator off for + 1/10th to one full second. Letters + ‘<code class="Li">u</code>’ and + ‘<code class="Li">U</code>’ turn the annunciator off and on + respectively when the next UTC second starts. Unless terminated with a + ‘<code class="Li">.</code>’, the sequence is immediately + repeated.</dd> + <dt id="m_s"><a class="permalink" href="#m_s"><code class="Ic">m%s</code></a></dt> + <dd>Morse. + <p class="Pp"></p> + <div class="Bd-indent"> + <dl class="Bl-tag Bl-compact"> + <dt>‘<code class="Li">.</code>’</dt> + <dd>becomes ‘<code class="Li">_*</code>’</dd> + <dt>‘<code class="Li">-</code>’</dt> + <dd>becomes ‘<code class="Li">_***</code>’</dd> + <dt>‘<code class="Li"> </code>’</dt> + <dd>becomes ‘<code class="Li">__</code>’</dd> + <dt>‘<code class="Li">\n</code>’</dt> + <dd>becomes ‘<code class="Li">____</code>’</dd> + </dl> + </div> + </dd> +</dl> +</div> +<p class="Pp">The sequence is repeated after a one second pause.</p> +</section> +<section class="Sh"> +<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1> +<dl class="Bl-tag"> + <dt><span class="Pa">/dev/led/*</span></dt> + <dd style="width: auto;"> </dd> +</dl> +</section> +<section class="Sh"> +<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> +<p class="Pp">A ‘<code class="Li">d12</code>’ flashes the lamp</p> +<p class="Pp"></p> +<div class="Bd + Bd-indent"><code class="Li">*__________*_*______________________________</code></div> +<p class="Pp">A ‘<code class="Li">sAaAbBa</code>’ flashes</p> +<p class="Pp"></p> +<div class="Bd Bd-indent"><code class="Li">*_*__**_</code></div> +<div class="Bd Pp Li"> +<pre>/usr/bin/morse -l "Soekris rocks" > /dev/led/error</pre> +</div> +</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">morse(6)</a></p> +</section> +<section class="Sh"> +<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> +<p class="Pp">The <code class="Nm">led</code> driver first appeared in + <span class="Ux">FreeBSD 5.2</span>.</p> +</section> +<section class="Sh"> +<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> +<p class="Pp">This software was written by <span class="An">Poul-Henning + Kamp</span> + <<a class="Mt" href="mailto:phk@FreeBSD.org">phk@FreeBSD.org</a>>.</p> +<p class="Pp">This manual page was written by <span class="An">Sergey A. + Osokin</span> + <<a class="Mt" href="mailto:osa@FreeBSD.org">osa@FreeBSD.org</a>> and + <span class="An">Poul-Henning Kamp</span> + <<a class="Mt" href="mailto:phk@FreeBSD.org">phk@FreeBSD.org</a>>.</p> +</section> +</div> +<table class="foot"> + <tr> + <td class="foot-date">April 24, 2007</td> + <td class="foot-os">FreeBSD 15.0</td> + </tr> +</table> |
