Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/iio/adc/envelope-detector.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: ADC envelope detector using a DAC and a comparator
0008 
0009 maintainers:
0010   - Peter Rosin <peda@axentia.se>
0011 
0012 description: |
0013   The DAC is used to find the peak level of an alternating voltage input
0014   signal by a binary search using the output of a comparator wired to
0015   an interrupt pin. Like so:
0016                           _
0017                          | \
0018     input +------>-------|+ \
0019                          |   \
0020            .-------.     |    }---.
0021            |       |     |   /    |
0022            |    dac|-->--|- /     |
0023            |       |     |_/      |
0024            |       |              |
0025            |       |              |
0026            |    irq|------<-------'
0027            |       |
0028            '-------'
0029 
0030 properties:
0031   compatible:
0032     const: axentia,tse850-envelope-detector
0033 
0034   io-channels:
0035     maxItems: 1
0036     description: Channel node of the dac to be used for comparator input.
0037 
0038   io-channel-names:
0039     const: dac
0040 
0041   interrupts:
0042     maxItems: 1
0043 
0044   interrupt-names:
0045     const: comp
0046 
0047 required:
0048   - compatible
0049   - io-channels
0050   - io-channel-names
0051   - interrupts
0052   - interrupt-names
0053 
0054 additionalProperties: false
0055 
0056 examples:
0057   - |
0058     #include <dt-bindings/interrupt-controller/irq.h>
0059     i2c {
0060         #address-cells = <1>;
0061         #size-cells = <0>;
0062         dpot: dpot@28 {
0063             compatible = "microchip,mcp4651-104";
0064             reg = <0x28>;
0065             #io-channel-cells = <1>;
0066         };
0067     };
0068 
0069     dac: dac {
0070         compatible = "dpot-dac";
0071         vref-supply = <&reg_3v3>;
0072         io-channels = <&dpot 0>;
0073         io-channel-names = "dpot";
0074         #io-channel-cells = <1>;
0075     };
0076 
0077     envelope-detector {
0078         compatible = "axentia,tse850-envelope-detector";
0079         io-channels = <&dac 0>;
0080         io-channel-names = "dac";
0081 
0082         interrupt-parent = <&gpio>;
0083         interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
0084         interrupt-names = "comp";
0085     };
0086 ...