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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
<table class="head">
<tr>
<td class="head-ltitle">PBIO(4)</td>
<td class="head-vol">Device Drivers Manual (i386)</td>
<td class="head-rtitle">PBIO(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">pbio</code> — <span class="Nd">8255
parallel peripheral interface basic I/O 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="Cd">device pbio</code></p>
<p class="Pp">In <span class="Pa">/boot/device.hints</span>:
<br/>
<code class="Cd">hint.pbio.0.at="isa"</code>
<br/>
<code class="Cd">hint.pbio.0.port="0x360"</code></p>
<p class="Pp">
<br/>
<code class="In">#include
<<a class="In">dev/pbio/pbioio.h</a>></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">pbio</code> driver supports direct access to
the Intel 8255A programmable peripheral interface (PPI) chip running in mode
0 (simple I/O). Such an interface provides 24 digital I/O lines. The driver
is designed for performing I/O under program control using peripherals such
as the Advantech PCL-724 card, which emulates the Intel 8255A PPI in mode 0.
Other 8255A-based peripherals such as the BMC Messsysteme PIO24II card have
also been reported to work.</p>
<p class="Pp">The PPI provides two 8-bit ports (port A and port B) and two 4-bit
ports (port C upper, port C lower). Each port can be individually programmed
for input and (latched) output, and appears at a different offset of the
device's base I/O address.</p>
<p class="Pp">A separate register allows the configuration of ports for input or
output. The device is so simple, that reliably probing for it when input
data arrives at its terminals is impossible; therefore the kernel
configuration has to specify the device's base address. The device driver
provides four character devices that correspond to the peripheral's I/O
ports. Opening a device for read or write automatically configures the
corresponding hardware port for input or output. At boot time all ports are
set configured for input to avoid damaging external circuitry.</p>
<p class="Pp">A set of <a class="Xr">ioctl(2)</a> requests allow polled input
and paced output to be efficiently performed at the driver level without
expensive user/kernel context switching. The driver can perform I/O in three
different ways:</p>
<dl class="Bl-tag">
<dt>Basic</dt>
<dd>The read or write operation returns immediately after reading or writing
the data to the port at bus speed.</dd>
<dt>Paced</dt>
<dd>Data is transferred from or to the port at intervals specified by a
separate <a class="Xr">ioctl(2)</a> call.</dd>
<dt>Differential</dt>
<dd>(Input only.) Only port values that differ from the previous port value
are returned.</dd>
</dl>
<p class="Pp" id="Hz">The pacing interval is specified in
<a class="permalink" href="#Hz"><i class="Em">Hz</i></a> unit increments.
Setting a pace of <var class="Ar">n</var> seconds will result in no more
than one value being read or written every <var class="Ar">n</var> seconds.
Single byte read/write operations will take at least <var class="Ar">n</var>
seconds to complete.</p>
<p class="Pp">The following <a class="Xr">ioctl(2)</a> calls are supported:</p>
<dl class="Bl-tag">
<dt id="PBIO_SETDIFF"><a class="permalink" href="#PBIO_SETDIFF"><code class="Dv">PBIO_SETDIFF</code></a></dt>
<dd>accepts a pointer to an integer as the third argument, and sets the driver
for differential input if the integer is non-zero. The input pace speed
determines the periodic interval the driver will use to examine the port
for a changed value.</dd>
<dt id="PBIO_GETDIFF"><a class="permalink" href="#PBIO_GETDIFF"><code class="Dv">PBIO_GETDIFF</code></a></dt>
<dd>accepts a pointer to an integer as the third argument, and sets the
integer to the last set value for differential input.</dd>
<dt id="PBIO_SETIPACE"><a class="permalink" href="#PBIO_SETIPACE"><code class="Dv">PBIO_SETIPACE</code></a></dt>
<dd>accepts a pointer to an integer as the third argument, and sets the
driver's input pacing speed to the value of that integer.</dd>
<dt id="PBIO_GETIPACE"><a class="permalink" href="#PBIO_GETIPACE"><code class="Dv">PBIO_GETIPACE</code></a></dt>
<dd>accepts a pointer to an integer as the third argument, and sets the
integer to the last set value for the input pace.</dd>
<dt id="PBIO_SETOPACE"><a class="permalink" href="#PBIO_SETOPACE"><code class="Dv">PBIO_SETOPACE</code></a></dt>
<dd>accepts a pointer to an integer as the third argument, and sets the
driver's output pacing speed to the value of that integer.</dd>
<dt id="PBIO_GETOPACE"><a class="permalink" href="#PBIO_GETOPACE"><code class="Dv">PBIO_GETOPACE</code></a></dt>
<dd>accepts a pointer to an integer as the third argument, and sets the
integer to the last set value for the output pace.</dd>
</dl>
</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/pbio0a</span></dt>
<dd>Port A (8 bit I/O).</dd>
<dt><span class="Pa">/dev/pbio0b</span></dt>
<dd>Port B (8 bit I/O).</dd>
<dt><span class="Pa">/dev/pbio0ch</span></dt>
<dd>Port C upper (4 bit I/O).</dd>
<dt><span class="Pa">/dev/pbio0cl</span></dt>
<dd>Port C lower (4 bit I/O).</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"><cite class="Rs"><span class="RsA">Diomidis Spinellis</span>,
<span class="RsT">The information furnace: Consolidated home control</span>,
<i class="RsJ">Personal and Ubiquitous Computing</i>,
<span class="RsN">1</span>, <span class="RsV">7</span>,
<span class="RsP">53-69</span>, <span class="RsD">2003</span>.</cite></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">pbio</code> device was first used under
<span class="Ux">FreeBSD 4.1</span>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp"><span class="An">Diomidis D. Spinellis</span>
<<a class="Mt" href="mailto:dds@aueb.gr">dds@aueb.gr</a>></p>
</section>
<section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
<p class="Pp">One of the PCL-724 card's inputs can optionally be wired to
generate an interrupt. This feature is not supported.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">January 14, 2005</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|