xref: /freebsd/sys/contrib/device-tree/Bindings/iio/temperature/adi,ltc2983.yaml (revision fe6060f10f634930ff71b7c50291ddc610da2475)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/temperature/adi,ltc2983.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices LTC2983 Multi-sensor Temperature system
8
9maintainers:
10  - Nuno Sá <nuno.sa@analog.com>
11
12description: |
13  Analog Devices LTC2983 Multi-Sensor Digital Temperature Measurement System
14  https://www.analog.com/media/en/technical-documentation/data-sheets/2983fc.pdf
15
16properties:
17  compatible:
18    enum:
19      - adi,ltc2983
20
21  reg:
22    maxItems: 1
23
24  interrupts:
25    maxItems: 1
26
27  adi,mux-delay-config-us:
28    description:
29      The LTC2983 performs 2 or 3 internal conversion cycles per temperature
30      result. Each conversion cycle is performed with different excitation and
31      input multiplexer configurations. Prior to each conversion, these
32      excitation circuits and input switch configurations are changed and an
33      internal 1ms delay ensures settling prior to the conversion cycle in most
34      cases. An extra delay can be configured using this property. The value is
35      rounded to nearest 100us.
36    maximum: 255
37
38  adi,filter-notch-freq:
39    description:
40      Set's the default setting of the digital filter. The default is
41      simultaneous 50/60Hz rejection.
42      0 - 50/60Hz rejection
43      1 - 60Hz rejection
44      2 - 50Hz rejection
45    $ref: /schemas/types.yaml#/definitions/uint32
46    minimum: 0
47    maximum: 2
48
49  '#address-cells':
50    const: 1
51
52  '#size-cells':
53    const: 0
54
55patternProperties:
56  "@([1-9]|1[0-9]|20)$":
57    type: object
58
59    properties:
60      reg:
61        description:
62          The channel number. It can be connected to one of the 20 channels of
63          the device.
64        minimum: 1
65        maximum: 20
66
67      adi,sensor-type:
68        description: Identifies the type of sensor connected to the device.
69        $ref: /schemas/types.yaml#/definitions/uint32
70
71    required:
72      - reg
73      - adi,sensor-type
74
75  "^thermocouple@":
76    type: object
77    description:
78      Represents a thermocouple sensor which is connected to one of the device
79      channels.
80
81    properties:
82      adi,sensor-type:
83        description: |
84          1 - Type J Thermocouple
85          2 - Type K Thermocouple
86          3 - Type E Thermocouple
87          4 - Type N Thermocouple
88          5 - Type R Thermocouple
89          6 - Type S Thermocouple
90          7 - Type T Thermocouple
91          8 - Type B Thermocouple
92          9 - Custom Thermocouple
93        $ref: /schemas/types.yaml#/definitions/uint32
94        minimum: 1
95        maximum: 9
96
97      adi,single-ended:
98        description:
99          Boolean property which set's the thermocouple as single-ended.
100        type: boolean
101
102      adi,sensor-oc-current-microamp:
103        description:
104          This property set's the pulsed current value applied during
105          open-circuit detect.
106        enum: [10, 100, 500, 1000]
107
108      adi,cold-junction-handle:
109        description:
110          Phandle which points to a sensor object responsible for measuring
111          the thermocouple cold junction temperature.
112        $ref: "/schemas/types.yaml#/definitions/phandle"
113
114      adi,custom-thermocouple:
115        description:
116          This is a table, where each entry should be a pair of
117          voltage(mv)-temperature(K). The entries must be given in nv and uK
118          so that, the original values must be multiplied by 1000000. For
119          more details look at table 69 and 70.
120          Note should be signed, but dtc doesn't currently maintain the
121          sign.
122        $ref: /schemas/types.yaml#/definitions/uint64-matrix
123        minItems: 3
124        maxItems: 64
125        items:
126          minItems: 2
127          maxItems: 2
128
129  "^diode@":
130    type: object
131    description:
132      Represents a diode sensor which is connected to one of the device
133      channels.
134
135    properties:
136      adi,sensor-type:
137        description: Identifies the sensor as a diode.
138        $ref: /schemas/types.yaml#/definitions/uint32
139        const: 28
140
141      adi,single-ended:
142        description: Boolean property which set's the diode as single-ended.
143        type: boolean
144
145      adi,three-conversion-cycles:
146        description:
147          Boolean property which set's three conversion cycles removing
148          parasitic resistance effects between the LTC2983 and the diode.
149        type: boolean
150
151      adi,average-on:
152        description:
153          Boolean property which enables a running average of the diode
154          temperature reading. This reduces the noise when the diode is used
155          as a cold junction temperature element on an isothermal block
156          where temperatures change slowly.
157        type: boolean
158
159      adi,excitation-current-microamp:
160        description:
161          This property controls the magnitude of the excitation current
162          applied to the diode. Depending on the number of conversions
163          cycles, this property will assume different predefined values on
164          each cycle. Just set the value of the first cycle (1l).
165        enum: [10, 20, 40, 80]
166
167      adi,ideal-factor-value:
168        description:
169          This property sets the diode ideality factor. The real value must
170          be multiplied by 1000000 to remove the fractional part. For more
171          information look at table 20 of the datasheet.
172        $ref: /schemas/types.yaml#/definitions/uint32
173
174  "^rtd@":
175    type: object
176    description:
177      Represents a rtd sensor which is connected to one of the device channels.
178
179    properties:
180      reg:
181        minimum: 2
182        maximum: 20
183
184      adi,sensor-type:
185        description: |
186          10 - RTD PT-10
187          11 - RTD PT-50
188          12 - RTD PT-100
189          13 - RTD PT-200
190          14 - RTD PT-500
191          15 - RTD PT-1000
192          16 - RTD PT-1000 (0.00375)
193          17 - RTD NI-120
194          18 - RTD Custom
195        $ref: /schemas/types.yaml#/definitions/uint32
196        minimum: 10
197        maximum: 18
198
199      adi,rsense-handle:
200        description:
201          Phandle pointing to a rsense object associated with this RTD.
202        $ref: "/schemas/types.yaml#/definitions/phandle"
203
204      adi,number-of-wires:
205        description:
206          Identifies the number of wires used by the RTD. Setting this
207          property to 5 means 4 wires with Kelvin Rsense.
208        $ref: /schemas/types.yaml#/definitions/uint32
209        enum: [2, 3, 4, 5]
210
211      adi,rsense-share:
212        description:
213          Boolean property which enables Rsense sharing, where one sense
214          resistor is used for multiple 2-, 3-, and/or 4-wire RTDs.
215        type: boolean
216
217      adi,current-rotate:
218        description:
219          Boolean property which enables excitation current rotation to
220          automatically remove parasitic thermocouple effects. Note that
221          this property is not allowed for 2- and 3-wire RTDs.
222        type: boolean
223
224      adi,excitation-current-microamp:
225        description:
226          This property controls the magnitude of the excitation current
227          applied to the RTD.
228        enum: [5, 10, 25, 50, 100, 250, 500, 1000]
229
230      adi,rtd-curve:
231        description:
232          This property set the RTD curve used and the corresponding
233          Callendar-VanDusen constants. Look at table 30 of the datasheet.
234        $ref: /schemas/types.yaml#/definitions/uint32
235        minimum: 0
236        maximum: 3
237
238      adi,custom-rtd:
239        description:
240          This is a table, where each entry should be a pair of
241          resistance(ohm)-temperature(K). The entries added here are in uohm
242          and uK. For more details values look at table 74 and 75.
243        $ref: /schemas/types.yaml#/definitions/uint64-matrix
244        items:
245          minItems: 3
246          maxItems: 64
247          items:
248            minItems: 2
249            maxItems: 2
250
251    required:
252      - adi,rsense-handle
253
254    dependencies:
255      adi,current-rotate: [ "adi,rsense-share" ]
256
257  "^thermistor@":
258    type: object
259    description:
260      Represents a thermistor sensor which is connected to one of the device
261      channels.
262
263    properties:
264      adi,sensor-type:
265        description:
266          19 - Thermistor 44004/44033 2.252kohm at 25°C
267          20 - Thermistor 44005/44030 3kohm at 25°C
268          21 - Thermistor 44007/44034 5kohm at 25°C
269          22 - Thermistor 44006/44031 10kohm at 25°C
270          23 - Thermistor 44008/44032 30kohm at 25°C
271          24 - Thermistor YSI 400 2.252kohm at 25°C
272          25 - Thermistor Spectrum 1003k 1kohm
273          26 - Thermistor Custom Steinhart-Hart
274          27 - Custom Thermistor
275        $ref: /schemas/types.yaml#/definitions/uint32
276        minimum: 19
277        maximum: 27
278
279      adi,rsense-handle:
280        description:
281          Phandle pointing to a rsense object associated with this
282          thermistor.
283        $ref: "/schemas/types.yaml#/definitions/phandle"
284
285      adi,single-ended:
286        description:
287          Boolean property which set's the thermistor as single-ended.
288        type: boolean
289
290      adi,rsense-share:
291        description:
292          Boolean property which enables Rsense sharing, where one sense
293          resistor is used for multiple thermistors. Note that this property
294          is ignored if adi,single-ended is set.
295        type: boolean
296
297      adi,current-rotate:
298        description:
299          Boolean property which enables excitation current rotation to
300          automatically remove parasitic thermocouple effects.
301        type: boolean
302
303      adi,excitation-current-nanoamp:
304        description:
305          This property controls the magnitude of the excitation current
306          applied to the thermistor. Value 0 set's the sensor in auto-range
307          mode.
308        $ref: /schemas/types.yaml#/definitions/uint32
309        enum: [0, 250, 500, 1000, 5000, 10000, 25000, 50000, 100000, 250000,
310               500000, 1000000]
311
312      adi,custom-thermistor:
313        description:
314          This is a table, where each entry should be a pair of
315          resistance(ohm)-temperature(K). The entries added here are in uohm
316          and uK only for custom thermistors. For more details look at table
317          78 and 79.
318        $ref: /schemas/types.yaml#/definitions/uint64-matrix
319        minItems: 3
320        maxItems: 64
321        items:
322          minItems: 2
323          maxItems: 2
324
325      adi,custom-steinhart:
326        description:
327          Steinhart-Hart coefficients are also supported and can
328          be programmed into the device memory using this property. For
329          Steinhart sensors the coefficients are given in the raw
330          format. Look at table 82 for more information.
331        $ref: /schemas/types.yaml#/definitions/uint32-array
332        items:
333          minItems: 6
334          maxItems: 6
335
336    required:
337      - adi,rsense-handle
338
339    dependencies:
340      adi,current-rotate: [ "adi,rsense-share" ]
341
342  "^adc@":
343    type: object
344    description: Represents a channel which is being used as a direct adc.
345
346    properties:
347      adi,sensor-type:
348        description: Identifies the sensor as a direct adc.
349        $ref: /schemas/types.yaml#/definitions/uint32
350        const: 30
351
352      adi,single-ended:
353        description: Boolean property which set's the adc as single-ended.
354        type: boolean
355
356  "^rsense@":
357    type: object
358    description:
359      Represents a rsense which is connected to one of the device channels.
360      Rsense are used by thermistors and RTD's.
361
362    properties:
363      reg:
364        minimum: 2
365        maximum: 20
366
367      adi,sensor-type:
368        description: Identifies the sensor as a rsense.
369        $ref: /schemas/types.yaml#/definitions/uint32
370        const: 29
371
372      adi,rsense-val-milli-ohms:
373        description:
374          Sets the value of the sense resistor. Look at table 20 of the
375          datasheet for information.
376
377    required:
378      - adi,rsense-val-milli-ohms
379
380required:
381  - compatible
382  - reg
383  - interrupts
384
385additionalProperties: false
386
387examples:
388  - |
389    #include <dt-bindings/interrupt-controller/irq.h>
390    spi {
391        #address-cells = <1>;
392        #size-cells = <0>;
393
394        sensor_ltc2983: ltc2983@0 {
395                compatible = "adi,ltc2983";
396                reg = <0>;
397
398                #address-cells = <1>;
399                #size-cells = <0>;
400
401                interrupts = <20 IRQ_TYPE_EDGE_RISING>;
402                interrupt-parent = <&gpio>;
403
404                thermocouple@18 {
405                        reg = <18>;
406                        adi,sensor-type = <8>; //Type B
407                        adi,sensor-oc-current-microamp = <10>;
408                        adi,cold-junction-handle = <&diode5>;
409                };
410
411                diode5: diode@5 {
412                        reg = <5>;
413                        adi,sensor-type = <28>;
414                };
415
416                rsense2: rsense@2 {
417                        reg = <2>;
418                        adi,sensor-type = <29>;
419                        adi,rsense-val-milli-ohms = <1200000>; //1.2Kohms
420                };
421
422                rtd@14 {
423                        reg = <14>;
424                        adi,sensor-type = <15>; //PT1000
425                        /*2-wire, internal gnd, no current rotation*/
426                        adi,number-of-wires = <2>;
427                        adi,rsense-share;
428                        adi,excitation-current-microamp = <500>;
429                        adi,rsense-handle = <&rsense2>;
430                };
431
432                adc@10 {
433                        reg = <10>;
434                        adi,sensor-type = <30>;
435                        adi,single-ended;
436                };
437
438                thermistor@12 {
439                        reg = <12>;
440                        adi,sensor-type = <26>; //Steinhart
441                        adi,rsense-handle = <&rsense2>;
442                        adi,custom-steinhart = <0x00F371EC 0x12345678
443                                        0x2C0F8733 0x10018C66 0xA0FEACCD
444                                        0x90021D99>; //6 entries
445                };
446
447                thermocouple@20 {
448                        reg = <20>;
449                        adi,sensor-type = <9>; //custom thermocouple
450                        adi,single-ended;
451                        adi,custom-thermocouple = /bits/ 64
452                                 <(-50220000) 0>,
453                                 <(-30200000) 99100000>,
454                                 <(-5300000) 135400000>,
455                                 <0 273150000>,
456                                 <40200000 361200000>,
457                                 <55300000 522100000>,
458                                 <88300000 720300000>,
459                                 <132200000 811200000>,
460                                 <188700000 922500000>,
461                                 <460400000 1000000000>; //10 pairs
462               };
463
464        };
465    };
466...
467