Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/iio/addac/adi,ad74413r.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: Analog Devices AD74412R/AD74413R device
0008 
0009 maintainers:
0010   - Cosmin Tanislav <cosmin.tanislav@analog.com>
0011 
0012 description: |
0013   The AD74412R and AD74413R are quad-channel software configurable input/output
0014   solutions for building and process control applications. They contain
0015   functionality for analog output, analog input, digital input, resistance
0016   temperature detector, and thermocouple measurements integrated
0017   into a single chip solution with an SPI interface.
0018   The devices feature a 16-bit ADC and four configurable 13-bit DACs to provide
0019   four configurable input/output channels and a suite of diagnostic functions.
0020   The AD74413R differentiates itself from the AD74412R by being HART-compatible.
0021     https://www.analog.com/en/products/ad74412r.html
0022     https://www.analog.com/en/products/ad74413r.html
0023 
0024 properties:
0025   compatible:
0026     enum:
0027       - adi,ad74412r
0028       - adi,ad74413r
0029 
0030   reg:
0031     maxItems: 1
0032 
0033   '#address-cells':
0034     const: 1
0035 
0036   '#size-cells':
0037     const: 0
0038 
0039   spi-max-frequency:
0040     maximum: 1000000
0041 
0042   spi-cpol: true
0043 
0044   interrupts:
0045     maxItems: 1
0046 
0047   refin-supply: true
0048 
0049   shunt-resistor-micro-ohms:
0050     description:
0051       Shunt (sense) resistor value in micro-Ohms.
0052     default: 100000000
0053 
0054 required:
0055   - compatible
0056   - reg
0057   - spi-max-frequency
0058   - spi-cpol
0059   - refin-supply
0060 
0061 additionalProperties: false
0062 
0063 patternProperties:
0064   "^channel@[0-3]$":
0065     type: object
0066     description: Represents the external channels which are connected to the device.
0067 
0068     properties:
0069       reg:
0070         description: |
0071           The channel number. It can have up to 4 channels numbered from 0 to 3.
0072         minimum: 0
0073         maximum: 3
0074 
0075       adi,ch-func:
0076         $ref: /schemas/types.yaml#/definitions/uint32
0077         description: |
0078           Channel function.
0079           HART functions are not supported on AD74412R.
0080           0 - CH_FUNC_HIGH_IMPEDANCE
0081           1 - CH_FUNC_VOLTAGE_OUTPUT
0082           2 - CH_FUNC_CURRENT_OUTPUT
0083           3 - CH_FUNC_VOLTAGE_INPUT
0084           4 - CH_FUNC_CURRENT_INPUT_EXT_POWER
0085           5 - CH_FUNC_CURRENT_INPUT_LOOP_POWER
0086           6 - CH_FUNC_RESISTANCE_INPUT
0087           7 - CH_FUNC_DIGITAL_INPUT_LOGIC
0088           8 - CH_FUNC_DIGITAL_INPUT_LOOP_POWER
0089           9 - CH_FUNC_CURRENT_INPUT_EXT_POWER_HART
0090           10 - CH_FUNC_CURRENT_INPUT_LOOP_POWER_HART
0091         minimum: 0
0092         maximum: 10
0093         default: 0
0094 
0095       adi,gpo-comparator:
0096         type: boolean
0097         description: |
0098           Whether to configure GPO as a comparator or not.
0099           When not configured as a comparator, the GPO will be treated as an
0100           output-only GPIO.
0101 
0102     required:
0103       - reg
0104 
0105 examples:
0106   - |
0107     #include <dt-bindings/gpio/gpio.h>
0108     #include <dt-bindings/interrupt-controller/irq.h>
0109     #include <dt-bindings/iio/addac/adi,ad74413r.h>
0110 
0111     spi {
0112       #address-cells = <1>;
0113       #size-cells = <0>;
0114 
0115       cs-gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
0116       status = "okay";
0117 
0118       ad74413r@0 {
0119         compatible = "adi,ad74413r";
0120         reg = <0>;
0121         spi-max-frequency = <1000000>;
0122         spi-cpol;
0123 
0124         #address-cells = <1>;
0125         #size-cells = <0>;
0126 
0127         interrupt-parent = <&gpio>;
0128         interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
0129 
0130         refin-supply = <&ad74413r_refin>;
0131 
0132         channel@0 {
0133           reg = <0>;
0134 
0135           adi,ch-func = <CH_FUNC_VOLTAGE_OUTPUT>;
0136         };
0137 
0138         channel@1 {
0139           reg = <1>;
0140 
0141           adi,ch-func = <CH_FUNC_CURRENT_OUTPUT>;
0142         };
0143 
0144         channel@2 {
0145           reg = <2>;
0146 
0147           adi,ch-func = <CH_FUNC_DIGITAL_INPUT_LOGIC>;
0148           adi,gpo-comparator;
0149         };
0150 
0151         channel@3 {
0152           reg = <3>;
0153 
0154           adi,ch-func = <CH_FUNC_CURRENT_INPUT_EXT_POWER>;
0155         };
0156       };
0157     };
0158 ...