162306a36Sopenharmony_ciWhat: /sys/bus/iio/devices/iio:deviceX/in_altvoltageY_invert 262306a36Sopenharmony_ciDate: October 2016 362306a36Sopenharmony_ciKernelVersion: 4.9 462306a36Sopenharmony_ciContact: Peter Rosin <peda@axentia.se> 562306a36Sopenharmony_ciDescription: 662306a36Sopenharmony_ci The DAC is used to find the peak level of an alternating 762306a36Sopenharmony_ci voltage input signal by a binary search using the output 862306a36Sopenharmony_ci of a comparator wired to an interrupt pin. Like so:: 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci _ 1162306a36Sopenharmony_ci | \ 1262306a36Sopenharmony_ci input +------>-------|+ \ 1362306a36Sopenharmony_ci | \ 1462306a36Sopenharmony_ci .-------. | }---. 1562306a36Sopenharmony_ci | | | / | 1662306a36Sopenharmony_ci | dac|-->--|- / | 1762306a36Sopenharmony_ci | | |_/ | 1862306a36Sopenharmony_ci | | | 1962306a36Sopenharmony_ci | | | 2062306a36Sopenharmony_ci | irq|------<-------' 2162306a36Sopenharmony_ci | | 2262306a36Sopenharmony_ci '-------' 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci The boolean invert attribute (0/1) should be set when the 2562306a36Sopenharmony_ci input signal is centered around the maximum value of the 2662306a36Sopenharmony_ci dac instead of zero. The envelope detector will search 2762306a36Sopenharmony_ci from below in this case and will also invert the result. 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci The edge/level of the interrupt is also switched to its 3062306a36Sopenharmony_ci opposite value. 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ciWhat: /sys/bus/iio/devices/iio:deviceX/in_altvoltageY_compare_interval 3362306a36Sopenharmony_ciDate: October 2016 3462306a36Sopenharmony_ciKernelVersion: 4.9 3562306a36Sopenharmony_ciContact: Peter Rosin <peda@axentia.se> 3662306a36Sopenharmony_ciDescription: 3762306a36Sopenharmony_ci Number of milliseconds to wait for the comparator in each 3862306a36Sopenharmony_ci step of the binary search for the input peak level. Needs 3962306a36Sopenharmony_ci to relate to the frequency of the input signal. 40