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