blob: 5c0ee74f090c400506913b2fe114f07341af4d06 (
plain)
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
137
138
139
|
<table class="head">
<tr>
<td class="head-ltitle">MCP3KADC(4)</td>
<td class="head-vol">Device Drivers Manual</td>
<td class="head-rtitle">MCP3KADC(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">mcp3kadc</code> —
<span class="Nd">Microchip 3x0x SAR analog to digital converter</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">mcp3kadc* at spi? slave ? flags N</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">mcp3kadc</code> driver reports the current
voltage on the chip's ADC channels through the <a class="Xr">envsys(4)</a>
API. The driver calculates these values according to the currently selected
reference voltage (<code class="Li">Vref</code>). It can be changed through
the <a class="Xr">sysctl(8)</a> node
<code class="Li">hw.mcp3kadc0.vref</code>.</p>
<p class="Pp">The following table shows the supported chips. The type of the
chip can be selected with the <var class="Ar">flags</var> argument in the
config file.</p>
<table class="Bl-column Bd-indent">
<tr id="Designation">
<td><a class="permalink" href="#Designation"><b class="Sy">Designation</b></a></td>
<td><a class="permalink" href="#Resolution"><b class="Sy" id="Resolution">Resolution</b></a></td>
<td><a class="permalink" href="#Input"><b class="Sy" id="Input">Input
Channels</b></a></td>
<td><a class="permalink" href="#flags"><b class="Sy" id="flags">flags</b></a></td>
</tr>
<tr id="MCP3001">
<td><a class="permalink" href="#MCP3001"><code class="Li">MCP3001</code></a></td>
<td>10 bits</td>
<td>1</td>
<td>0</td>
</tr>
<tr id="MCP3002">
<td><a class="permalink" href="#MCP3002"><code class="Li">MCP3002</code></a></td>
<td>10 bits</td>
<td>2</td>
<td>1</td>
</tr>
<tr id="MCP3004">
<td><a class="permalink" href="#MCP3004"><code class="Li">MCP3004</code></a></td>
<td>10 bits</td>
<td>4</td>
<td>2</td>
</tr>
<tr id="MCP3008">
<td><a class="permalink" href="#MCP3008"><code class="Li">MCP3008</code></a></td>
<td>10 bits</td>
<td>8</td>
<td>3</td>
</tr>
<tr id="MCP3201">
<td><a class="permalink" href="#MCP3201"><code class="Li">MCP3201</code></a></td>
<td>12 bits</td>
<td>1</td>
<td>4</td>
</tr>
<tr id="MCP3202">
<td><a class="permalink" href="#MCP3202"><code class="Li">MCP3202</code></a></td>
<td>12 bits</td>
<td>2</td>
<td>5</td>
</tr>
<tr id="MCP3204">
<td><a class="permalink" href="#MCP3204"><code class="Li">MCP3204</code></a></td>
<td>12 bits</td>
<td>4</td>
<td>6</td>
</tr>
<tr id="MCP3208">
<td><a class="permalink" href="#MCP3208"><code class="Li">MCP3208</code></a></td>
<td>12 bits</td>
<td>8</td>
<td>7</td>
</tr>
<tr id="MCP3301">
<td><a class="permalink" href="#MCP3301"><code class="Li">MCP3301</code></a></td>
<td>13 bits</td>
<td>1</td>
<td>8</td>
</tr>
<tr id="MCP3302">
<td><a class="permalink" href="#MCP3302"><code class="Li">MCP3302</code></a></td>
<td>13 bits</td>
<td>4</td>
<td>9</td>
</tr>
<tr id="MCP3304">
<td><a class="permalink" href="#MCP3304"><code class="Li">MCP3304</code></a></td>
<td>13 bits</td>
<td>8</td>
<td>10</td>
</tr>
</table>
</section>
<section class="Sh">
<h1 class="Sh" id="SYSCTL_VARIABLES"><a class="permalink" href="#SYSCTL_VARIABLES">SYSCTL
VARIABLES</a></h1>
<p class="Pp">The following <a class="Xr">sysctl(3)</a> variables are
provided:</p>
<dl class="Bl-tag">
<dt>hw.mcp3kadc0.vref</dt>
<dd>Defines the reference voltage on the chip's <code class="Li">Vref</code>
pin in millivolts (mV). It defaults to the ADC's maximum output value + 1
in millivolts (e.g., 4096 for a 12-bit ADC).</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"><a class="Xr">envsys(4)</a>, <a class="Xr">spi(4)</a>,
<a class="Xr">sysctl(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">mcp3kadc</code> driver first appeared in
<span class="Ux">NetBSD 8.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">mcp3kadc</code> driver was written by
<span class="An">Frank Wille</span>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">August 18, 2015</td>
<td class="foot-os">NetBSD 10.1</td>
</tr>
</table>
|