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
|
<table class="head">
<tr>
<td class="head-ltitle">MCPGPIO(4)</td>
<td class="head-vol">Device Drivers Manual</td>
<td class="head-rtitle">MCPGPIO(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">mcpgpio</code> — <span class="Nd">Driver
for Microchip I/O Expanders on I2C and SPI bus</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<section class="Ss">
<h2 class="Ss" id="I2C"><a class="permalink" href="#I2C">I2C</a></h2>
<p class="Pp"><code class="Cd">mcpgpio* at iic? addr ?</code>
<br/>
<code class="Cd">gpio* at gpiobus?</code></p>
</section>
<section class="Ss">
<h2 class="Ss" id="SPI"><a class="permalink" href="#SPI">SPI</a></h2>
<p class="Pp"><code class="Cd">mcpgpio0 at spi? slave 0 flags 0</code>
<br/>
<code class="Cd">mcpgpio1 at spi? slave 0 flags 1</code>
<br/>
<code class="Cd">mcpgpio2 at spi? slave 0 flags 2</code>
<br/>
<code class="Cd">mcpgpio3 at spi? slave 0 flags 3</code>
<br/>
<code class="Cd">gpio* at gpiobus?</code></p>
</section>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">mcpgpio</code> driver supports the following
Microchip I/O Expanders:</p>
<dl class="Bl-tag">
<dt>MCP23008</dt>
<dd>8-bit I/O expander, I2C interface</dd>
<dt>MCP23S08</dt>
<dd>8-bit I/O expander, SPI interface</dd>
<dt>MCP23017</dt>
<dd>16-bit I/O expander, I2C interface</dd>
<dt>MCP23S17</dt>
<dd>16-bit I/O expander, SPI interface</dd>
<dt>MCP23018</dt>
<dd>16-bit I/O expander, open-drain outputs, I2C interface</dd>
<dt>MCP23S18</dt>
<dd>16-bit I/O expander, open-drain outputs, SPI interface</dd>
</dl>
<p class="Pp">Access to the pins is provided by the <a class="Xr">gpio(4)</a>
interface.</p>
<p class="Pp">The SPI version of these devices support multiple chips per chip
select signal. On the MCP23S08 and MCP23S17, this is achieved by tying the
address select pins to VDD or GND to select an address (0-3 on MCP23S08 or
0-7 on MCP23S17). The MCP23S18 has a similar capability, but uses an analog
voltage input on a single address select pin, along with an internal voltage
divider ladder and a series of comparators to generate the 3 address bits;
see the data sheet for details. The <var class="Ar">flags</var> argument in
the configuration directive for SPI attachments selects the hardware address
of the chip instance for that driver instance.</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">gpio(4)</a>, <a class="Xr">iic(4)</a>,
<a class="Xr">intro(4)</a>, <a class="Xr">spi(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">mcpgpio</code> driver first appeared in
<span class="Ux">NetBSD 7.0</span>. It was overhauled in
<span class="Ux">NetBSD 10.0</span> to support additional chip types and to
add the I2C attachment.</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">mcpgpio</code> driver was written by
<span class="An">Frank Kardel</span>
<<a class="Mt" href="mailto:kardel@NetBSD.org">kardel@NetBSD.org</a>>
and <span class="An">Jason R. Thorpe</span>
<<a class="Mt" href="mailto:thorpej@NetBSD.org">thorpej@NetBSD.org</a>>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
<p class="Pp">SPI instances of the <code class="Nm">mcpgpio</code> driver do not
utilize the Device Tree bindings for this device.</p>
<p class="Pp">The <code class="Nm">mcpgpio</code> driver does not currently act
as a GPIO provider for the platform device tree.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">January 10, 2022</td>
<td class="foot-os">NetBSD 10.1</td>
</tr>
</table>
|