envelope-detector.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/iio/adc/envelope-detector.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: ADC envelope detector using a DAC and a comparator
  7. maintainers:
  8. - Peter Rosin <peda@axentia.se>
  9. description: |
  10. The DAC is used to find the peak level of an alternating voltage input
  11. signal by a binary search using the output of a comparator wired to
  12. an interrupt pin. Like so:
  13. _
  14. | \
  15. input +------>-------|+ \
  16. | \
  17. .-------. | }---.
  18. | | | / |
  19. | dac|-->--|- / |
  20. | | |_/ |
  21. | | |
  22. | | |
  23. | irq|------<-------'
  24. | |
  25. '-------'
  26. properties:
  27. compatible:
  28. const: axentia,tse850-envelope-detector
  29. io-channels:
  30. maxItems: 1
  31. description: Channel node of the dac to be used for comparator input.
  32. io-channel-names:
  33. const: dac
  34. interrupts:
  35. maxItems: 1
  36. interrupt-names:
  37. const: comp
  38. required:
  39. - compatible
  40. - io-channels
  41. - io-channel-names
  42. - interrupts
  43. - interrupt-names
  44. additionalProperties: false
  45. examples:
  46. - |
  47. #include <dt-bindings/interrupt-controller/irq.h>
  48. i2c {
  49. #address-cells = <1>;
  50. #size-cells = <0>;
  51. dpot: dpot@28 {
  52. compatible = "microchip,mcp4651-104";
  53. reg = <0x28>;
  54. #io-channel-cells = <1>;
  55. };
  56. };
  57. dac: dac {
  58. compatible = "dpot-dac";
  59. vref-supply = <&reg_3v3>;
  60. io-channels = <&dpot 0>;
  61. io-channel-names = "dpot";
  62. #io-channel-cells = <1>;
  63. };
  64. envelope-detector {
  65. compatible = "axentia,tse850-envelope-detector";
  66. io-channels = <&dac 0>;
  67. io-channel-names = "dac";
  68. interrupt-parent = <&gpio>;
  69. interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
  70. interrupt-names = "comp";
  71. };
  72. ...