blob: 70f4badaeb077bdb6a1468648d45544cdf3225e8 (
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
|
<table class="head">
<tr>
<td class="head-ltitle">TI_ADC(4)</td>
<td class="head-vol">Device Drivers Manual (arm)</td>
<td class="head-rtitle">TI_ADC(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">ti_adc</code> — <span class="Nd">TI AM3XXX
analog to digital converter 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 ti_adc</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">ti_adc</code> driver provides access to the
AIN (analog inputs) on am3xxx SoCs.</p>
<p class="Pp">It provides raw readings of the converted values for each analog
inputs.</p>
<p class="Pp">The access to <code class="Nm">ti_adc</code> data is made via the
<a class="Xr">sysctl(8)</a> interface:</p>
<div class="Bd Pp Li">
<pre>dev.ti_adc.0.%desc: TI ADC controller
dev.ti_adc.0.%driver: ti_adc
dev.ti_adc.0.%pnpinfo: name=adc@44E0D000 compat=ti,adc
dev.ti_adc.0.%parent: simplebus0
dev.ti_adc.0.clockdiv: 2400
dev.ti_adc.0.ain.0.enable: 0
dev.ti_adc.0.ain.0.open_delay: 0
dev.ti_adc.0.ain.0.samples_avg: 0
dev.ti_adc.0.ain.0.input: 0
dev.ti_adc.0.ain.1.enable: 0
dev.ti_adc.0.ain.1.open_delay: 0
dev.ti_adc.0.ain.1.samples_avg: 0
dev.ti_adc.0.ain.1.input: 0
dev.ti_adc.0.ain.2.enable: 0
dev.ti_adc.0.ain.2.open_delay: 0
dev.ti_adc.0.ain.2.samples_avg: 0
dev.ti_adc.0.ain.2.input: 0
dev.ti_adc.0.ain.3.enable: 0
dev.ti_adc.0.ain.3.open_delay: 0
dev.ti_adc.0.ain.3.samples_avg: 0
dev.ti_adc.0.ain.3.input: 0
dev.ti_adc.0.ain.4.enable: 0
dev.ti_adc.0.ain.4.open_delay: 0
dev.ti_adc.0.ain.4.samples_avg: 0
dev.ti_adc.0.ain.4.input: 0
dev.ti_adc.0.ain.5.enable: 0
dev.ti_adc.0.ain.5.open_delay: 0
dev.ti_adc.0.ain.5.samples_avg: 0
dev.ti_adc.0.ain.5.input: 0
dev.ti_adc.0.ain.6.enable: 1
dev.ti_adc.0.ain.6.open_delay: 0
dev.ti_adc.0.ain.6.samples_avg: 4
dev.ti_adc.0.ain.6.input: 2308
dev.ti_adc.0.ain.7.enable: 1
dev.ti_adc.0.ain.7.open_delay: 0
dev.ti_adc.0.ain.7.samples_avg: 0
dev.ti_adc.0.ain.7.input: 3812</pre>
</div>
<p class="Pp">On Beaglebone-black the analog input 7 is connected to the 3V3B
rail through a voltage divisor (2:1). The 3V3B voltage rail comes from the
TL5209 LDO regulator which is limited to 500mA maximum.</p>
<p class="Pp">Global settings:</p>
<dl class="Bl-tag">
<dt id="dev.ti_adc.0.clockdiv"><var class="Va">dev.ti_adc.0.clockdiv</var></dt>
<dd>Sets the ADC clock prescaler. The minimum value is 10 and the maximum is
65535. The ADC clock is based on CLK_M_OSC (24Mhz) / clockdiv. This gives
a maximum of ~2.4Mhz for the ADC clock and ~10Khz for the default setting
(clockdiv = 2400).</dd>
</dl>
<p class="Pp">Settings per input:</p>
<dl class="Bl-tag">
<dt id="dev.ti_adc.0.ain._d.enable"><var class="Va">dev.ti_adc.0.ain.%d.enable</var></dt>
<dd>Enable the conversion for the input. Each input should be individually
enabled before it can be used. When all the inputs are disabled, the ADC
is turned off.</dd>
<dt id="dev.ti_adc.0.ain._d.open_delay"><var class="Va">dev.ti_adc.0.ain.%d.open_delay</var></dt>
<dd>Sets the number of ADC clock cycles to wait after applying the input
configuration and before start the ADC conversion.</dd>
<dt id="dev.ti_adc.0.ain._d.samples_avg"><var class="Va">dev.ti_adc.0.ain.%d.samples_avg</var></dt>
<dd>Sets the number of samples average used on each input, it can be set to 0
(no samples average), 2, 4, 8, or 16.</dd>
<dt id="dev.ti_adc.0.ain._d.input"><var class="Va">dev.ti_adc.0.ain.%d.input</var></dt>
<dd>Is the converted raw value of the voltage applied on the analog input. It
is made of a 12 bit value (0 ~ 4095).</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">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">ti_adc</code> driver 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">The driver and this manual page was written by
<span class="An">Luiz Otavio O Souza</span>
<<a class="Mt" href="mailto:loos@FreeBSD.org">loos@FreeBSD.org</a>>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">June 1, 2014</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|