1112508SphkWhat: /sys/bus/iio/devices/iio:deviceX/in_altvoltageY_invert 2112508SphkDate: October 2016 3112508SphkKernelVersion: 4.9 4112508SphkContact: Peter Rosin <peda@axentia.se> 5112508SphkDescription: 6112508Sphk The DAC is used to find the peak level of an alternating 7112508Sphk voltage input signal by a binary search using the output 8112508Sphk of a comparator wired to an interrupt pin. Like so:: 9112508Sphk 10112508Sphk _ 11112508Sphk | \ 12112508Sphk input +------>-------|+ \ 13112508Sphk | \ 14112508Sphk .-------. | }---. 15112508Sphk | | | / | 16112508Sphk | dac|-->--|- / | 17112508Sphk | | |_/ | 18112508Sphk | | | 19112508Sphk | | | 20112508Sphk | irq|------<-------' 21112508Sphk | | 22112508Sphk '-------' 23112508Sphk 24112508Sphk The boolean invert attribute (0/1) should be set when the 25112508Sphk input signal is centered around the maximum value of the 26112508Sphk dac instead of zero. The envelope detector will search 27112508Sphk from below in this case and will also invert the result. 28112508Sphk 29112508Sphk The edge/level of the interrupt is also switched to its 30112508Sphk opposite value. 31112508Sphk 32112508SphkWhat: /sys/bus/iio/devices/iio:deviceX/in_altvoltageY_compare_interval 33112508SphkDate: October 2016 34112508SphkKernelVersion: 4.9 35115624SphkContact: Peter Rosin <peda@axentia.se> 36115624SphkDescription: 37112508Sphk Number of milliseconds to wait for the comparator in each 38112508Sphk step of the binary search for the input peak level. Needs 39112508Sphk to relate to the frequency of the input signal. 40115624Sphk