summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/gpioled.4 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man4/gpioled.4 3.html')
-rw-r--r--static/freebsd/man4/gpioled.4 3.html140
1 files changed, 140 insertions, 0 deletions
diff --git a/static/freebsd/man4/gpioled.4 3.html b/static/freebsd/man4/gpioled.4 3.html
new file mode 100644
index 00000000..9cf95ebd
--- /dev/null
+++ b/static/freebsd/man4/gpioled.4 3.html
@@ -0,0 +1,140 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">GPIOLED(4)</td>
+ <td class="head-vol">Device Drivers Manual</td>
+ <td class="head-rtitle">GPIOLED(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">gpioled</code> &#x2014; <span class="Nd">GPIO LED
+ generic device driver</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
+<p class="Pp">To compile this driver into the kernel, place the following lines
+ in your kernel configuration file:</p>
+<div class="Bd Pp Bd-indent"><code class="Cd">device gpio</code>
+<br/>
+<code class="Cd">device gpioled</code></div>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
+<p class="Pp">The <code class="Nm">gpioled</code> driver provides glue to attach
+ a <a class="Xr">led(4)</a> compatible device to a GPIO pin. Each LED in the
+ system has a <span class="Pa">name</span> which is used to export a device
+ as <span class="Pa">/dev/led/&lt;name&gt;</span>. The GPIO pin can then be
+ controlled by writing to this device as described in
+ <a class="Xr">led(4)</a>.</p>
+<p class="Pp">On a <a class="Xr">device.hints(5)</a> based system, like
+ <code class="Li">MIPS</code>, these values are configurable for
+ <code class="Nm">gpioled</code>:</p>
+<dl class="Bl-tag">
+ <dt id="hint.gpioled._d.at"><var class="Va">hint.gpioled.%d.at</var></dt>
+ <dd>The gpiobus you are attaching to. Normally assigned to gpiobus0.</dd>
+ <dt id="hint.gpioled._d.name"><var class="Va">hint.gpioled.%d.name</var></dt>
+ <dd>Arbitrary name of device in <span class="Pa">/dev/led/</span> to create
+ for <a class="Xr">led(4)</a>.</dd>
+ <dt id="hint.gpioled._d.pins"><var class="Va">hint.gpioled.%d.pins</var></dt>
+ <dd>Which pin on the GPIO interface to map to this instance. Please note that
+ this mask should only ever have one bit set (any other bits - i.e., pins -
+ will be ignored).</dd>
+ <dt id="hint.gpioled._d.invert"><var class="Va">hint.gpioled.%d.invert</var></dt>
+ <dd>Use pin inversion. If set to 1, the pin will be set to 0 to light the LED,
+ and 1 to clear it.</dd>
+ <dt id="hint.gpioled._d.invmode"><var class="Va">hint.gpioled.%d.invmode</var></dt>
+ <dd>Whether or not to use hardware support when pin inversion is requested.
+ Must be one of:
+ <dl class="Bl-tag">
+ <dt id="auto"><var class="Va">auto</var></dt>
+ <dd>Use hardware pin inversion if available, else fallback to software pin
+ inversion. This is the default.</dd>
+ <dt id="hw"><var class="Va">hw</var></dt>
+ <dd>Use hardware pin inversion.</dd>
+ <dt id="sw"><var class="Va">sw</var></dt>
+ <dd>Use software pin inversion.</dd>
+ </dl>
+ </dd>
+ <dt id="hint.gpioled._d.state"><var class="Va">hint.gpioled.%d.state</var></dt>
+ <dd>The initial state of the LED when the driver takes control over it. If set
+ to 1 or 0, the LED will be on or off correspondingly. If set to -1, the
+ LED will be kept in its original state.</dd>
+</dl>
+<p class="Pp">On a <a class="Xr">FDT(4)</a> based system, like
+ <code class="Li">ARM</code>, the DTS part for a
+ <code class="Nm">gpioled</code> device usually looks like:</p>
+<div class="Bd Pp Li">
+<pre>gpio: gpio {
+
+ gpio-controller;
+ ...
+
+ led0 {
+ compatible = &quot;gpioled&quot;;
+ gpios = &lt;&amp;gpio 16 2 0&gt;; /* GPIO pin 16. */
+ name = &quot;ok&quot;;
+ };
+
+ led1 {
+ compatible = &quot;gpioled&quot;;
+ gpios = &lt;&amp;gpio 17 2 0&gt;; /* GPIO pin 17. */
+ name = &quot;user-led1&quot;;
+ };
+};</pre>
+</div>
+<p class="Pp">Optionally, you can choose to combine all the LEDs under a single
+ &#x201C;gpio-leds&#x201D; compatible node:</p>
+<div class="Bd Pp Li">
+<pre>simplebus0 {
+
+ ...
+
+ leds {
+ compatible = &quot;gpio-leds&quot;;
+
+ led0 {
+ gpios = &lt;&amp;gpio 16 2 0&gt;;
+ name = &quot;ok&quot;
+ };
+
+ led1 {
+ gpios = &lt;&amp;gpio 17 2 0&gt;;
+ name = &quot;user-led1&quot;
+ };
+ };
+};</pre>
+</div>
+<p class="Pp">Both methods are equally supported and it is possible to have the
+ LEDs defined with any sort of mix between the methods. The only restriction
+ is that a GPIO pin cannot be mapped by two different (gpio)leds.</p>
+<p class="Pp">For more details about the <var class="Va">gpios</var> property,
+ please consult
+ <span class="Pa">/usr/src/sys/dts/bindings-gpio.txt</span>.</p>
+<p class="Pp">The property <var class="Va">name</var> is the arbitrary name of
+ the device in <span class="Pa">/dev/led/</span> to create for
+ <a class="Xr">led(4)</a>.</p>
+</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">fdt(4)</a>, <a class="Xr">gpio(4)</a>,
+ <a class="Xr">gpioiic(4)</a>, <a class="Xr">led(4)</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">gpioled</code> manual page first appeared in
+ <span class="Ux">FreeBSD 10.1</span>.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
+<p class="Pp">This manual page was written by <span class="An">Luiz Otavio O
+ Souza</span>.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">May 23, 2019</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>