Path: blob/master/Documentation/devicetree/bindings/iio/adc/adi,ad4170-4.yaml
26309 views
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)1%YAML 1.22---3$id: http://devicetree.org/schemas/iio/adc/adi,ad4170-4.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: Analog Devices AD4170-4 and similar Analog to Digital Converters78maintainers:9- Marcelo Schmitt <marcelo.schmitt@analog.com>1011description: |12Analog Devices AD4170-4 series of Sigma-delta Analog to Digital Converters.13Specifications can be found at:14https://www.analog.com/media/en/technical-documentation/data-sheets/ad4170-4.pdf15https://www.analog.com/media/en/technical-documentation/data-sheets/ad4190-4.pdf16https://www.analog.com/media/en/technical-documentation/data-sheets/ad4195-4.pdf1718$ref: /schemas/spi/spi-peripheral-props.yaml#1920$defs:21reference-buffer:22description: |23Enable precharge buffer, full buffer, or skip reference buffering of24the positive/negative voltage reference. Because the output impedance25of the source driving the voltage reference inputs may be dynamic,26resistive/capacitive combinations of those inputs can cause DC gain27errors if the reference inputs go unbuffered into the ADC. Enable28reference buffering if the provided reference source has dynamic high29impedance output. Note the absolute voltage allowed on REFINn+ and REFINn-30inputs is from AVSS - 50 mV to AVDD + 50 mV when the reference buffers are31disabled but narrows to AVSS to AVDD when reference buffering is enabled32or in precharge mode.33$ref: /schemas/types.yaml#/definitions/string34enum: [ precharge, full, disabled ]35default: full3637properties:38compatible:39enum:40- adi,ad4170-441- adi,ad4190-442- adi,ad4195-44344avss-supply:45description:46Reference voltage supply for AVSS. A −2.625V minimum and 0V maximum supply47that powers the chip. If not provided, AVSS is assumed to be at system48ground (0V).4950avdd-supply:51description:52A supply of 4.75V to 5.25V relative to AVSS that powers the chip (AVDD).5354iovdd-supply:55description: 1.7V to 5.25V reference supply to the serial interface (IOVDD).5657refin1p-supply:58description: REFIN+ supply that can be used as reference for conversion.5960refin1n-supply:61description: REFIN- supply that can be used as reference for conversion.6263refin2p-supply:64description: REFIN2+ supply that can be used as reference for conversion.6566refin2n-supply:67description: REFIN2- supply that can be used as reference for conversion.6869spi-cpol: true7071spi-cpha: true7273interrupts:74description:75Interrupt for signaling the completion of conversion results. The data76ready signal (RDY) used as interrupt is by default provided on the SDO77pin. Alternatively, it can be provided on the DIG_AUX1 pin in which case78the chip disables the RDY function on SDO. Thus, there can be only one79data ready interrupt enabled at a time.8081interrupt-names:82description:83Specify which pin should be configured as Data Ready interrupt.84enum:85- sdo86- dig_aux18788clocks:89maxItems: 190description:91Optional external clock source. Can specify either an external clock or92external crystal.9394clock-names:95enum:96- ext-clk97- xtal98default: ext-clk99100'#clock-cells':101const: 0102103clock-output-names:104maxItems: 1105106gpio-controller: true107108"#gpio-cells":109const: 2110description: |111The first cell is for the GPIO number: 0 to 3.112The second cell takes standard GPIO flags.113114ldac-gpios:115description:116GPIO connected to DIG_AUX2 pin to be used as LDAC toggle to control the117transfer of data from the DAC_INPUT_A register to the DAC.118maxItems: 1119120'#address-cells':121const: 1122123'#size-cells':124const: 0125126adi,vbias-pins:127description: Analog inputs to apply a voltage bias of (AVDD − AVSS) / 2 to.128$ref: /schemas/types.yaml#/definitions/uint32-array129minItems: 1130maxItems: 9131items:132minimum: 0133maximum: 8134135allOf:136# Some devices don't have integrated DAC137- if:138properties:139compatible:140contains:141enum:142- adi,ad4190-4143- adi,ad4195-4144then:145properties:146ldac-gpios: false147148# Require to specify the interrupt pin when using interrupts149- if:150required:151- interrupts152then:153required:154- interrupt-names155156# If an external clock is set, the internal clock cannot go out and vice versa157- oneOf:158- required: [clocks]159properties:160'#clock-cells': false161- required: ['#clock-cells']162properties:163clocks: false164165required:166- compatible167- reg168- avdd-supply169- iovdd-supply170- spi-cpol171- spi-cpha172173unevaluatedProperties: false174175patternProperties:176"^channel@[0-9a-f]$":177$ref: /schemas/iio/adc/adc.yaml#178unevaluatedProperties: false179description:180Represents the external channels which are connected to the ADC.181182properties:183reg:184description:185The channel number.186minimum: 0187maximum: 15188189diff-channels:190description: |191This property is used for defining the inputs of a differential192voltage channel. The first value is the positive input and the second193value is the negative input of the channel.194195Besides the analog input pins AIN0 to AIN8, there are special inputs196that can be selected with the following values:19717: Internal temperature sensor19818: (AVDD-AVSS)/519919: (IOVDD-DGND)/520020: DAC output20121: ALDO20222: DLDO20323: AVSS20424: DGND20525: REFIN+20626: REFIN-20727: REFIN2+20828: REFIN2-20929: REFOUT210For the internal temperature sensor, use the input number for both211inputs (i.e. diff-channels = <17 17>).212items:213enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23, 24, 25,21426, 27, 28, 29]215216adi,reference-select:217description: |218Select the reference source to use when converting on the219specific channel. Valid values are:2200: REFIN+/REFIN-2211: REFIN2+/REFIN2−2222: REFOUT/AVSS (internal reference)2233: AVDD/AVSS224If not specified, REFOUT/AVSS is used.225$ref: /schemas/types.yaml#/definitions/uint32226enum: [0, 1, 2, 3]227default: 1228229adi,positive-reference-buffer:230$ref: '#/$defs/reference-buffer'231232adi,negative-reference-buffer:233$ref: '#/$defs/reference-buffer'234235adi,sensor-type:236description:237The AD4170-4 and similar designs have features to aid interfacing with238load cell weigh scale, RTD, and thermocouple sensors. Each of those239sensor types requires either distinct wiring configuration or240external circuitry for proper sensor operation and can use different241ADC chip functionality on their setups. A key characteristic of those242external sensors is that they must be excited either by voltage supply243or by ADC chip excitation signals. The sensor can then be read through244a pair of analog inputs. This property specifies which particular245sensor type is connected to the ADC so it can be properly setup and246handled. Omit this property for conventional (not weigh scale, RTD, or247thermocouple) ADC channel setups.248$ref: /schemas/types.yaml#/definitions/string249enum: [ weighscale, rtd, thermocouple ]250251adi,excitation-pin-0:252description:253Analog input to apply excitation current to while the channel254is active.255$ref: /schemas/types.yaml#/definitions/uint32256minimum: 0257maximum: 20258default: 0259260adi,excitation-pin-1:261description:262Analog input to apply excitation current to while the channel263is active.264$ref: /schemas/types.yaml#/definitions/uint32265minimum: 0266maximum: 20267default: 0268269adi,excitation-pin-2:270description:271Analog input to apply excitation current to while the channel272is active.273$ref: /schemas/types.yaml#/definitions/uint32274minimum: 0275maximum: 20276default: 0277278adi,excitation-pin-3:279description:280Analog input to apply excitation current to while the channel281is active.282$ref: /schemas/types.yaml#/definitions/uint32283minimum: 0284maximum: 20285default: 0286287adi,excitation-current-0-microamp:288description:289Excitation current in microamperes to be applied to pin specified in290adi,excitation-pin-0 while this channel is active.291enum: [0, 10, 50, 100, 250, 500, 1000, 1500]292default: 0293294adi,excitation-current-1-microamp:295description:296Excitation current in microamperes to be applied to pin specified in297adi,excitation-pin-1 while this channel is active.298enum: [0, 10, 50, 100, 250, 500, 1000, 1500]299default: 0300301adi,excitation-current-2-microamp:302description:303Excitation current in microamperes to be applied to pin specified in304adi,excitation-pin-2 while this channel is active.305enum: [0, 10, 50, 100, 250, 500, 1000, 1500]306default: 0307308adi,excitation-current-3-microamp:309description:310Excitation current in microamperes to be applied to pin specified in311adi,excitation-pin-3 while this channel is active.312enum: [0, 10, 50, 100, 250, 500, 1000, 1500]313default: 0314315adi,excitation-ac:316type: boolean317description:318Whether the external sensor has to be AC or DC excited. When omitted,319it is DC excited.320321allOf:322- oneOf:323- required: [single-channel, common-mode-channel]324properties:325diff-channels: false326- required: [diff-channels]327properties:328single-channel: false329common-mode-channel: false330# Usual ADC channels don't need external circuitry excitation.331- if:332not:333required:334- adi,sensor-type335then:336properties:337adi,excitation-pin-0: false338adi,excitation-pin-1: false339adi,excitation-pin-2: false340adi,excitation-pin-3: false341adi,excitation-current-0-microamp: false342adi,excitation-current-1-microamp: false343adi,excitation-current-2-microamp: false344adi,excitation-current-3-microamp: false345adi,excitation-ac: false346# Weigh scale bridge AC excited with one pair of predefined signals.347- if:348allOf:349- properties:350adi,sensor-type:351contains:352const: weighscale353- required:354- adi,excitation-ac355- adi,excitation-pin-2356- adi,excitation-pin-3357- not:358required:359- adi,excitation-current-2-microamp360- adi,excitation-current-3-microamp361then:362properties:363adi,excitation-pin-2:364const: 19365adi,excitation-pin-3:366const: 20367# Weigh scale bridge AC excited with two pairs of predefined signals.368- if:369allOf:370- properties:371adi,sensor-type:372contains:373const: weighscale374- required:375- adi,excitation-ac376- adi,excitation-pin-0377- adi,excitation-pin-1378- adi,excitation-pin-2379- adi,excitation-pin-3380- not:381required:382- adi,excitation-current-0-microamp383- adi,excitation-current-1-microamp384- adi,excitation-current-2-microamp385- adi,excitation-current-3-microamp386then:387properties:388adi,excitation-pin-0:389const: 17390adi,excitation-pin-1:391const: 18392adi,excitation-pin-2:393const: 19394adi,excitation-pin-3:395const: 20396397examples:398- |399#include <dt-bindings/interrupt-controller/irq.h>400spi {401#address-cells = <1>;402#size-cells = <0>;403404adc@0 {405compatible = "adi,ad4170-4";406reg = <0>;407spi-max-frequency = <20000000>;408spi-cpol;409spi-cpha;410avdd-supply = <&avdd>;411iovdd-supply = <&iovdd>;412clocks = <&clk>;413clock-names = "xtal";414interrupts = <0 IRQ_TYPE_EDGE_FALLING>;415interrupt-names = "dig_aux1";416adi,vbias-pins = <8>;417#address-cells = <1>;418#size-cells = <0>;419420// Sample AIN0 with respect to DGND throughout AVDD/DGND input range421// Pseudo-differential unipolar422channel@0 {423reg = <0>;424single-channel = <0>;425common-mode-channel = <24>;426adi,reference-select = <3>;427};428// Weigh scale sensor429channel@1 {430reg = <1>;431bipolar;432diff-channels = <1 2>;433adi,reference-select = <0>;434adi,positive-reference-buffer = "precharge";435adi,negative-reference-buffer = "precharge";436adi,sensor-type = "weighscale";437adi,excitation-pin-2 = <19>;438adi,excitation-pin-3 = <20>;439adi,excitation-ac;440};441// RTD sensor442channel@2 {443reg = <2>;444bipolar;445diff-channels = <3 4>;446adi,reference-select = <0>;447adi,sensor-type = "rtd";448adi,excitation-pin-0 = <5>;449adi,excitation-pin-1 = <6>;450adi,excitation-current-0-microamp = <500>;451adi,excitation-current-1-microamp = <500>;452adi,excitation-ac;453};454// Thermocouple sensor455channel@3 {456reg = <3>;457bipolar;458diff-channels = <7 8>;459adi,reference-select = <0>;460adi,sensor-type = "thermocouple";461adi,excitation-pin-0 = <18>;462adi,excitation-current-0-microamp = <500>;463};464};465};466- |467#include <dt-bindings/interrupt-controller/irq.h>468spi {469#address-cells = <1>;470#size-cells = <0>;471472adc@0 {473compatible = "adi,ad4170-4";474reg = <0>;475spi-max-frequency = <20000000>;476spi-cpol;477spi-cpha;478avdd-supply = <&avdd>;479iovdd-supply = <&iovdd>;480#clock-cells = <0>;481clock-output-names = "ad4170-clk16mhz";482interrupts = <0 IRQ_TYPE_EDGE_FALLING>;483interrupt-names = "dig_aux1";484#address-cells = <1>;485#size-cells = <0>;486487// Sample AIN0 with respect to AIN1 throughout AVDD/AVSS input range488// Differential bipolar. If AVSS < 0V, differential true bipolar489channel@0 {490reg = <0>;491bipolar;492diff-channels = <0 1>;493adi,reference-select = <3>;494};495// Sample AIN2 with respect to DGND throughout AVDD/DGND input range496// Pseudo-differential unipolar497channel@1 {498reg = <1>;499single-channel = <2>;500common-mode-channel = <24>;501adi,reference-select = <3>;502};503// Sample AIN3 with respect to 2.5V throughout AVDD/AVSS input range504// Pseudo-differential bipolar505channel@2 {506reg = <2>;507bipolar;508single-channel = <3>;509common-mode-channel = <29>;510adi,reference-select = <3>;511};512// Sample AIN4 with respect to DGND throughout AVDD/AVSS input range513// Pseudo-differential bipolar514channel@3 {515reg = <3>;516bipolar;517single-channel = <4>;518common-mode-channel = <24>;519adi,reference-select = <3>;520};521// Sample AIN5 with respect to 2.5V throughout AVDD/AVSS input range522// Pseudo-differential unipolar (AD4170-4 datasheet page 46 example)523channel@4 {524reg = <4>;525single-channel = <5>;526common-mode-channel = <29>;527adi,reference-select = <3>;528};529// Sample AIN6 with respect to 2.5V throughout REFIN+/REFIN- input range530// Pseudo-differential bipolar531channel@5 {532reg = <5>;533bipolar;534single-channel = <6>;535common-mode-channel = <29>;536adi,reference-select = <0>;537};538// Weigh scale sensor539channel@6 {540reg = <6>;541bipolar;542diff-channels = <7 8>;543adi,reference-select = <0>;544adi,sensor-type = "weighscale";545adi,excitation-pin-0 = <17>;546adi,excitation-pin-1 = <18>;547adi,excitation-pin-2 = <19>;548adi,excitation-pin-3 = <20>;549adi,excitation-ac;550};551};552};553...554555556