diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:59:05 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-25 19:59:05 -0400 |
| commit | 1f19f33e45791ea59aed048796fc68672c6723a5 (patch) | |
| tree | 54625fba89e91d1c2177801ec635e8528bba937f /static/netbsd/man4/gpioirq.4 4.html | |
| parent | ac5e55f5f2af5b92794c2aded46c6bae85b5f5ed (diff) | |
docs: Removed Precompiled HTML
Diffstat (limited to 'static/netbsd/man4/gpioirq.4 4.html')
| -rw-r--r-- | static/netbsd/man4/gpioirq.4 4.html | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/static/netbsd/man4/gpioirq.4 4.html b/static/netbsd/man4/gpioirq.4 4.html deleted file mode 100644 index 0989156c..00000000 --- a/static/netbsd/man4/gpioirq.4 4.html +++ /dev/null @@ -1,132 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">GPIOIRQ(4)</td> - <td class="head-vol">Device Drivers Manual</td> - <td class="head-rtitle">GPIOIRQ(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">gpioirq</code> — <span class="Nd">Install - an interrupt handler on GPIO pins</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<p class="Pp"><code class="Cd">gpioirq* at gpio? offset 0 mask 0x1 flag - 0x00</code></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">gpioirq</code> driver attaches an interrupt - handler to a one or more GPIO pins.</p> -<p class="Pp">The base pin number is specified in the kernel configuration file - with the <var class="Ar">offset</var> locator. The - <var class="Ar">mask</var> locator can be 0x01 or greater to indicate that - more pins should have an interrupt handler attached to them.</p> -<p class="Pp">The <var class="Ar">flag</var> locator specifies the interrupt - mode to use:</p> -<dl class="Bl-tag"> - <dt id="0x01"><a class="permalink" href="#0x01"><code class="Dv">0x01</code></a></dt> - <dd>Interrupt on the positive (rising) edge of the pin.</dd> - <dt id="0x02"><a class="permalink" href="#0x02"><code class="Dv">0x02</code></a></dt> - <dd>Interrupt on the negative (falling) edge of the pin.</dd> - <dt id="0x04"><a class="permalink" href="#0x04"><code class="Dv">0x04</code></a></dt> - <dd>Interrupt on both edges of the pin.</dd> - <dt id="0x08"><a class="permalink" href="#0x08"><code class="Dv">0x08</code></a></dt> - <dd>Assert the interrupt as long as the pin is high.</dd> - <dt id="0x10"><a class="permalink" href="#0x10"><code class="Dv">0x10</code></a></dt> - <dd>Assert the interrupt as long as the pin is low.</dd> -</dl> -<p class="Pp">Note that the interrupts modes are mutually-exclusive, and exactly - one interrupt mode must be specified. These flags correspond to the - <code class="Dv">GPIO_INTR</code> mode bits defined in - <span class="Pa">sys/gpio.h</span>. In addition to the interrupt mode, - setting <code class="Dv">0x1000</code> in <var class="Ar">flags</var> will - enable the printing of a message to the console whenever the interrupt - handler is called.</p> -<p class="Pp">The <var class="Ar">offset</var>, <var class="Ar">mask</var>, and - <var class="Ar">flag</var> locators can also be specified when - <code class="Nm">gpioirq</code> is attached at runtime using the - <code class="Dv">GPIOATTACH</code> <a class="Xr">ioctl(2)</a> on the - <a class="Xr">gpio(4)</a> device.</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>/dev/gpioirq<var class="Ar">u</var></dt> - <dd>GPIOIRQ device unit <var class="Ar">u</var> file. The output from this - device are three uint8_t bytes every time an interrupt fires. The bytes - contain the device unit, pin number and the current state of the pin.</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 will output the device unit, pin and the - pins current state for pins 4, 5, 6, 7, 8, 9, 10, 11, 12 on gpio0:</p> -<div class="Bd Pp Bd-indent Li"> -<pre>/etc/gpio.conf contains: -gpio0 attach gpioirq 4 0x1ff 0x04 - -or a kernel was compiled to have the same parameters. - -#!/usr/pkg/bin/perl - -$dev = "/dev/gpioirq0"; - -sysopen(DEV,$dev,O_RDONLY) || die "sysopen: $!"; - -while (sysread(DEV,$b,3)) { - @v = unpack("CCC",$b); - - print join(',',@v); - print "\n"; -} - -</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">gpio(4)</a>, <a class="Xr">drvctl(8)</a>, - <a class="Xr">gpioctl(8)</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">gpioirq</code> driver first appeared in - <span class="Ux">NetBSD 9.0</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp">The <code class="Nm">gpioirq</code> driver was written by - <span class="An">Brad Spencer</span> - <<a class="Mt" href="mailto:brad@anduin.eldar.org">brad@anduin.eldar.org</a>>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1> -<p class="Pp">When an interrupt fires in most devices there is not any - information carried along in the interrupt as to whether or not the pin is - high or low. Hence the driver reads the current state of the pin after the - interrupt has fired and it is possible that the state of the pin could have - changed between the time the interrupt fired and the reading of the state. - As a practical matter the only time the pin state will be reported wrong is - if there is a very large number of interrupts happening. The driver could - have made some assumptions if the interrupt was only for a rising edge or - falling edge as in those cases it would be possible to know what the pin - state would have been, but in the case of the double edge, there really will - not be any way to be sure with most hardware and, in any case, the - <a class="Xr">gpio(4)</a> infrastructure does not support getting at that - information even if it did exist.</p> -<p class="Pp">It is important that if the <a class="Xr">gpioirq(4)</a> device is - opened that it be read, as it may be possible to run the kernel out of - memory if the device is opened but not read and interrupts occur on a pin - tied to the driver.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">November 5, 2023</td> - <td class="foot-os">NetBSD 10.1</td> - </tr> -</table> |
