xref: /linux/Documentation/ABI/testing/sysfs-bus-counter (revision 1260ed77798502de9c98020040d2995008de10cc)
1What:		/sys/bus/counter/devices/counterX/cascade_counts_enable
2KernelVersion:	6.4
3Contact:	linux-iio@vger.kernel.org
4Description:
5		Indicates the cascading of Counts on Counter X.
6
7		Valid attribute values are boolean.
8
9What:		/sys/bus/counter/devices/counterX/external_input_phase_clock_select
10KernelVersion:	6.4
11Contact:	linux-iio@vger.kernel.org
12Description:
13		Selects the external clock pin for phase counting mode of
14		Counter X.
15
16		MTCLKA-MTCLKB:
17			MTCLKA and MTCLKB pins are selected for the external
18			phase clock.
19
20		MTCLKC-MTCLKD:
21			MTCLKC and MTCLKD pins are selected for the external
22			phase clock.
23
24What:		/sys/bus/counter/devices/counterX/external_input_phase_clock_select_available
25KernelVersion:	6.4
26Contact:	linux-iio@vger.kernel.org
27Description:
28		Discrete set of available values for the respective device
29		configuration are listed in this file.
30
31What:		/sys/bus/counter/devices/counterX/countY/count
32KernelVersion:	5.2
33Contact:	linux-iio@vger.kernel.org
34Description:
35		Count data of Count Y represented as a string.
36
37What:		/sys/bus/counter/devices/counterX/countY/compare
38KernelVersion:	6.15
39Contact:	linux-iio@vger.kernel.org
40Description:
41		If the counter device supports compare registers -- registers
42		used to compare counter channels against a particular count --
43		the compare count for channel Y is provided by this attribute.
44
45What:		/sys/bus/counter/devices/counterX/countY/capture
46KernelVersion:	6.1
47Contact:	linux-iio@vger.kernel.org
48Description:
49		Historical capture of the Count Y count data.
50
51What:		/sys/bus/counter/devices/counterX/countY/ceiling
52KernelVersion:	5.2
53Contact:	linux-iio@vger.kernel.org
54Description:
55		Count value ceiling for Count Y. This is the upper limit for the
56		respective counter.
57
58What:		/sys/bus/counter/devices/counterX/countY/floor
59KernelVersion:	5.2
60Contact:	linux-iio@vger.kernel.org
61Description:
62		Count value floor for Count Y. This is the lower limit for the
63		respective counter.
64
65What:		/sys/bus/counter/devices/counterX/countY/count_mode
66KernelVersion:	5.2
67Contact:	linux-iio@vger.kernel.org
68Description:
69		Count mode for channel Y. The ceiling and floor values for
70		Count Y are used by the count mode where required. The following
71		count modes are available:
72
73		normal:
74			Counting is continuous in either direction.
75
76		range limit:
77			An upper or lower limit is set, mimicking limit switches
78			in the mechanical counterpart. The upper limit is set to
79			the Count Y ceiling value, while the lower limit is set
80			to the Count Y floor value. The counter freezes at
81			count = ceiling when counting up, and at count = floor
82			when counting down. At either of these limits, the
83			counting is resumed only when the count direction is
84			reversed.
85
86		non-recycle:
87			The counter is disabled whenever a counter overflow or
88			underflow takes place. The counter is re-enabled when a
89			new count value is loaded to the counter via a preset
90			operation or direct write.
91
92		modulo-n:
93			A count value boundary is set between the Count Y floor
94			value and the Count Y ceiling value. The counter is
95			reset to the Count Y floor value at count = ceiling when
96			counting up, while the counter is set to the Count Y
97			ceiling value at count = floor when counting down; the
98			counter does not freeze at the boundary points, but
99			counts continuously throughout.
100
101		interrupt on terminal count:
102			The output signal is initially low, and will remain low
103			until the counter reaches zero. The output signal then
104			goes high and remains high until a new preset value is
105			set.
106
107		hardware retriggerable one-shot:
108			The output signal is initially high. The output signal
109			will go low by a trigger input signal, and will remain
110			low until the counter reaches zero. The output will then
111			go high and remain high until the next trigger. A
112			trigger results in loading the counter to the preset
113			value and setting the output signal low, thus starting
114			the one-shot pulse.
115
116		rate generator:
117			The output signal is initially high. When the counter
118			has decremented to 1, the output signal goes low for one
119			clock pulse. The output signal then goes high again, the
120			counter is reloaded to the preset value, and the process
121			repeats in a periodic manner as such.
122
123		square wave mode:
124			The output signal is initially high.
125
126			If the initial count is even, the counter is decremented
127			by two on succeeding clock pulses. When the count
128			expires, the output signal changes value and the
129			counter is reloaded to the preset value. The process
130			repeats in periodic manner as such.
131
132			If the initial count is odd, the initial count minus one
133			(an even number) is loaded and then is decremented by
134			two on succeeding clock pulses. One clock pulse after
135			the count expires, the output signal goes low and the
136			counter is reloaded to the preset value minus one.
137			Succeeding clock pulses decrement the count by two. When
138			the count expires, the output goes high again and the
139			counter is reloaded to the preset value minus one. The
140			process repeats in a periodic manner as such.
141
142		software triggered strobe:
143			The output signal is initially high. When the count
144			expires, the output will go low for one clock pulse and
145			then go high again. The counting sequence is "triggered"
146			by setting the preset value.
147
148		hardware triggered strobe:
149			The output signal is initially high. Counting is started
150			by a trigger input signal. When the count expires, the
151			output signal will go low for one clock pulse and then
152			go high again. A trigger results in loading the counter
153			to the preset value.
154
155What:		/sys/bus/counter/devices/counterX/countY/count_mode_available
156What:		/sys/bus/counter/devices/counterX/countY/error_noise_available
157What:		/sys/bus/counter/devices/counterX/countY/function_available
158What:		/sys/bus/counter/devices/counterX/countY/prescaler_available
159What:		/sys/bus/counter/devices/counterX/countY/signalZ_action_available
160KernelVersion:	5.2
161Contact:	linux-iio@vger.kernel.org
162Description:
163		Discrete set of available values for the respective Count Y
164		configuration are listed in this file. Values are delimited by
165		newline characters.
166
167What:		/sys/bus/counter/devices/counterX/countY/direction
168KernelVersion:	5.2
169Contact:	linux-iio@vger.kernel.org
170Description:
171		Read-only attribute that indicates the count direction of Count
172		Y. Two count directions are available: forward and backward.
173
174		Some counter devices are able to determine the direction of
175		their counting. For example, quadrature encoding counters can
176		determine the direction of movement by evaluating the leading
177		phase of the respective A and B quadrature encoding signals.
178		This attribute exposes such count directions.
179
180What:		/sys/bus/counter/devices/counterX/countY/enable
181KernelVersion:	5.2
182Contact:	linux-iio@vger.kernel.org
183Description:
184		Whether channel Y counter is enabled. Valid attribute values are
185		boolean.
186
187		This attribute is intended to serve as a pause/unpause mechanism
188		for Count Y. Suppose a counter device is used to count the total
189		movement of a conveyor belt: this attribute allows an operator
190		to temporarily pause the counter, service the conveyor belt,
191		and then finally unpause the counter to continue where it had
192		left off.
193
194What:		/sys/bus/counter/devices/counterX/countY/error_noise
195KernelVersion:	5.2
196Contact:	linux-iio@vger.kernel.org
197Description:
198		Read-only attribute that indicates whether excessive noise is
199		present at the channel Y counter inputs.
200
201What:		/sys/bus/counter/devices/counterX/countY/function
202KernelVersion:	5.2
203Contact:	linux-iio@vger.kernel.org
204Description:
205		Count function mode of Count Y; count function evaluation is
206		triggered by conditions specified by the Count Y signalZ_action
207		attributes. The following count functions are available:
208
209		increase:
210			Accumulated count is incremented.
211
212		decrease:
213			Accumulated count is decremented.
214
215		pulse-direction:
216			Rising edges on signal A updates the respective count.
217			The input level of signal B determines direction.
218
219		quadrature x1 a:
220			If direction is forward, rising edges on quadrature pair
221			signal A updates the respective count; if the direction
222			is backward, falling edges on quadrature pair signal A
223			updates the respective count. Quadrature encoding
224			determines the direction.
225
226		quadrature x1 b:
227			If direction is forward, rising edges on quadrature pair
228			signal B updates the respective count; if the direction
229			is backward, falling edges on quadrature pair signal B
230			updates the respective count. Quadrature encoding
231			determines the direction.
232
233		quadrature x2 a:
234			Any state transition on quadrature pair signal A updates
235			the respective count. Quadrature encoding determines the
236			direction.
237
238		quadrature x2 b:
239			Any state transition on quadrature pair signal B updates
240			the respective count. Quadrature encoding determines the
241			direction.
242
243		quadrature x4:
244			Any state transition on either quadrature pair signals
245			updates	the respective count. Quadrature encoding
246			determines the direction.
247
248What:		/sys/bus/counter/devices/counterX/countY/name
249KernelVersion:	5.2
250Contact:	linux-iio@vger.kernel.org
251Description:
252		Read-only attribute that indicates the device-specific name of
253		Count Y. If possible, this should match the name of the
254		respective channel as it appears in the device datasheet.
255
256What:		/sys/bus/counter/devices/counterX/countY/prescaler
257KernelVersion:	5.2
258Contact:	linux-iio@vger.kernel.org
259Description:
260		Configure the prescaler value associated with Count Y.
261		On the FlexTimer, the counter clock source passes through a
262		prescaler (i.e. a counter). This acts like a clock
263		divider.
264
265What:		/sys/bus/counter/devices/counterX/countY/preset
266KernelVersion:	5.2
267Contact:	linux-iio@vger.kernel.org
268Description:
269		If the counter device supports preset registers -- registers
270		used to load counter channels to a set count upon device-defined
271		preset operation trigger events -- the preset count for channel
272		Y is provided by this attribute.
273
274What:		/sys/bus/counter/devices/counterX/countY/preset_enable
275KernelVersion:	5.2
276Contact:	linux-iio@vger.kernel.org
277Description:
278		Whether channel Y counter preset operation is enabled. Valid
279		attribute values are boolean.
280
281What:		/sys/bus/counter/devices/counterX/countY/signalZ_action
282KernelVersion:	5.2
283Contact:	linux-iio@vger.kernel.org
284Description:
285		Action mode of Count Y for Signal Z. This attribute indicates
286		the condition of Signal Z that triggers the count function
287		evaluation for Count Y. The following action modes are
288		available:
289
290		none:
291			Signal does not trigger the count function. In
292			Pulse-Direction count function mode, this Signal is
293			evaluated as Direction.
294
295		rising edge:
296			Low state transitions to high state.
297
298		falling edge:
299			High state transitions to low state.
300
301		both edges:
302			Any state transition.
303
304What:		/sys/bus/counter/devices/counterX/countY/num_overflows
305KernelVersion:	6.1
306Contact:	linux-iio@vger.kernel.org
307Description:
308		This attribute indicates the number of overflows of count Y.
309
310What:		/sys/bus/counter/devices/counterX/cascade_counts_enable_component_id
311What:		/sys/bus/counter/devices/counterX/external_input_phase_clock_select_component_id
312What:		/sys/bus/counter/devices/counterX/countY/compare_component_id
313What:		/sys/bus/counter/devices/counterX/countY/capture_component_id
314What:		/sys/bus/counter/devices/counterX/countY/ceiling_component_id
315What:		/sys/bus/counter/devices/counterX/countY/floor_component_id
316What:		/sys/bus/counter/devices/counterX/countY/count_mode_component_id
317What:		/sys/bus/counter/devices/counterX/countY/direction_component_id
318What:		/sys/bus/counter/devices/counterX/countY/enable_component_id
319What:		/sys/bus/counter/devices/counterX/countY/error_noise_component_id
320What:		/sys/bus/counter/devices/counterX/countY/prescaler_component_id
321What:		/sys/bus/counter/devices/counterX/countY/preset_component_id
322What:		/sys/bus/counter/devices/counterX/countY/preset_enable_component_id
323What:		/sys/bus/counter/devices/counterX/countY/signalZ_action_component_id
324What:		/sys/bus/counter/devices/counterX/countY/num_overflows_component_id
325What:		/sys/bus/counter/devices/counterX/signalY/cable_fault_component_id
326What:		/sys/bus/counter/devices/counterX/signalY/cable_fault_enable_component_id
327What:		/sys/bus/counter/devices/counterX/signalY/filter_clock_prescaler_component_id
328What:		/sys/bus/counter/devices/counterX/signalY/index_polarity_component_id
329What:		/sys/bus/counter/devices/counterX/signalY/polarity_component_id
330What:		/sys/bus/counter/devices/counterX/signalY/synchronous_mode_component_id
331What:		/sys/bus/counter/devices/counterX/signalY/frequency_component_id
332KernelVersion:	5.16
333Contact:	linux-iio@vger.kernel.org
334Description:
335		Read-only attribute that indicates the component ID of the
336		respective extension or Synapse.
337
338What:		/sys/bus/counter/devices/counterX/countY/spike_filter_ns
339KernelVersion:	5.14
340Contact:	linux-iio@vger.kernel.org
341Description:
342		If the counter device supports programmable spike filter this
343		attribute indicates the value in nanoseconds where noise pulses
344		shorter or equal to configured value are ignored. Value 0 means
345		filter is disabled.
346
347What:		/sys/bus/counter/devices/counterX/events_queue_size
348KernelVersion:	5.16
349Contact:	linux-iio@vger.kernel.org
350Description:
351		Size of the Counter events queue in number of struct
352		counter_event data structures. The number of elements will be
353		rounded-up to a power of 2.
354
355What:		/sys/bus/counter/devices/counterX/name
356KernelVersion:	5.2
357Contact:	linux-iio@vger.kernel.org
358Description:
359		Read-only attribute that indicates the device-specific name of
360		the Counter. This should match the name of the device as it
361		appears in its respective datasheet.
362
363What:		/sys/bus/counter/devices/counterX/num_counts
364KernelVersion:	5.2
365Contact:	linux-iio@vger.kernel.org
366Description:
367		Read-only attribute that indicates the total number of Counts
368		belonging to the Counter.
369
370What:		/sys/bus/counter/devices/counterX/num_signals
371KernelVersion:	5.2
372Contact:	linux-iio@vger.kernel.org
373Description:
374		Read-only attribute that indicates the total number of Signals
375		belonging to the Counter.
376
377What:		/sys/bus/counter/devices/counterX/signalY/cable_fault
378KernelVersion:	5.7
379Contact:	linux-iio@vger.kernel.org
380Description:
381		Read-only attribute that indicates whether a differential
382		encoder cable fault (not connected or loose wires) is detected
383		for the respective channel of Signal Y. Valid attribute values
384		are boolean. Detection must first be enabled via the
385		corresponding cable_fault_enable attribute.
386
387What:		/sys/bus/counter/devices/counterX/signalY/cable_fault_enable
388KernelVersion:	5.7
389Contact:	linux-iio@vger.kernel.org
390Description:
391		Whether detection of differential encoder cable faults for the
392		respective channel of Signal Y is enabled. Valid attribute
393		values are boolean.
394
395What:		/sys/bus/counter/devices/counterX/signalY/filter_clock_prescaler
396KernelVersion:	5.7
397Contact:	linux-iio@vger.kernel.org
398Description:
399		Filter clock factor for input Signal Y. This prescaler value
400		affects the inputs of both quadrature pair signals.
401
402What:		/sys/bus/counter/devices/counterX/signalY/index_polarity
403KernelVersion:	5.2
404Contact:	linux-iio@vger.kernel.org
405Description:
406		Active level of index input Signal Y; irrelevant in
407		non-synchronous load mode.
408
409What:		/sys/bus/counter/devices/counterX/signalY/index_polarity_available
410What:		/sys/bus/counter/devices/counterX/signalY/synchronous_mode_available
411KernelVersion:	5.2
412Contact:	linux-iio@vger.kernel.org
413Description:
414		Discrete set of available values for the respective Signal Y
415		configuration are listed in this file.
416
417What:		/sys/bus/counter/devices/counterX/signalY/polarity
418KernelVersion:	6.1
419Contact:	linux-iio@vger.kernel.org
420Description:
421		Active level of Signal Y. The following polarity values are
422		available:
423
424		positive:
425			Signal high state considered active level (rising edge).
426
427		negative:
428			Signal low state considered active level (falling edge).
429
430What:		/sys/bus/counter/devices/counterX/signalY/name
431KernelVersion:	5.2
432Contact:	linux-iio@vger.kernel.org
433Description:
434		Read-only attribute that indicates the device-specific name of
435		Signal Y. If possible, this should match the name of the
436		respective signal as it appears in the device datasheet.
437
438What:		/sys/bus/counter/devices/counterX/signalY/signal
439KernelVersion:	5.2
440Contact:	linux-iio@vger.kernel.org
441Description:
442		Signal level state of Signal Y. The following signal level
443		states are available:
444
445		low:
446			Low level state.
447
448		high:
449			High level state.
450
451What:		/sys/bus/counter/devices/counterX/signalY/synchronous_mode
452KernelVersion:	5.2
453Contact:	linux-iio@vger.kernel.org
454Description:
455		Configure the counter associated with Signal Y for
456		non-synchronous or synchronous load mode. Synchronous load mode
457		cannot be selected in non-quadrature (Pulse-Direction) clock
458		mode.
459
460		non-synchronous:
461			A logic low level is the active level at this index
462			input. The index function (as enabled via preset_enable)
463			is performed directly on the active level of the index
464			input.
465
466		synchronous:
467			Intended for interfacing with encoder Index output in
468			quadrature clock mode. The active level is configured
469			via index_polarity. The index function (as enabled via
470			preset_enable) is performed synchronously with the
471			quadrature clock on the active level of the index input.
472
473What:		/sys/bus/counter/devices/counterX/signalY/frequency
474KernelVersion:	6.1
475Contact:	linux-iio@vger.kernel.org
476Description:
477		Read-only attribute that indicates the signal Y frequency, in Hz.
478