xref: /freebsd/sys/contrib/device-tree/Bindings/iio/adc/ti,ads1015.yaml (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
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    description:
47      Child nodes needed for each channel that the platform uses.
48
49    properties:
50      reg:
51        description: |
52          0: Voltage over AIN0 and AIN1.
53          1: Voltage over AIN0 and AIN3.
54          2: Voltage over AIN1 and AIN3.
55          3: Voltage over AIN2 and AIN3.
56          4: Voltage over AIN0 and GND.
57          5: Voltage over AIN1 and GND.
58          6: Voltage over AIN2 and GND.
59          7: Voltage over AIN3 and GND.
60        items:
61          - minimum: 0
62            maximum: 7
63
64      ti,gain:
65        $ref: /schemas/types.yaml#/definitions/uint32
66        minimum: 0
67        maximum: 5
68        description: |
69          pga is the programmable gain amplifier (values are full scale)
70          0: +/- 6.144 V
71          1: +/- 4.096 V
72          2: +/- 2.048 V (default)
73          3: +/- 1.024 V
74          4: +/- 0.512 V
75          5: +/- 0.256 V
76
77      ti,datarate:
78        $ref: /schemas/types.yaml#/definitions/uint32
79        minimum: 0
80        maximum: 6
81        description: |
82          Data acquisition rate in samples per second
83          0: 128
84          1: 250
85          2: 490
86          3: 920
87          4: 1600 (default)
88          5: 2400
89          6: 3300
90
91    required:
92      - reg
93
94examples:
95  - |
96    i2c {
97        #address-cells = <1>;
98        #size-cells = <0>;
99
100        adc@49 {
101            compatible = "ti,ads1015";
102            reg = <0x49>;
103            #address-cells = <1>;
104            #size-cells = <0>;
105            channel@0 {
106              reg = <0>;
107            };
108            channel@4 {
109              reg = <4>;
110              ti,gain = <3>;
111              ti,datarate = <5>;
112            };
113        };
114    };
115...
116