xref: /linux/Documentation/devicetree/bindings/iio/adc/ti,ads1015.yaml (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/adc/ti,ads1015.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: TI ADS1015/ADS1115 4 channel I2C analog to digital converter
8
9maintainers:
10  - Daniel Baluta <daniel.baluta@nxp.com>
11
12description: |
13  Datasheet at: https://www.ti.com/lit/gpn/ads1015
14  Supports both single ended and differential channels.
15
16properties:
17  compatible:
18    enum:
19      - ti,ads1015
20      - ti,ads1115
21      - ti,tla2021
22      - ti,tla2024
23
24  reg:
25    maxItems: 1
26
27  interrupts:
28    maxItems: 1
29
30  "#address-cells":
31    const: 1
32
33  "#size-cells":
34    const: 0
35
36  "#io-channel-cells":
37    const: 1
38
39required:
40  - compatible
41  - reg
42  - "#address-cells"
43  - "#size-cells"
44
45additionalProperties: false
46
47patternProperties:
48  "^channel@[0-7]+$":
49    type: object
50    additionalProperties: false
51    description:
52      Child nodes needed for each channel that the platform uses.
53
54    properties:
55      reg:
56        description: |
57          0: Voltage over AIN0 and AIN1.
58          1: Voltage over AIN0 and AIN3.
59          2: Voltage over AIN1 and AIN3.
60          3: Voltage over AIN2 and AIN3.
61          4: Voltage over AIN0 and GND.
62          5: Voltage over AIN1 and GND.
63          6: Voltage over AIN2 and GND.
64          7: Voltage over AIN3 and GND.
65        items:
66          - minimum: 0
67            maximum: 7
68
69      ti,gain:
70        $ref: /schemas/types.yaml#/definitions/uint32
71        minimum: 0
72        maximum: 5
73        description: |
74          pga is the programmable gain amplifier (values are full scale)
75          0: +/- 6.144 V
76          1: +/- 4.096 V
77          2: +/- 2.048 V (default)
78          3: +/- 1.024 V
79          4: +/- 0.512 V
80          5: +/- 0.256 V
81
82      ti,datarate:
83        $ref: /schemas/types.yaml#/definitions/uint32
84        minimum: 0
85        maximum: 7
86        description: |
87          Data acquisition rate in samples per second for ADS1015, TLA2024
88          0: 128
89          1: 250
90          2: 490
91          3: 920
92          4: 1600 (default)
93          5: 2400
94          6: 3300
95          7: 3300
96
97          Data acquisition rate in samples per second for ADS1115
98          0: 8
99          1: 16
100          2: 32
101          3: 64
102          4: 128 (default)
103          5: 250
104          6: 475
105          7: 860
106
107    required:
108      - reg
109
110examples:
111  - |
112    i2c {
113        #address-cells = <1>;
114        #size-cells = <0>;
115
116        adc@49 {
117            compatible = "ti,ads1015";
118            reg = <0x49>;
119            #address-cells = <1>;
120            #size-cells = <0>;
121            channel@0 {
122                reg = <0>;
123            };
124            channel@4 {
125                reg = <4>;
126                ti,gain = <3>;
127                ti,datarate = <5>;
128            };
129        };
130    };
131...
132