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