^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) What: /sys/bus/iio/devices/iio:deviceX/in_altvoltageY_invert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) Date: October 2016
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) KernelVersion: 4.9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Contact: Peter Rosin <peda@axentia.se>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) The DAC is used to find the peak level of an alternating
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) voltage input signal by a binary search using the output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) of a comparator wired to an interrupt pin. Like so::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) _
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) input +------>-------|+ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) | \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) .-------. | }---.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) | | | / |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) | dac|-->--|- / |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) | | |_/ |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) | | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) | irq|------<-------'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) | |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) '-------'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) The boolean invert attribute (0/1) should be set when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) input signal is centered around the maximum value of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) dac instead of zero. The envelope detector will search
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) from below in this case and will also invert the result.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) The edge/level of the interrupt is also switched to its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) opposite value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) What: /sys/bus/iio/devices/iio:deviceX/in_altvoltageY_compare_interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) Date: October 2016
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) KernelVersion: 4.9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) Contact: Peter Rosin <peda@axentia.se>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) Number of milliseconds to wait for the comparator in each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) step of the binary search for the input peak level. Needs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) to relate to the frequency of the input signal.