← Documents Documentation/iio/iio_adc.rst GitHub 원문 ↗

Linux 6.18.37 · IIO

IIO Abstractions for ADCs

IIO ADC의 single-ended·differential·pseudo-differential 입력과 unipolar·bipolar 극성, Device Tree 표현을 설명합니다.

Source pathDocumentation/iio/iio_adc.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

iio_adc.rst:1-305

IIO ADC 추상화는 입력 연결 방식과 극성을 독립적으로 표현합니다. 허용 전압 범위는 기준 전압·입력 유형·극성에서 도출하며, Device Tree의 `bipolar`, `diff-channels`, `single-channel`, `common-mode-channel`과 드라이버의 `iio_chan_spec.differential` 설정으로 채널을 구분합니다.

ADC 채널 유형 요약
유형기준주요 범위
Single-ended unipolarGND0V .. VREF
Single-ended bipolarGND-VREF .. +VREF
Differential bipolarIN-IN+ - IN-, 양수·음수
Differential unipolarIN-IN- .. +VREF
Pseudo-differential unipolar고정 IN-IN- .. +VREF
Pseudo-differential bipolar고정 IN-ADC에 따라 -VREF 또는 GND부터

각 유형의 기준 입력과 핵심 범위를 비교합니다.

ADC 채널 기술 흐름
입력 기준과 VREF 범위 확인Single-ended·differential·pseudo-differential 선택Unipolar 또는 bipolar 극성 선택Device Tree 채널 속성 선언`iio_chan_spec`과 scale·offset 구현

회로 입력 조건을 IIO와 Device Tree 표현으로 옮기는 순서입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0-only
2
3 =========================
4 IIO Abstractions for ADCs
5 =========================
6
7 1. Overview
8 ===========
9
10 The IIO subsystem supports many Analog to Digital Converters (ADCs). Some ADCs
11 have features and characteristics that are supported in specific ways by IIO
12 device drivers. This documentation describes common ADC features and explains
13 how they are supported by the IIO subsystem.
14
15 1. ADC Channel Types
16 ====================
17
18 ADCs can have distinct types of inputs, each of them measuring analog voltages
19 in a slightly different way. An ADC digitizes the analog input voltage over a
20 span that is often given by the provided voltage reference, the input type, and
21 the input polarity. The input range allowed to an ADC channel is needed to
22 determine the scale factor and offset needed to obtain the measured value in
23 real-world units (millivolts for voltage measurement, milliamps for current
24 measurement, etc.).
25
26 Elaborate designs may have nonlinear characteristics or integrated components
27 (such as amplifiers and reference buffers) that might also have to be considered
28 to derive the allowed input range for an ADC. For clarity, the sections below
29 assume the input range only depends on the provided voltage references, input
30 type, and input polarity.
31
32 There are three general types of ADC inputs (single-ended, differential,
33 pseudo-differential) and two possible polarities (unipolar, bipolar). The input
34 type (single-ended, differential, pseudo-differential) is one channel
35 characteristic, and is completely independent of the polarity (unipolar,
36 bipolar) aspect. A comprehensive article about ADC input types (on which this
37 doc is heavily based on) can be found at
38 https://www.analog.com/en/resources/technical-articles/sar-adc-input-types.html.
39
40 1.1 Single-ended channels
41 -------------------------
42
43 Single-ended channels digitize the analog input voltage relative to ground and
44 can be either unipolar or bipolar.
45
46 1.1.1 Single-ended Unipolar Channels
47 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48
49 ::
50
51 ---------- VREF -------------
52 ´ ` ´ ` _____________
53 / \ / \ / |
54 / \ / \ --- < IN ADC |
55 \ / \ / \ |
56 `-´ `-´ \ VREF |
57 -------- GND (0V) ----------- +-----------+
58 ^
59 |
60 External VREF
61
62 The input voltage to a **single-ended unipolar** channel is allowed to swing
63 from GND to VREF (where VREF is a voltage reference with electrical potential
64 higher than system ground). The maximum input voltage is also called VFS
65 (Voltage input Full-Scale), with VFS being determined by VREF. The voltage
66 reference may be provided from an external supply or derived from the chip power
67 source.
68
69 A single-ended unipolar channel could be described in device tree like the
70 following example::
71
72 adc@0 {
73 ...
74 #address-cells = <1>;
75 #size-cells = <0>;
76
77 channel@0 {
78 reg = <0>;
79 };
80 };
81
82 One is always allowed to include ADC channel nodes in the device tree. Though,
83 if the device has a uniform set of inputs (e.g. all inputs are single-ended),
84 then declaring the channel nodes is optional.
85
86 One caveat for devices that support mixed single-ended and differential channels
87 is that single-ended channel nodes also need to provide a ``single-channel``
88 property when ``reg`` is an arbitrary number that doesn't match the input pin
89 number.
90
91 See ``Documentation/devicetree/bindings/iio/adc/adc.yaml`` for the complete
92 documentation of ADC specific device tree properties.
93
94
95 1.1.2 Single-ended Bipolar Channels
96 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97
98 ::
99
100 ---------- +VREF ------------
101 ´ ` ´ ` _____________________
102 / \ / \ / |
103 / \ / \ --- < IN ADC |
104 \ / \ / \ |
105 `-´ `-´ \ +VREF -VREF |
106 ---------- -VREF ------------ +-------------------+
107 ^ ^
108 | |
109 External +VREF ------+ External -VREF
110
111 For a **single-ended bipolar** channel, the analog voltage input can go from
112 -VREF to +VREF (where -VREF is the voltage reference that has the lower
113 electrical potential while +VREF is the reference with the higher one). Some ADC
114 chips derive the lower reference from +VREF, others get it from a separate
115 input. Often, +VREF and -VREF are symmetric but they don't need to be so. When
116 -VREF is lower than system ground, these inputs are also called single-ended
117 true bipolar. Also, while there is a relevant difference between bipolar and
118 true bipolar from the electrical perspective, IIO makes no explicit distinction
119 between them.
120
121 Here's an example device tree description of a single-ended bipolar channel::
122
123 adc@0 {
124 ...
125 #address-cells = <1>;
126 #size-cells = <0>;
127
128 channel@0 {
129 reg = <0>;
130 bipolar;
131 };
132 };
133
134 1.2 Differential channels
135 -------------------------
136
137 A differential voltage measurement digitizes the voltage level at the positive
138 input (IN+) relative to the negative input (IN-) over the -VREF to +VREF span.
139 In other words, a differential channel measures the potential difference between
140 IN+ and IN-, which is often denoted by the IN+ - IN- formula.
141
142 1.2.1 Differential Bipolar Channels
143 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144
145 ::
146
147 -------- +VREF ------ +-------------------+
148 ´ ` ´ ` / |
149 / \ / \ / --- < IN+ |
150 `-´ `-´ | |
151 -------- -VREF ------ | |
152 | ADC |
153 -------- +VREF ------ | |
154 ´ ` ´ ` | |
155 \ / \ / \ --- < IN- |
156 `-´ `-´ \ +VREF -VREF |
157 -------- -VREF ------ +-------------------+
158 ^ ^
159 | +---- External -VREF
160 External +VREF
161
162 The analog signals to **differential bipolar** inputs are also allowed to swing
163 from -VREF to +VREF. The bipolar part of the name means that the resulting value
164 of the difference (IN+ - IN-) can be positive or negative. If -VREF is below
165 system GND, these are also called differential true bipolar inputs.
166
167 Device tree example of a differential bipolar channel::
168
169 adc@0 {
170 ...
171 #address-cells = <1>;
172 #size-cells = <0>;
173
174 channel@0 {
175 reg = <0>;
176 bipolar;
177 diff-channels = <0 1>;
178 };
179 };
180
181 In the ADC driver, ``differential = 1`` is set into ``struct iio_chan_spec`` for
182 the channel. Even though, there are three general input types, ``differential``
183 is only used to distinguish between differential and non-differential (either
184 single-ended or pseudo-differential) input types. See
185 ``include/linux/iio/iio.h`` for more information.
186
187 1.2.2 Differential Unipolar Channels
188 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189
190 For **differential unipolar** channels, the analog voltage at the positive input
191 must also be higher than the voltage at the negative input. Thus, the actual
192 input range allowed to a differential unipolar channel is IN- to +VREF. Because
193 IN+ is allowed to swing with the measured analog signal and the input setup must
194 guarantee IN+ will not go below IN- (nor IN- will raise above IN+), most
195 differential unipolar channel setups have IN- fixed to a known voltage that does
196 not fall within the voltage range expected for the measured signal. That leads
197 to a setup that is equivalent to a pseudo-differential channel. Thus,
198 differential unipolar setups can often be supported as pseudo-differential
199 unipolar channels.
200
201 1.3 Pseudo-differential Channels
202 --------------------------------
203
204 There is a third ADC input type which is called pseudo-differential or
205 single-ended to differential configuration. A pseudo-differential channel is
206 similar to a differential channel in that it also measures IN+ relative to IN-.
207 However, unlike bipolar differential channels, the negative input is limited to
208 a narrow voltage range (taken as a constant voltage) while only IN+ is allowed
209 to swing. A pseudo-differential channel can be made out from a differential pair
210 of inputs by restricting the negative input to a known voltage while allowing
211 only the positive input to swing. Sometimes, the input provided to IN- is called
212 common-mode voltage. Besides, some parts have a COM pin that allows single-ended
213 inputs to be referenced to a common-mode voltage, making them
214 pseudo-differential channels. Often, the common mode input voltage can be
215 described in the device tree as a voltage regulator (e.g. ``com-supply``) since
216 it is basically a constant voltage source.
217
218 1.3.1 Pseudo-differential Unipolar Channels
219 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
220
221 ::
222
223 -------- +VREF ------ +-------------------+
224 ´ ` ´ ` / |
225 / \ / \ / --- < IN+ |
226 `-´ `-´ | |
227 --------- IN- ------- | ADC |
228 | |
229 Common-mode voltage --> --- < IN- |
230 \ +VREF -VREF |
231 +-------------------+
232 ^ ^
233 | +---- External -VREF
234 External +VREF
235
236 A **pseudo-differential unipolar** input has the limitations a differential
237 unipolar channel would have, meaning the analog voltage to the positive input
238 IN+ must stay within IN- to +VREF. The fixed voltage to IN- is often called
239 common-mode voltage and it must be within -VREF to +VREF as would be expected
240 from the signal to any differential channel negative input.
241
242 The voltage measured from IN+ is relative to IN- but, unlike differential
243 channels, pseudo-differential setups are intended to gauge single-ended input
244 signals. To enable applications to calculate IN+ voltage with respect to system
245 ground, the IIO channel may provide an ``_offset`` sysfs attribute to be added
246 to ADC output when converting raw data to voltage units. In many setups, the
247 common-mode voltage input is at GND level and the ``_offset`` attribute is
248 omitted due to being always zero.
249
250 Device tree example for pseudo-differential unipolar channel::
251
252 adc@0 {
253 ...
254 #address-cells = <1>;
255 #size-cells = <0>;
256
257 channel@0 {
258 reg = <0>;
259 single-channel = <0>;
260 common-mode-channel = <1>;
261 };
262 };
263
264 Do not set ``differential`` in the channel ``iio_chan_spec`` struct of
265 pseudo-differential channels.
266
267 1.3.2 Pseudo-differential Bipolar Channels
268 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
269
270 ::
271
272 -------- +VREF ------ +-------------------+
273 ´ ` ´ ` / |
274 / \ / \ / --- < IN+ |
275 `-´ `-´ | |
276 -------- -VREF ------ | ADC |
277 | |
278 Common-mode voltage --> --- < IN- |
279 \ +VREF -VREF |
280 +-------------------+
281 ^ ^
282 | +---- External -VREF
283 External +VREF
284
285 A **pseudo-differential bipolar** input is not limited by the level at IN- but
286 it will be limited to -VREF or to GND on the lower end of the input range
287 depending on the particular ADC. Similar to their unipolar counter parts,
288 pseudo-differential bipolar channels ought to declare an ``_offset`` attribute
289 to enable the conversion of raw ADC data to voltage units. For the setup with
290 IN- connected to GND, ``_offset`` is often omitted.
291
292 Device tree example for pseudo-differential bipolar channel::
293
294 adc@0 {
295 ...
296 #address-cells = <1>;
297 #size-cells = <0>;
298
299 channel@0 {
300 reg = <0>;
301 bipolar;
302 single-channel = <0>;
303 common-mode-channel = <1>;
304 };
305 };
306

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

ADC 추상화와 입력 유형

1-39

이 문서는 GPL-2.0-only 라이선스가 적용되는 IIO ADC 추상화 설명서입니다. IIO 하위 시스템은 많은 아날로그-디지털 변환기(ADC)를 지원하며, 장치 드라이버가 공통 ADC 기능과 특성을 어떤 방식으로 제공하는지 설명합니다.

ADC 입력은 서로 다른 유형을 가질 수 있고 각 유형은 아날로그 전압을 조금씩 다른 방식으로 측정합니다. ADC가 디지털화하는 전압 범위는 보통 제공된 기준 전압, 입력 유형, 입력 극성으로 정해집니다.

ADC 채널의 허용 입력 범위를 알아야 실제 단위의 측정값을 얻는 데 필요한 scale factor와 offset을 정할 수 있습니다. 실제 단위의 예는 전압 측정의 millivolts, 전류 측정의 milliamps 등입니다.

복잡한 설계에는 비선형 특성이나 amplifier·reference buffer 같은 통합 부품이 있어 허용 입력 범위를 계산할 때 함께 고려해야 할 수 있습니다. 설명을 명확하게 하기 위해 아래 절에서는 입력 범위가 기준 전압·입력 유형·입력 극성에만 의존한다고 가정합니다.

ADC 입력의 일반 유형은 single-ended, differential, pseudo-differential 세 가지이고 극성은 unipolar와 bipolar 두 가지입니다. 입력 유형과 극성은 서로 완전히 독립적인 채널 특성입니다.

ADC 입력 분류 축
분류선택지의미
입력 유형Single-ended입력을 ground 기준으로 측정
입력 유형DifferentialIN+와 IN-의 전위차 측정
입력 유형Pseudo-differential고정된 IN- 기준으로 IN+ 측정
극성Unipolar결과가 한쪽 극성 범위
극성Bipolar결과가 양수 또는 음수 가능

입력 연결 방식과 결과 극성을 독립적인 두 특성으로 구분합니다.

실제 단위 변환에 필요한 정보
기준 전압 확인Single-ended·differential·pseudo-differential 구분Unipolar·bipolar 구분허용 입력 범위 계산Scale factor와 offset 결정

아날로그 입력 조건에서 IIO 처리값 계산 인자를 정하는 과정입니다.

이 문서가 크게 참고한 ADC 입력 유형 종합 문서는 `https://www.analog.com/en/resources/technical-articles/sar-adc-input-types.html`에서 볼 수 있습니다.

.. SPDX-License-Identifier: GPL-2.0-only

=========================
IIO Abstractions for ADCs
=========================

1. Overview
===========

The IIO subsystem supports many Analog to Digital Converters (ADCs). Some ADCs
have features and characteristics that are supported in specific ways by IIO
device drivers. This documentation describes common ADC features and explains
how they are supported by the IIO subsystem.

1. ADC Channel Types
====================

ADCs can have distinct types of inputs, each of them measuring analog voltages
in a slightly different way. An ADC digitizes the analog input voltage over a
span that is often given by the provided voltage reference, the input type, and
the input polarity. The input range allowed to an ADC channel is needed to
determine the scale factor and offset needed to obtain the measured value in
real-world units (millivolts for voltage measurement, milliamps for current
measurement, etc.).

Elaborate designs may have nonlinear characteristics or integrated components
(such as amplifiers and reference buffers) that might also have to be considered
to derive the allowed input range for an ADC. For clarity, the sections below
assume the input range only depends on the provided voltage references, input
type, and input polarity.

There are three general types of ADC inputs (single-ended, differential,
pseudo-differential) and two possible polarities (unipolar, bipolar). The input
type (single-ended, differential, pseudo-differential) is one channel
characteristic, and is completely independent of the polarity (unipolar,
bipolar) aspect. A comprehensive article about ADC input types (on which this
doc is heavily based on) can be found at
https://www.analog.com/en/resources/technical-articles/sar-adc-input-types.html.

Single-ended unipolar 채널

40-94

Single-ended 채널은 ground를 기준으로 아날로그 입력 전압을 디지털화하며 unipolar 또는 bipolar일 수 있습니다.

Single-ended unipolar 신호 경로
External VREF가 ADC의 VREF 입력에 연결ADC 입력 IN은 system GND를 기준으로 측정입력 파형은 GND(0V)에서 VREF 사이에서 변화ADC가 0V..VREF 범위를 디지털화

원문의 파형·ADC·외부 VREF ASCII 그림을 구조화했습니다.

Single-ended unipolar 범위
항목
낮은 입력 한계GND, 0V
높은 입력 한계VREF
측정 기준System ground
VFSVREF가 결정하는 Voltage input Full-Scale
VREF 공급외부 supply 또는 chip power source에서 유도

기준점과 full-scale 전압의 관계입니다.

Single-ended unipolar 채널의 입력 전압은 GND부터 VREF까지 변화할 수 있습니다. 여기서 VREF는 system ground보다 전위가 높은 기준 전압입니다.

최대 입력 전압은 VFS(Voltage input Full-Scale)라고도 하며 VREF가 결정합니다. 기준 전압은 외부 전원에서 공급하거나 칩 전원에서 유도할 수 있습니다.

Single-ended unipolar 채널은 Device Tree에서 다음과 같이 기술할 수 있습니다.

adc@0 {
    ...
    #address-cells = <1>;
    #size-cells = <0>;

    channel@0 {
        reg = <0>;
    };
};

ADC 채널 노드는 Device Tree에 언제나 포함할 수 있습니다. 그러나 장치의 모든 입력이 single-ended인 경우처럼 입력 구성이 균일하면 채널 노드 선언은 선택 사항입니다.

Single-ended와 differential 채널이 섞인 장치에는 주의점이 있습니다. `reg` 값이 입력 pin 번호와 일치하지 않는 임의의 번호라면 single-ended 채널 노드에도 `single-channel` 속성을 제공해야 합니다.

ADC 전용 Device Tree 속성의 전체 설명은 `Documentation/devicetree/bindings/iio/adc/adc.yaml`을 참고합니다.

1.1 Single-ended channels
-------------------------

Single-ended channels digitize the analog input voltage relative to ground and
can be either unipolar or bipolar.

1.1.1 Single-ended Unipolar Channels
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

  ---------- VREF -------------
      ´ `           ´ `                  _____________
    /     \       /     \               /             |
   /       \     /       \         --- <  IN    ADC   |
            \   /         \   /         \             |
             `-´           `-´           \       VREF |
  -------- GND (0V) -----------           +-----------+
                                                  ^
                                                  |
                                             External VREF

The input voltage to a **single-ended unipolar** channel is allowed to swing
from GND to VREF (where VREF is a voltage reference with electrical potential
higher than system ground). The maximum input voltage is also called VFS
(Voltage input Full-Scale), with VFS being determined by VREF. The voltage
reference may be provided from an external supply or derived from the chip power
source.

A single-ended unipolar channel could be described in device tree like the
following example::

    adc@0 {
        ...
        #address-cells = <1>;
        #size-cells = <0>;

        channel@0 {
            reg = <0>;
        };
    };

One is always allowed to include ADC channel nodes in the device tree. Though,
if the device has a uniform set of inputs (e.g. all inputs are single-ended),
then declaring the channel nodes is optional.

One caveat for devices that support mixed single-ended and differential channels
is that single-ended channel nodes also need to provide a ``single-channel``
property when ``reg`` is an arbitrary number that doesn't match the input pin
number.

See ``Documentation/devicetree/bindings/iio/adc/adc.yaml`` for the complete
documentation of ADC specific device tree properties.

Single-ended bipolar 채널

95-133
Single-ended bipolar 신호 경로
External +VREF를 ADC +VREF에 연결External -VREF 또는 내부 유도 전압을 ADC -VREF에 연결단일 IN 파형이 -VREF와 +VREF 사이에서 변화ADC는 system ground 기준의 bipolar 입력을 디지털화

원문의 ±VREF 파형과 두 기준 입력을 구조화했습니다.

Single-ended bipolar 기준 전압
항목설명
입력 범위-VREF .. +VREF
-VREF더 낮은 전위를 가진 기준 전압
+VREF더 높은 전위를 가진 기준 전압
하한 공급+VREF에서 유도하거나 별도 입력으로 공급
대칭성보통 대칭이지만 반드시 대칭일 필요는 없음

입력 범위와 하한 기준 전압의 공급 방식을 정리했습니다.

Single-ended bipolar 채널의 아날로그 입력 전압은 -VREF부터 +VREF까지 갈 수 있습니다. -VREF는 더 낮은 전위의 기준 전압이고 +VREF는 더 높은 전위의 기준 전압입니다.

일부 ADC 칩은 +VREF에서 낮은 기준 전압을 유도하고, 다른 칩은 별도 입력으로 받습니다. +VREF와 -VREF는 흔히 대칭이지만 반드시 그래야 하는 것은 아닙니다.

-VREF가 system ground보다 낮으면 이 입력을 single-ended true bipolar라고도 합니다. 전기적으로 bipolar와 true bipolar에는 중요한 차이가 있지만 IIO는 둘을 명시적으로 구분하지 않습니다.

Single-ended bipolar 채널의 Device Tree 예제는 `bipolar` 속성을 추가합니다.

adc@0 {
    ...
    #address-cells = <1>;
    #size-cells = <0>;

    channel@0 {
        reg = <0>;
        bipolar;
    };
};
1.1.2 Single-ended Bipolar Channels
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

  ---------- +VREF ------------
      ´ `           ´ `                  _____________________
    /     \       /     \               /                     |
   /       \     /       \         --- <  IN          ADC     |
            \   /         \   /         \                     |
             `-´           `-´           \       +VREF  -VREF |
  ---------- -VREF ------------           +-------------------+
                                                  ^       ^
                                                  |       |
                             External +VREF ------+  External -VREF

For a **single-ended bipolar** channel, the analog voltage input can go from
-VREF to +VREF (where -VREF is the voltage reference that has the lower
electrical potential while +VREF is the reference with the higher one). Some ADC
chips derive the lower reference from +VREF, others get it from a separate
input. Often, +VREF and -VREF are symmetric but they don't need to be so. When
-VREF is lower than system ground, these inputs are also called single-ended
true bipolar. Also, while there is a relevant difference between bipolar and
true bipolar from the electrical perspective, IIO makes no explicit distinction
between them.

Here's an example device tree description of a single-ended bipolar channel::

    adc@0 {
        ...
        #address-cells = <1>;
        #size-cells = <0>;

        channel@0 {
            reg = <0>;
            bipolar;
        };
    };

Differential bipolar 채널

134-186

Differential 전압 측정은 -VREF부터 +VREF까지의 범위에서 음의 입력 IN-를 기준으로 양의 입력 IN+의 전압 수준을 디지털화합니다. 즉 IN+와 IN- 사이의 전위차를 측정하며 보통 `IN+ - IN-` 공식으로 나타냅니다.

Differential bipolar 신호 경로
IN+ 파형이 -VREF..+VREF 범위에서 변화IN- 파형도 -VREF..+VREF 범위에서 변화ADC에 External +VREF와 External -VREF 제공ADC가 IN+ - IN- 전위차 계산차이가 양수 또는 음수인 digital value 출력

두 입력 파형과 ±VREF 기준을 가진 원문 회로 개념도를 구조화했습니다.

Differential bipolar 특성
항목동작
IN+-VREF .. +VREF에서 변화 가능
IN--VREF .. +VREF에서 변화 가능
측정값IN+ - IN-
결과 극성양수 또는 음수
True bipolar-VREF가 system GND 아래인 경우

각 입력과 최종 차이값의 범위를 구분합니다.

Differential bipolar 입력의 아날로그 신호도 -VREF부터 +VREF까지 변화할 수 있습니다. 이름의 bipolar는 차이값 `IN+ - IN-`이 양수 또는 음수가 될 수 있음을 뜻합니다. -VREF가 system GND 아래이면 differential true bipolar 입력이라고도 합니다.

Differential bipolar 채널의 Device Tree 예제는 `bipolar`와 `diff-channels = <0 1>`을 함께 지정합니다.

adc@0 {
    ...
    #address-cells = <1>;
    #size-cells = <0>;

    channel@0 {
        reg = <0>;
        bipolar;
        diff-channels = <0 1>;
    };
};

ADC 드라이버는 이 채널의 `struct iio_chan_spec`에 `differential = 1`을 설정합니다. 일반 입력 유형은 세 가지이지만 `differential` 필드는 differential과 non-differential을 구분하는 데만 쓰입니다. Non-differential에는 single-ended와 pseudo-differential이 모두 포함됩니다.

자세한 내용은 `include/linux/iio/iio.h`를 참고합니다.

1.2 Differential channels
-------------------------

A differential voltage measurement digitizes the voltage level at the positive
input (IN+) relative to the negative input (IN-) over the -VREF to +VREF span.
In other words, a differential channel measures the potential difference between
IN+ and IN-, which is often denoted by the IN+ - IN- formula.

1.2.1 Differential Bipolar Channels
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

  -------- +VREF ------         +-------------------+
    ´ `       ´ `              /                    |
  /     \   /     \   /   --- <  IN+                |
         `-´       `-´         |                    |
  -------- -VREF ------        |                    |
                               |            ADC     |
  -------- +VREF ------        |                    |
        ´ `       ´ `          |                    |
  \   /     \   /     \   --- <  IN-                |
   `-´       `-´               \       +VREF  -VREF |
  -------- -VREF ------         +-------------------+
                                         ^       ^
                                         |       +---- External -VREF
                                  External +VREF

The analog signals to **differential bipolar** inputs are also allowed to swing
from -VREF to +VREF. The bipolar part of the name means that the resulting value
of the difference (IN+ - IN-) can be positive or negative. If -VREF is below
system GND, these are also called differential true bipolar inputs.

Device tree example of a differential bipolar channel::

    adc@0 {
        ...
        #address-cells = <1>;
        #size-cells = <0>;

        channel@0 {
            reg = <0>;
            bipolar;
            diff-channels = <0 1>;
        };
    };

In the ADC driver, ``differential = 1`` is set into ``struct iio_chan_spec`` for
the channel. Even though, there are three general input types, ``differential``
is only used to distinguish between differential and non-differential (either
single-ended or pseudo-differential) input types. See
``include/linux/iio/iio.h`` for more information.

Differential unipolar 채널

187-200

Differential unipolar 채널에서는 양의 입력 전압이 음의 입력 전압보다 높아야 합니다. 따라서 실제 허용 입력 범위는 IN-부터 +VREF까지입니다.

IN+는 측정하는 아날로그 신호에 따라 변화할 수 있지만 IN+가 IN- 아래로 내려가거나 IN-가 IN+ 위로 올라가지 않도록 입력 구성이 보장해야 합니다.

이 때문에 대부분의 differential unipolar 구성은 IN-를 측정 신호의 예상 전압 범위에 들어가지 않는 알려진 전압에 고정합니다. 이런 구성은 pseudo-differential 채널과 동등해집니다.

Differential unipolar 제약
항목조건
IN+ 범위IN- .. +VREF
입력 순서IN+는 항상 IN- 이상
IN- 구성알려진 고정 전압을 흔히 사용
실용적 지원Pseudo-differential unipolar로 지원 가능

두 입력의 관계와 pseudo-differential로의 대응을 정리했습니다.

Differential unipolar의 실용적 변환
IN+가 측정 신호에 따라 변화IN+ ≥ IN- 조건 보장 필요IN-를 알려진 전압에 고정Pseudo-differential과 동등한 구성 형성Pseudo-differential unipolar로 지원

입력 제약이 pseudo-differential 구성으로 이어지는 이유입니다.

1.2.2 Differential Unipolar Channels
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For **differential unipolar** channels, the analog voltage at the positive input
must also be higher than the voltage at the negative input. Thus, the actual
input range allowed to a differential unipolar channel is IN- to +VREF. Because
IN+ is allowed to swing with the measured analog signal and the input setup must
guarantee IN+ will not go below IN- (nor IN- will raise above IN+), most
differential unipolar channel setups have IN- fixed to a known voltage that does
not fall within the voltage range expected for the measured signal. That leads
to a setup that is equivalent to a pseudo-differential channel. Thus,
differential unipolar setups can often be supported as pseudo-differential
unipolar channels.

Pseudo-differential 입력 개요

201-217

세 번째 ADC 입력 유형은 pseudo-differential 또는 single-ended-to-differential 구성이라고 부릅니다.

Pseudo-differential 채널은 IN-를 기준으로 IN+를 측정한다는 점에서 differential 채널과 비슷합니다. 그러나 bipolar differential과 달리 음의 입력은 상수로 취급하는 좁은 전압 범위로 제한되고 IN+만 변화할 수 있습니다.

Differential 입력 쌍에서 음의 입력을 알려진 전압으로 제한하고 양의 입력만 변화시키면 pseudo-differential 채널을 만들 수 있습니다. IN-에 제공하는 입력을 common-mode voltage라고 부르기도 합니다.

일부 부품에는 single-ended 입력이 공통 모드 전압을 기준으로 동작하게 하는 COM pin이 있어 이를 pseudo-differential 채널로 만듭니다.

Common-mode 입력 전압은 본질적으로 일정한 전압원이므로 Device Tree에서 `com-supply` 같은 voltage regulator로 기술할 수 있습니다.

Differential과 pseudo-differential 비교
항목DifferentialPseudo-differential
측정IN+ relative to IN-IN+ relative to IN-
IN+변화 가능변화 가능
IN-넓은 범위에서 변화 가능좁은 범위의 상수 전압
공통 모드입력 쌍에 따라 변화`com-supply` 또는 COM pin

두 입력 유형의 공통점과 핵심 차이를 보여 줍니다.

1.3 Pseudo-differential Channels
--------------------------------

There is a third ADC input type which is called pseudo-differential or
single-ended to differential configuration. A pseudo-differential channel is
similar to a differential channel in that it also measures IN+ relative to IN-.
However, unlike bipolar differential channels, the negative input is limited to
a narrow voltage range (taken as a constant voltage) while only IN+ is allowed
to swing. A pseudo-differential channel can be made out from a differential pair
of inputs by restricting the negative input to a known voltage while allowing
only the positive input to swing. Sometimes, the input provided to IN- is called
common-mode voltage. Besides, some parts have a COM pin that allows single-ended
inputs to be referenced to a common-mode voltage, making them
pseudo-differential channels. Often, the common mode input voltage can be
described in the device tree as a voltage regulator (e.g. ``com-supply``) since
it is basically a constant voltage source.

Pseudo-differential unipolar 채널

218-266
Pseudo-differential unipolar 신호 경로
External +VREF와 External -VREF를 ADC에 제공Common-mode voltage를 고정 IN-에 연결IN+ 파형은 IN-부터 +VREF 사이에서 변화ADC가 IN+를 고정 IN- 기준으로 디지털화

원문의 IN+ 파형·고정 IN-·±VREF 회로 개념도를 구조화했습니다.

Pseudo-differential unipolar 입력은 differential unipolar 채널과 같은 제한을 갖습니다. 양의 입력 IN+의 아날로그 전압은 IN-부터 +VREF 사이에 있어야 합니다.

IN-의 고정 전압은 보통 common-mode voltage라고 하며, differential 채널의 음의 입력 신호에 기대되는 것처럼 -VREF부터 +VREF 사이에 있어야 합니다.

Pseudo-differential unipolar 범위
신호허용 범위·역할
IN+IN- .. +VREF에서 변화
IN-고정 common-mode voltage
IN- 허용 범위-VREF .. +VREF
측정값IN+ relative to IN-

고정 기준과 변화 입력의 허용 범위입니다.

IN+에서 측정한 전압은 IN- 기준이지만, differential 채널과 달리 pseudo-differential 구성은 single-ended 입력 신호를 측정하려는 목적입니다.

응용 프로그램이 system ground 기준의 IN+ 전압을 계산할 수 있도록 IIO 채널은 ADC 출력을 전압 단위로 변환할 때 더할 `_offset` sysfs 속성을 제공할 수 있습니다.

많은 구성에서 common-mode 입력 전압은 GND 수준이고 `_offset`은 항상 0이므로 이 속성을 생략합니다.

Pseudo-differential unipolar 채널의 Device Tree 예제는 `single-channel`과 `common-mode-channel`을 지정합니다.

adc@0 {
    ...
    #address-cells = <1>;
    #size-cells = <0>;

    channel@0 {
        reg = <0>;
        single-channel = <0>;
        common-mode-channel = <1>;
    };
};

Pseudo-differential 채널의 `iio_chan_spec` 구조체에는 `differential`을 설정하지 않습니다.

1.3.1 Pseudo-differential Unipolar Channels
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

  -------- +VREF ------          +-------------------+
    ´ `       ´ `               /                    |
  /     \   /     \   /    --- <  IN+                |
         `-´       `-´          |                    |
  --------- IN- -------         |            ADC     |
                                |                    |
  Common-mode voltage -->  --- <  IN-                |
                                \       +VREF  -VREF |
                                 +-------------------+
                                         ^       ^
                                         |       +---- External -VREF
                                  External +VREF

A **pseudo-differential unipolar** input has the limitations a differential
unipolar channel would have, meaning the analog voltage to the positive input
IN+ must stay within IN- to +VREF. The fixed voltage to IN- is often called
common-mode voltage and it must be within -VREF to +VREF as would be expected
from the signal to any differential channel negative input.

The voltage measured from IN+ is relative to IN- but, unlike differential
channels, pseudo-differential setups are intended to gauge single-ended input
signals. To enable applications to calculate IN+ voltage with respect to system
ground, the IIO channel may provide an ``_offset`` sysfs attribute to be added
to ADC output when converting raw data to voltage units. In many setups, the
common-mode voltage input is at GND level and the ``_offset`` attribute is
omitted due to being always zero.

Device tree example for pseudo-differential unipolar channel::

    adc@0 {
        ...
        #address-cells = <1>;
        #size-cells = <0>;

        channel@0 {
            reg = <0>;
            single-channel = <0>;
            common-mode-channel = <1>;
        };
    };

Do not set ``differential`` in the channel ``iio_chan_spec`` struct of
pseudo-differential channels.

Pseudo-differential bipolar 채널

267-305
Pseudo-differential bipolar 신호 경로
External +VREF와 External -VREF를 ADC에 제공Common-mode voltage를 고정 IN-에 연결IN+가 ADC별 하한부터 +VREF까지 변화ADC가 IN+를 고정 IN- 기준으로 디지털화결과를 `_offset`으로 system ground 기준에 맞춤

원문의 bipolar IN+ 파형과 고정 IN- 회로 개념도를 구조화했습니다.

Pseudo-differential bipolar 입력은 IN- 수준에 의해 제한되지 않지만, 입력 범위의 하한은 특정 ADC에 따라 -VREF 또는 GND로 제한됩니다.

Pseudo-differential bipolar 범위
항목동작
IN+Bipolar 범위에서 변화
IN-고정 common-mode voltage
입력 하한ADC에 따라 -VREF 또는 GND
`_offset`Raw ADC data를 voltage units로 변환할 때 제공
IN- = GND`_offset`을 흔히 생략

ADC별 하한과 offset 제공 원칙을 정리했습니다.

Unipolar 구성과 마찬가지로 pseudo-differential bipolar 채널도 원시 ADC 데이터를 전압 단위로 변환할 수 있도록 `_offset` 속성을 선언해야 합니다. IN-가 GND에 연결된 구성에서는 `_offset`을 흔히 생략합니다.

Pseudo-differential bipolar 채널의 Device Tree 예제는 `bipolar`, `single-channel`, `common-mode-channel`을 함께 지정합니다.

adc@0 {
    ...
    #address-cells = <1>;
    #size-cells = <0>;

    channel@0 {
        reg = <0>;
        bipolar;
        single-channel = <0>;
        common-mode-channel = <1>;
    };
};
1.3.2 Pseudo-differential Bipolar Channels
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

  -------- +VREF ------          +-------------------+
    ´ `       ´ `               /                    |
  /     \   /     \   /    --- <  IN+                |
         `-´       `-´          |                    |
  -------- -VREF ------         |            ADC     |
                                |                    |
  Common-mode voltage -->  --- <  IN-                |
                                \       +VREF  -VREF |
                                 +-------------------+
                                          ^       ^
                                          |       +---- External -VREF
                                   External +VREF

A **pseudo-differential bipolar** input is not limited by the level at IN- but
it will be limited to -VREF or to GND on the lower end of the input range
depending on the particular ADC. Similar to their unipolar counter parts,
pseudo-differential bipolar channels ought to declare an ``_offset`` attribute
to enable the conversion of raw ADC data to voltage units. For the setup with
IN- connected to GND, ``_offset`` is often omitted.

Device tree example for pseudo-differential bipolar channel::

    adc@0 {
        ...
        #address-cells = <1>;
        #size-cells = <0>;

        channel@0 {
            reg = <0>;
            bipolar;
            single-channel = <0>;
            common-mode-channel = <1>;
        };
    };