xref: /freebsd/sys/contrib/device-tree/Bindings/iio/adc/ti,ads1015.yaml (revision cb7aa33ac6cd46a5434798e50363136e64f3ae98)
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: 6
82        description: |
83          Data acquisition rate in samples per second
84          0: 128
85          1: 250
86          2: 490
87          3: 920
88          4: 1600 (default)
89          5: 2400
90          6: 3300
91
92    required:
93      - reg
94
95examples:
96  - |
97    i2c {
98        #address-cells = <1>;
99        #size-cells = <0>;
100
101        adc@49 {
102            compatible = "ti,ads1015";
103            reg = <0x49>;
104            #address-cells = <1>;
105            #size-cells = <0>;
106            channel@0 {
107                reg = <0>;
108            };
109            channel@4 {
110                reg = <4>;
111                ti,gain = <3>;
112                ti,datarate = <5>;
113            };
114        };
115    };
116...
117