€•y’Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ/translations/zh_CN/iio/iio_adc”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/zh_TW/iio/iio_adc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/it_IT/iio/iio_adc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/ja_JP/iio/iio_adc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/ko_KR/iio/iio_adc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/pt_BR/iio/iio_adc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ/translations/sp_SP/iio/iio_adc”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ%SPDX-License-Identifier: GPL-2.0-only”h]”hŒ%SPDX-License-Identifier: GPL-2.0-only”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ9/var/lib/git/docbuild/linux/Documentation/iio/iio_adc.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒIIO Abstractions for ADCs”h]”hŒIIO Abstractions for ADCs”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 1. Overview”h]”hŒ 1. Overview”…””}”(hhàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÝh²hh³hÇh´KubhŒ paragraph”“”)”}”(hXThe 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.”h]”hXThe 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.”…””}”(hhðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hhÝh²hubeh}”(h]”Œoverview”ah ]”h"]”Œ 1. overview”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ1. ADC Channel Types”h]”hŒ1. ADC Channel Types”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´Kubhï)”}”(hXä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.).”h]”hXä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.).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Khjh²hubhï)”}”(hXTElaborate 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.”h]”hXTElaborate 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.”…””}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Khjh²hubhï)”}”(hXï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.”h]”(hXŸ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 ”…””}”(hj3h²hh³Nh´NubhŒ reference”“”)”}”(hŒOhttps://www.analog.com/en/resources/technical-articles/sar-adc-input-types.html”h]”hŒOhttps://www.analog.com/en/resources/technical-articles/sar-adc-input-types.html”…””}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j?uh1j;hj3ubhŒ.”…””}”(hj3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hjh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ1.1 Single-ended channels”h]”hŒ1.1 Single-ended channels”…””}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjVh²hh³hÇh´K)ubhï)”}”(hŒqSingle-ended channels digitize the analog input voltage relative to ground and can be either unipolar or bipolar.”h]”hŒqSingle-ended channels digitize the analog input voltage relative to ground and can be either unipolar or bipolar.”…””}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K+hjVh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ$1.1.1 Single-ended Unipolar Channels”h]”hŒ$1.1.1 Single-ended Unipolar Channels”…””}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjuh²hh³hÇh´K/ubhŒ literal_block”“”)”}”(hX---------- VREF ------------- ´ ` ´ ` _____________ / \ / \ / | / \ / \ --- < IN ADC | \ / \ / \ | `-´ `-´ \ VREF | -------- GND (0V) ----------- +-----------+ ^ | External VREF”h]”hX---------- VREF ------------- ´ ` ´ ` _____________ / \ / \ / | / \ / \ --- < IN ADC | \ / \ / \ | `-´ `-´ \ VREF | -------- GND (0V) ----------- +-----------+ ^ | External VREF”…””}”hjˆsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´K3hjuh²hubhï)”}”(hX‡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.”h]”(hŒThe input voltage to a ”…””}”(hj–h²hh³Nh´NubhŒstrong”“”)”}”(hŒ**single-ended unipolar**”h]”hŒsingle-ended unipolar”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžhj–ubhXW 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.”…””}”(hj–h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K>hjuh²hubhï)”}”(hŒ^A single-ended unipolar channel could be described in device tree like the following example::”h]”hŒ]A single-ended unipolar channel could be described in device tree like the following example:”…””}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KEhjuh²hubj‡)”}”(hŒnadc@0 { ... #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; }; };”h]”hŒnadc@0 { ... #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; }; };”…””}”hjÆsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´KHhjuh²hubhï)”}”(hŒÊ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.”h]”hŒÊ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.”…””}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KRhjuh²hubhï)”}”(hŒó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.”h]”(hŒ‹One caveat for devices that support mixed single-ended and differential channels is that single-ended channel nodes also need to provide a ”…””}”(hjâh²hh³Nh´NubhŒliteral”“”)”}”(hŒ``single-channel``”h]”hŒsingle-channel”…””}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhjâubhŒ property when ”…””}”(hjâh²hh³Nh´Nubjë)”}”(hŒ``reg``”h]”hŒreg”…””}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhjâubhŒB is an arbitrary number that doesn’t match the input pin number.”…””}”(hjâh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KVhjuh²hubhï)”}”(hŒSee ``Documentation/devicetree/bindings/iio/adc/adc.yaml`` for the complete documentation of ADC specific device tree properties.”h]”(hŒSee ”…””}”(hjh²hh³Nh´Nubjë)”}”(hŒ6``Documentation/devicetree/bindings/iio/adc/adc.yaml``”h]”hŒ2Documentation/devicetree/bindings/iio/adc/adc.yaml”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhjubhŒG for the complete documentation of ADC specific device tree properties.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K[hjuh²hubeh}”(h]”Œsingle-ended-unipolar-channels”ah ]”h"]”Œ$1.1.1 single-ended unipolar channels”ah$]”h&]”uh1hÈhjVh²hh³hÇh´K/ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ#1.1.2 Single-ended Bipolar Channels”h]”hŒ#1.1.2 Single-ended Bipolar Channels”…””}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj>h²hh³hÇh´K`ubj‡)”}”(hXJ---------- +VREF ------------ ´ ` ´ ` _____________________ / \ / \ / | / \ / \ --- < IN ADC | \ / \ / \ | `-´ `-´ \ +VREF -VREF | ---------- -VREF ------------ +-------------------+ ^ ^ | | External +VREF ------+ External -VREF”h]”hXJ---------- +VREF ------------ ´ ` ´ ` _____________________ / \ / \ / | / \ / \ --- < IN ADC | \ / \ / \ | `-´ `-´ \ +VREF -VREF | ---------- -VREF ------------ +-------------------+ ^ ^ | | External +VREF ------+ External -VREF”…””}”hjOsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´Kdhj>h²hubhï)”}”(hXwFor 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.”h]”(hŒFor a ”…””}”(hj]h²hh³Nh´NubjŸ)”}”(hŒ**single-ended bipolar**”h]”hŒsingle-ended bipolar”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžhj]ubhX[ 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.”…””}”(hj]h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kohj>h²hubhï)”}”(hŒMHere's an example device tree description of a single-ended bipolar channel::”h]”hŒNHere’s an example device tree description of a single-ended bipolar channel:”…””}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kyhj>h²hubj‡)”}”(hŒadc@0 { ... #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; bipolar; }; };”h]”hŒadc@0 { ... #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; bipolar; }; };”…””}”hj‹sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´K{hj>h²hubeh}”(h]”Œsingle-ended-bipolar-channels”ah ]”h"]”Œ#1.1.2 single-ended bipolar channels”ah$]”h&]”uh1hÈhjVh²hh³hÇh´K`ubeh}”(h]”Œsingle-ended-channels”ah ]”h"]”Œ1.1 single-ended channels”ah$]”h&]”uh1hÈhjh²hh³hÇh´K)ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ1.2 Differential channels”h]”hŒ1.2 Differential channels”…””}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj©h²hh³hÇh´K‡ubhï)”}”(hX,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.”h]”hX,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.”…””}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K‰hj©h²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ#1.2.1 Differential Bipolar Channels”h]”hŒ#1.2.1 Differential Bipolar Channels”…””}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÈh²hh³hÇh´Kubj‡)”}”(hXç-------- +VREF ------ +-------------------+ ´ ` ´ ` / | / \ / \ / --- < IN+ | `-´ `-´ | | -------- -VREF ------ | | | ADC | -------- +VREF ------ | | ´ ` ´ ` | | \ / \ / \ --- < IN- | `-´ `-´ \ +VREF -VREF | -------- -VREF ------ +-------------------+ ^ ^ | +---- External -VREF External +VREF”h]”hXç-------- +VREF ------ +-------------------+ ´ ` ´ ` / | / \ / \ / --- < IN+ | `-´ `-´ | | -------- -VREF ------ | | | ADC | -------- +VREF ------ | | ´ ` ´ ` | | \ / \ / \ --- < IN- | `-´ `-´ \ +VREF -VREF | -------- -VREF ------ +-------------------+ ^ ^ | +---- External -VREF External +VREF”…””}”hjÙsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´K“hjÈh²hubhï)”}”(hX1The 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.”h]”(hŒThe analog signals to ”…””}”(hjçh²hh³Nh´NubjŸ)”}”(hŒ**differential bipolar**”h]”hŒdifferential bipolar”…””}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžhjçubhX 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.”…””}”(hjçh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¢hjÈh²hubhï)”}”(hŒ7Device tree example of a differential bipolar channel::”h]”hŒ6Device tree example of a differential bipolar channel:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K§hjÈh²hubj‡)”}”(hŒžadc@0 { ... #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; bipolar; diff-channels = <0 1>; }; };”h]”hŒžadc@0 { ... #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; bipolar; diff-channels = <0 1>; }; };”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´K©hjÈh²hubhï)”}”(hXVIn 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.”h]”(hŒIn the ADC driver, ”…””}”(hj#h²hh³Nh´Nubjë)”}”(hŒ``differential = 1``”h]”hŒdifferential = 1”…””}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhj#ubhŒ is set into ”…””}”(hj#h²hh³Nh´Nubjë)”}”(hŒ``struct iio_chan_spec``”h]”hŒstruct iio_chan_spec”…””}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhj#ubhŒD for the channel. Even though, there are three general input types, ”…””}”(hj#h²hh³Nh´Nubjë)”}”(hŒ``differential``”h]”hŒ differential”…””}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhj#ubhŒ… is only used to distinguish between differential and non-differential (either single-ended or pseudo-differential) input types. See ”…””}”(hj#h²hh³Nh´Nubjë)”}”(hŒ``include/linux/iio/iio.h``”h]”hŒinclude/linux/iio/iio.h”…””}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhj#ubhŒ for more information.”…””}”(hj#h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KµhjÈh²hubeh}”(h]”Œdifferential-bipolar-channels”ah ]”h"]”Œ#1.2.1 differential bipolar channels”ah$]”h&]”uh1hÈhj©h²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ$1.2.2 Differential Unipolar Channels”h]”hŒ$1.2.2 Differential Unipolar Channels”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´K¼ubhï)”}”(hXË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.”h]”(hŒFor ”…””}”(hj’h²hh³Nh´NubjŸ)”}”(hŒ**differential unipolar**”h]”hŒdifferential unipolar”…””}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžhj’ubhX® 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.”…””}”(hj’h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¾hjh²hubeh}”(h]”Œdifferential-unipolar-channels”ah ]”h"]”Œ$1.2.2 differential unipolar channels”ah$]”h&]”uh1hÈhj©h²hh³hÇh´K¼ubeh}”(h]”Œdifferential-channels”ah ]”h"]”Œ1.2 differential channels”ah$]”h&]”uh1hÈhjh²hh³hÇh´K‡ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ 1.3 Pseudo-differential Channels”h]”hŒ 1.3 Pseudo-differential Channels”…””}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÂh²hh³hÇh´KÊubhï)”}”(hXÆ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.”h]”(hX†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. ”…””}”(hjÓh²hh³Nh´Nubjë)”}”(hŒ``com-supply``”h]”hŒ com-supply”…””}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhjÓubhŒ2) since it is basically a constant voltage source.”…””}”(hjÓh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÌhjÂh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ+1.3.1 Pseudo-differential Unipolar Channels”h]”hŒ+1.3.1 Pseudo-differential Unipolar Channels”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjóh²hh³hÇh´KÛubj‡)”}”(hX„-------- +VREF ------ +-------------------+ ´ ` ´ ` / | / \ / \ / --- < IN+ | `-´ `-´ | | --------- IN- ------- | ADC | | | Common-mode voltage --> --- < IN- | \ +VREF -VREF | +-------------------+ ^ ^ | +---- External -VREF External +VREF”h]”hX„-------- +VREF ------ +-------------------+ ´ ` ´ ` / | / \ / \ / --- < IN+ | `-´ `-´ | | --------- IN- ------- | ADC | | | Common-mode voltage --> --- < IN- | \ +VREF -VREF | +-------------------+ ^ ^ | +---- External -VREF External +VREF”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´Kßhjóh²hubhï)”}”(hXoA **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.”h]”(hŒA ”…””}”(hjh²hh³Nh´NubjŸ)”}”(hŒ **pseudo-differential unipolar**”h]”hŒpseudo-differential unipolar”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžhjubhXM 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.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kìhjóh²hubhï)”}”(hXð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.”h]”(hXThe 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 ”…””}”(hj2h²hh³Nh´Nubjë)”}”(hŒ ``_offset``”h]”hŒ_offset”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhj2ubhŒœ 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 ”…””}”(hj2h²hh³Nh´Nubjë)”}”(hŒ ``_offset``”h]”hŒ_offset”…””}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhj2ubhŒ/ attribute is omitted due to being always zero.”…””}”(hj2h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kòhjóh²hubhï)”}”(hŒ>Device tree example for pseudo-differential unipolar channel::”h]”hŒ=Device tree example for pseudo-differential unipolar channel:”…””}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kúhjóh²hubj‡)”}”(hŒ¯adc@0 { ... #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; single-channel = <0>; common-mode-channel = <1>; }; };”h]”hŒ¯adc@0 { ... #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; single-channel = <0>; common-mode-channel = <1>; }; };”…””}”hjrsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´Kühjóh²hubhï)”}”(hŒdDo not set ``differential`` in the channel ``iio_chan_spec`` struct of pseudo-differential channels.”h]”(hŒ Do not set ”…””}”(hj€h²hh³Nh´Nubjë)”}”(hŒ``differential``”h]”hŒ differential”…””}”(hjˆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhj€ubhŒ in the channel ”…””}”(hj€h²hh³Nh´Nubjë)”}”(hŒ``iio_chan_spec``”h]”hŒ iio_chan_spec”…””}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhj€ubhŒ( struct of pseudo-differential channels.”…””}”(hj€h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhjóh²hubeh}”(h]”Œ%pseudo-differential-unipolar-channels”ah ]”h"]”Œ+1.3.1 pseudo-differential unipolar channels”ah$]”h&]”uh1hÈhjÂh²hh³hÇh´KÛubhÉ)”}”(hhh]”(hÎ)”}”(hŒ*1.3.2 Pseudo-differential Bipolar Channels”h]”hŒ*1.3.2 Pseudo-differential Bipolar Channels”…””}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjºh²hh³hÇh´M ubj‡)”}”(hX‡-------- +VREF ------ +-------------------+ ´ ` ´ ` / | / \ / \ / --- < IN+ | `-´ `-´ | | -------- -VREF ------ | ADC | | | Common-mode voltage --> --- < IN- | \ +VREF -VREF | +-------------------+ ^ ^ | +---- External -VREF External +VREF”h]”hX‡-------- +VREF ------ +-------------------+ ´ ` ´ ` / | / \ / \ / --- < IN+ | `-´ `-´ | | -------- -VREF ------ | ADC | | | Common-mode voltage --> --- < IN- | \ +VREF -VREF | +-------------------+ ^ ^ | +---- External -VREF External +VREF”…””}”hjËsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´Mhjºh²hubhï)”}”(hX³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.”h]”(hŒA ”…””}”(hjÙh²hh³Nh´NubjŸ)”}”(hŒ**pseudo-differential bipolar**”h]”hŒpseudo-differential bipolar”…””}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jžhjÙubhŒû 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 ”…””}”(hjÙh²hh³Nh´Nubjë)”}”(hŒ ``_offset``”h]”hŒ_offset”…””}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhjÙubhŒo attribute to enable the conversion of raw ADC data to voltage units. For the setup with IN- connected to GND, ”…””}”(hjÙh²hh³Nh´Nubjë)”}”(hŒ ``_offset``”h]”hŒ_offset”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jêhjÙubhŒ is often omitted.”…””}”(hjÙh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhjºh²hubhï)”}”(hŒ=Device tree example for pseudo-differential bipolar channel::”h]”hŒ; #size-cells = <0>; channel@0 { reg = <0>; bipolar; single-channel = <0>; common-mode-channel = <1>; }; };”h]”hŒÀadc@0 { ... #address-cells = <1>; #size-cells = <0>; channel@0 { reg = <0>; bipolar; single-channel = <0>; common-mode-channel = <1>; }; };”…””}”hj+sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j†h³hÇh´M&hjºh²hubeh}”(h]”Œ$pseudo-differential-bipolar-channels”ah ]”h"]”Œ*1.3.2 pseudo-differential bipolar channels”ah$]”h&]”uh1hÈhjÂh²hh³hÇh´M ubeh}”(h]”Œpseudo-differential-channels”ah ]”h"]”Œ 1.3 pseudo-differential channels”ah$]”h&]”uh1hÈhjh²hh³hÇh´KÊubeh}”(h]”Œadc-channel-types”ah ]”h"]”Œ1. adc channel types”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Kubeh}”(h]”Œiio-abstractions-for-adcs”ah ]”h"]”Œiio abstractions for adcs”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j|Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jVjSjjjNjKj¦j£j;j8jžj›j¿j¼j~j{j·j´jFjCj·j´j>j;uŒ nametypes”}”(jV‰j‰jN‰j¦‰j;‰jž‰j¿‰j~‰j·‰jF‰j·‰j>‰uh}”(jShÊjhÝjKjj£jVj8juj›j>j¼j©j{jÈj´jjCjÂj´jój;jºuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.