1 .\" Copyright (c) 2003 Sergey A. Osokin <osa@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd API for manipulating LED's, lamps and other annunciators
36 .Fd "typedef void led_t(void *priv, int onoff);"
38 .Fn led_create "led_t *func" "void *priv" "char const *name"
40 .Fn led_destroy "struct cdev *"
44 driver provides generic support for handling LEDs, lamps and other
47 The hardware driver must supply a function to turn the annunciator on and off
50 of the annunciator relative to
54 argument is passed back to this on/off function and can be used however
55 the hardware driver sees fit.
57 The lamp can be controlled by opening and writing
63 In the following, we will use this special notation to indicate the resulting
64 output of the annunciator:
66 .Bl -tag -width indent -offset indent -compact
68 The annunciator is on for 1/10th second.
70 The annunciator is off for 1/10th second.
73 State can be set directly, and since the change happens immediately,
74 it is possible to flash the annunciator with very short periods and
75 synchronize it with program events.
76 It should be noted that there is a non-trivial overhead, so this may
77 not be usable for benchmarking or measuring short intervals.
79 .Bl -tag -width indent -offset indent -compact
81 Turn the annunciator off immediately.
83 Turn the annunciator on immediately.
86 Flashing can be set with a given period.
87 The pattern continues endlessly.
89 .Bl -tag -width indent -offset indent -compact
103 Three high-level commands are available:
104 .Bl -tag -width indent -offset indent
107 Each digit is blinked out at 1/10th second, zero as ten pulses.
108 Between digits a one second pause and after the last
109 digit a two second pause after which the sequence is repeated.
112 This gives full control over the annunciator.
117 turn the annunciator on for from 1/10th to one full
123 turn the annunciator off for 1/10th
129 turn the annunciator off and on respectively when the next
131 Unless terminated with a
133 the sequence is immediately repeated.
137 .Bl -tag -width indent -offset indent -compact
153 The sequence is repeated after a one second pause.
155 .Bl -tag -width ".Pa /dev/led/*"
163 .Dl *__________*_*______________________________
172 /usr/games/morse -l "Soekris rocks" > /dev/led/error
179 driver first appeared in
183 This software was written by
184 .An Poul-Henning Kamp
185 .Aq phk@FreeBSD.org .
187 This manual page was written by
191 .An Poul-Henning Kamp
192 .Aq phk@FreeBSD.org .