]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Bindings/iio/addac/adi,ad74115.yaml
Import device-tree files from Linux 6.2
[FreeBSD/FreeBSD.git] / Bindings / iio / addac / adi,ad74115.yaml
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/iio/addac/adi,ad74115.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Analog Devices AD74115H device
8
9 maintainers:
10   - Cosmin Tanislav <cosmin.tanislav@analog.com>
11
12 description: |
13   The AD74115H is a single-channel software configurable input/output
14   device for industrial control applications. It contains functionality for
15   analog output, analog input, digital output, digital input, resistance
16   temperature detector, and thermocouple measurements integrated into a single
17   chip solution with an SPI interface. The device features a 16-bit ADC and a
18   14-bit DAC.
19
20     https://www.analog.com/en/products/ad74115h.html
21
22 properties:
23   compatible:
24     enum:
25       - adi,ad74115h
26
27   reg:
28     maxItems: 1
29
30   spi-max-frequency:
31     maximum: 24000000
32
33   spi-cpol: true
34
35   reset-gpios: true
36
37   interrupts:
38     minItems: 1
39     maxItems: 2
40
41   interrupt-names:
42     minItems: 1
43     maxItems: 2
44     items:
45       enum:
46         - adc_rdy
47         - alert
48
49   avdd-supply: true
50   avcc-supply: true
51   dvcc-supply: true
52   dovdd-supply: true
53   refin-supply: true
54
55   adi,ch-func:
56     $ref: /schemas/types.yaml#/definitions/uint32
57     description: |
58       Channel function.
59       0 - High impedance
60       1 - Voltage output
61       2 - Current output
62       3 - Voltage input
63       4 - Current input, externally-powered
64       5 - Current input, loop-powered
65       6 - Resistance input
66       7 - RTD measure
67       8 - Digital input logic
68       9 - Digital input, loop-powered
69       10 - Current output with HART
70       11 - Current input, externally-powered, with HART
71       12 - Current input, loop-powered, with HART
72     minimum: 0
73     maximum: 12
74     default: 0
75
76   adi,conv2-mux:
77     $ref: /schemas/types.yaml#/definitions/uint32
78     description: |
79       Input node for ADC conversion 2.
80       0 - SENSE_EXT1 to AGND_SENSE
81       1 - SENSE_EXT2 to AGND_SENSE
82       2 - SENSE_EXT2 to SENSE_EXT1
83       3 - AGND to AGND
84     minimum: 0
85     maximum: 3
86     default: 0
87
88   adi,conv2-range-microvolt:
89     description: Conversion range for ADC conversion 2.
90     oneOf:
91       - items:
92           - enum: [-2500000, 0]
93           - const: 2500000
94       - items:
95           - enum: [-12000000, 0]
96           - const: 12000000
97       - items:
98           - const: -2500000
99           - const: 0
100       - items:
101           - const: -104000
102           - const: 104000
103       - items:
104           - const: 0
105           - const: 625000
106
107   adi,sense-agnd-buffer-low-power:
108     type: boolean
109     description:
110       Whether to enable low-power buffered mode for the AGND sense pin.
111
112   adi,lf-buffer-low-power:
113     type: boolean
114     description:
115       Whether to enable low-power buffered mode for the low-side filtered
116       sense pin.
117
118   adi,hf-buffer-low-power:
119     type: boolean
120     description:
121       Whether to enable low-power buffered mode for the high-side filtered
122       sense pin.
123
124   adi,ext2-buffer-low-power:
125     type: boolean
126     description: Whether to enable low-power buffered mode for the EXT2 pin.
127
128   adi,ext1-buffer-low-power:
129     type: boolean
130     description: Whether to enable low-power buffered mode for the EXT1 pin.
131
132   adi,comparator-invert:
133     type: boolean
134     description: Whether to invert the comparator output.
135
136   adi,digital-input-sink-range-high:
137     $ref: /schemas/types.yaml#/definitions/uint32
138     description: |
139       When not present, the digital input range is from 0 to 3700uA in steps
140       of 120uA, with a ~2k series resistance.
141       When present, the digital input range is from 0 to 7400uA in steps
142       of 240uA, with a ~1k series resistance.
143
144   adi,digital-input-sink-microamp:
145     description: Sink current in digital input mode.
146     minimum: 0
147     maximum: 3700
148     default: 0
149
150   adi,digital-input-debounce-mode-counter-reset:
151     type: boolean
152     description: |
153       When not present, a counter increments when the signal is asserted
154       and decrements when the signal is de-asserted.
155       When present, a counter increments while the signal is asserted and
156       resets when the signal de-asserts
157
158   adi,digital-input-unbuffered:
159     type: boolean
160     description: Whether to buffer digital input signals.
161
162   adi,digital-input-short-circuit-detection:
163     type: boolean
164     description: Whether to detect digital input short circuits.
165
166   adi,digital-input-open-circuit-detection:
167     type: boolean
168     description: Whether to detect digital input open circuits.
169
170   adi,digital-input-threshold-mode-fixed:
171     type: boolean
172     description: |
173       When not present, the digital input threshold range is -0.96 * AVDD
174       to AVDD.
175       When present, the threshold range is fixed from -19V to 30V.
176
177   adi,dac-bipolar:
178     type: boolean
179     description: |
180       When not present, the DAC operates in the 0V to 12V range.
181       When present, the DAC operates in the -12V to 12V range.
182
183   adi,charge-pump:
184     type: boolean
185     description: Whether to enable the internal charge pump.
186
187   adi,dac-hart-slew:
188     type: boolean
189     description: Whether to use a HART-compatible slew rate.
190
191   adi,dac-current-limit-low:
192     type: boolean
193     description: |
194       When not present, the DAC short-circuit current limit is 32mA in
195       either source or sink for VOUT and 4mA sink for IOUT.
196       When present, the limit is 16mA in either source or sink for VOUT,
197       1mA sink for IOUT.
198
199   adi,4-wire-rtd:
200     type: boolean
201     description: |
202       When not present, the ADC should be used for measuring 3-wire RTDs.
203       When present, the ADC should be used for measuring 4-wire RTDs.
204
205   adi,3-wire-rtd-excitation-swap:
206     type: boolean
207     description: Whether to swap the excitation for 3-wire RTD.
208
209   adi,rtd-excitation-current-microamp:
210     description: Excitation current to apply to RTD.
211     enum: [250, 500, 750, 1000]
212     default: 250
213
214   adi,ext1-burnout:
215     type: boolean
216     description: Whether to enable burnout current for EXT1.
217
218   adi,ext1-burnout-current-nanoamp:
219     $ref: /schemas/types.yaml#/definitions/uint32
220     description:
221       Burnout current in nanoamps to be applied to EXT1.
222     enum: [0, 50, 500, 1000, 10000]
223     default: 0
224
225   adi,ext1-burnout-current-polarity-sourcing:
226     type: boolean
227     description: |
228       When not present, the burnout current polarity for EXT1 is sinking.
229       When present, the burnout current polarity for EXT1 is sourcing.
230
231   adi,ext2-burnout:
232     type: boolean
233     description: Whether to enable burnout current for EXT2.
234
235   adi,ext2-burnout-current-nanoamp:
236     $ref: /schemas/types.yaml#/definitions/uint32
237     description: Burnout current in nanoamps to be applied to EXT2.
238     enum: [0, 50, 500, 1000, 10000]
239     default: 0
240
241   adi,ext2-burnout-current-polarity-sourcing:
242     type: boolean
243     description: |
244       When not present, the burnout current polarity for EXT2 is sinking.
245       When present, the burnout current polarity for EXT2 is sourcing.
246
247   adi,viout-burnout:
248     type: boolean
249     description: Whether to enable burnout current for VIOUT.
250
251   adi,viout-burnout-current-nanoamp:
252     $ref: /schemas/types.yaml#/definitions/uint32
253     description: Burnout current in nanoamps to be applied to VIOUT.
254     enum: [0, 1000, 10000]
255     default: 0
256
257   adi,viout-burnout-current-polarity-sourcing:
258     type: boolean
259     description: |
260       When not present, the burnout current polarity for VIOUT is sinking.
261       When present, the burnout current polarity for VIOUT is sourcing.
262
263   adi,gpio0-mode:
264     $ref: /schemas/types.yaml#/definitions/uint32
265     description: |
266       GPIO functions.
267       0 - Disabled
268       1 - Logic I/O
269       2 - Comparator output
270       3 - Control HART CD
271       4 - Monitor HART CD
272       5 - Monitor HART EOM status
273     minimum: 0
274     maximum: 5
275     default: 0
276
277   adi,gpio1-mode:
278     $ref: /schemas/types.yaml#/definitions/uint32
279     description: |
280       GPIO functions.
281       0 - Disabled
282       1 - Logic I/O
283       2 - Drive external digital output FET
284       3 - Control HART RXD
285       4 - Monitor HART RXD
286       5 - Monitor HART SOM status
287     minimum: 0
288     maximum: 5
289     default: 0
290
291   adi,gpio2-mode:
292     $ref: /schemas/types.yaml#/definitions/uint32
293     description: |
294       GPIO functions.
295       0 - Disabled
296       1 - Logic I/O
297       2 - Drive internal digital output FET
298       3 - Control HART TXD
299       4 - Monitor HART TXD
300       5 - Monitor HART TX complete status
301     minimum: 0
302     maximum: 5
303     default: 0
304
305   adi,gpio3-mode:
306     $ref: /schemas/types.yaml#/definitions/uint32
307     description: |
308       GPIO functions.
309       0 - Disabled
310       1 - Logic I/O
311       2 - High impedance
312       3 - Control HART RTS
313       4 - Monitor HART RTS
314       5 - Monitor HART CD complete status
315     minimum: 0
316     maximum: 5
317     default: 0
318
319 required:
320   - compatible
321   - reg
322   - spi-cpol
323   - avdd-supply
324
325 allOf:
326   - $ref: /schemas/spi/spi-peripheral-props.yaml#
327   - if:
328       required:
329         - adi,digital-input-sink-range-high
330     then:
331       properties:
332         adi,digital-input-sink-microamp:
333           maximum: 7400
334
335 unevaluatedProperties: false
336
337 examples:
338   - |
339     #include <dt-bindings/gpio/gpio.h>
340     #include <dt-bindings/interrupt-controller/irq.h>
341
342     spi {
343       #address-cells = <1>;
344       #size-cells = <0>;
345
346       addac@0 {
347         compatible = "adi,ad74115h";
348         reg = <0>;
349
350         spi-max-frequency = <12000000>;
351         spi-cpol;
352
353         reset-gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
354
355         interrupt-parent = <&gpio>;
356         interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
357         interrupt-names = "adc_rdy";
358
359         avdd-supply = <&ad74115_avdd>;
360
361         adi,ch-func = <1>;
362         adi,conv2-mux = <2>;
363         adi,conv2-range-microvolt = <(-12000000) 12000000>;
364
365         adi,gpio0-mode = <1>;
366         adi,gpio1-mode = <1>;
367         adi,gpio2-mode = <1>;
368         adi,gpio3-mode = <1>;
369
370         adi,dac-bipolar;
371       };
372     };
373 ...