xref: /linux/Documentation/devicetree/bindings/iio/adc/ti,ads1015.yaml (revision 34dc1baba215b826e454b8d19e4f24adbeb7d00d)
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,tla2024
22
23  reg:
24    maxItems: 1
25
26  "#address-cells":
27    const: 1
28
29  "#size-cells":
30    const: 0
31
32  "#io-channel-cells":
33    const: 1
34
35required:
36  - compatible
37  - reg
38  - "#address-cells"
39  - "#size-cells"
40
41additionalProperties: false
42
43patternProperties:
44  "^channel@[0-7]+$":
45    type: object
46    additionalProperties: false
47    description:
48      Child nodes needed for each channel that the platform uses.
49
50    properties:
51      reg:
52        description: |
53          0: Voltage over AIN0 and AIN1.
54          1: Voltage over AIN0 and AIN3.
55          2: Voltage over AIN1 and AIN3.
56          3: Voltage over AIN2 and AIN3.
57          4: Voltage over AIN0 and GND.
58          5: Voltage over AIN1 and GND.
59          6: Voltage over AIN2 and GND.
60          7: Voltage over AIN3 and GND.
61        items:
62          - minimum: 0
63            maximum: 7
64
65      ti,gain:
66        $ref: /schemas/types.yaml#/definitions/uint32
67        minimum: 0
68        maximum: 5
69        description: |
70          pga is the programmable gain amplifier (values are full scale)
71          0: +/- 6.144 V
72          1: +/- 4.096 V
73          2: +/- 2.048 V (default)
74          3: +/- 1.024 V
75          4: +/- 0.512 V
76          5: +/- 0.256 V
77
78      ti,datarate:
79        $ref: /schemas/types.yaml#/definitions/uint32
80        minimum: 0
81        maximum: 7
82        description: |
83          Data acquisition rate in samples per second for ADS1015, TLA2024
84          0: 128
85          1: 250
86          2: 490
87          3: 920
88          4: 1600 (default)
89          5: 2400
90          6: 3300
91          7: 3300
92
93          Data acquisition rate in samples per second for ADS1115
94          0: 8
95          1: 16
96          2: 32
97          3: 64
98          4: 128 (default)
99          5: 250
100          6: 475
101          7: 860
102
103    required:
104      - reg
105
106examples:
107  - |
108    i2c {
109        #address-cells = <1>;
110        #size-cells = <0>;
111
112        adc@49 {
113            compatible = "ti,ads1015";
114            reg = <0x49>;
115            #address-cells = <1>;
116            #size-cells = <0>;
117            channel@0 {
118                reg = <0>;
119            };
120            channel@4 {
121                reg = <4>;
122                ti,gain = <3>;
123                ti,datarate = <5>;
124            };
125        };
126    };
127...
128