summaryrefslogtreecommitdiff
path: root/Documentation/ABI/testing/sysfs-bus-counter
blob: 73ac84c0bca76e013f2534efc40c0f0e8d5fb023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
What:		/sys/bus/counter/devices/counterX/cascade_counts_enable
KernelVersion:	6.4
Contact:	linux-iio@vger.kernel.org
Description:
		Indicates the cascading of Counts on Counter X.

		Valid attribute values are boolean.

What:		/sys/bus/counter/devices/counterX/external_input_phase_clock_select
KernelVersion:	6.4
Contact:	linux-iio@vger.kernel.org
Description:
		Selects the external clock pin for phase counting mode of
		Counter X.

		MTCLKA-MTCLKB:
			MTCLKA and MTCLKB pins are selected for the external
			phase clock.

		MTCLKC-MTCLKD:
			MTCLKC and MTCLKD pins are selected for the external
			phase clock.

What:		/sys/bus/counter/devices/counterX/external_input_phase_clock_select_available
KernelVersion:	6.4
Contact:	linux-iio@vger.kernel.org
Description:
		Discrete set of available values for the respective device
		configuration are listed in this file.

What:		/sys/bus/counter/devices/counterX/countY/count
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Count data of Count Y represented as a string.

What:		/sys/bus/counter/devices/counterX/countY/capture
KernelVersion:	6.1
Contact:	linux-iio@vger.kernel.org
Description:
		Historical capture of the Count Y count data.

What:		/sys/bus/counter/devices/counterX/countY/ceiling
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Count value ceiling for Count Y. This is the upper limit for the
		respective counter.

What:		/sys/bus/counter/devices/counterX/countY/floor
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Count value floor for Count Y. This is the lower limit for the
		respective counter.

What:		/sys/bus/counter/devices/counterX/countY/count_mode
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Count mode for channel Y. The ceiling and floor values for
		Count Y are used by the count mode where required. The following
		count modes are available:

		normal:
			Counting is continuous in either direction.

		range limit:
			An upper or lower limit is set, mimicking limit switches
			in the mechanical counterpart. The upper limit is set to
			the Count Y ceiling value, while the lower limit is set
			to the Count Y floor value. The counter freezes at
			count = ceiling when counting up, and at count = floor
			when counting down. At either of these limits, the
			counting is resumed only when the count direction is
			reversed.

		non-recycle:
			The counter is disabled whenever a counter overflow or
			underflow takes place. The counter is re-enabled when a
			new count value is loaded to the counter via a preset
			operation or direct write.

		modulo-n:
			A count value boundary is set between the Count Y floor
			value and the Count Y ceiling value. The counter is
			reset to the Count Y floor value at count = ceiling when
			counting up, while the counter is set to the Count Y
			ceiling value at count = floor when counting down; the
			counter does not freeze at the boundary points, but
			counts continuously throughout.

		interrupt on terminal count:
			The output signal is initially low, and will remain low
			until the counter reaches zero. The output signal then
			goes high and remains high until a new preset value is
			set.

		hardware retriggerable one-shot:
			The output signal is initially high. The output signal
			will go low by a trigger input signal, and will remain
			low until the counter reaches zero. The output will then
			go high and remain high until the next trigger. A
			trigger results in loading the counter to the preset
			value and setting the output signal low, thus starting
			the one-shot pulse.

		rate generator:
			The output signal is initially high. When the counter
			has decremented to 1, the output signal goes low for one
			clock pulse. The output signal then goes high again, the
			counter is reloaded to the preset value, and the process
			repeats in a periodic manner as such.

		square wave mode:
			The output signal is initially high.

			If the initial count is even, the counter is decremented
			by two on succeeding clock pulses. When the count
			expires, the output signal changes value and the
			counter is reloaded to the preset value. The process
			repeats in periodic manner as such.

			If the initial count is odd, the initial count minus one
			(an even number) is loaded and then is decremented by
			two on succeeding clock pulses. One clock pulse after
			the count expires, the output signal goes low and the
			counter is reloaded to the preset value minus one.
			Succeeding clock pulses decrement the count by two. When
			the count expires, the output goes high again and the
			counter is reloaded to the preset value minus one. The
			process repeats in a periodic manner as such.

		software triggered strobe:
			The output signal is initially high. When the count
			expires, the output will go low for one clock pulse and
			then go high again. The counting sequence is "triggered"
			by setting the preset value.

		hardware triggered strobe:
			The output signal is initially high. Counting is started
			by a trigger input signal. When the count expires, the
			output signal will go low for one clock pulse and then
			go high again. A trigger results in loading the counter
			to the preset value.

What:		/sys/bus/counter/devices/counterX/countY/count_mode_available
What:		/sys/bus/counter/devices/counterX/countY/error_noise_available
What:		/sys/bus/counter/devices/counterX/countY/function_available
What:		/sys/bus/counter/devices/counterX/countY/prescaler_available
What:		/sys/bus/counter/devices/counterX/countY/signalZ_action_available
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Discrete set of available values for the respective Count Y
		configuration are listed in this file. Values are delimited by
		newline characters.

What:		/sys/bus/counter/devices/counterX/countY/direction
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates the count direction of Count
		Y. Two count directions are available: forward and backward.

		Some counter devices are able to determine the direction of
		their counting. For example, quadrature encoding counters can
		determine the direction of movement by evaluating the leading
		phase of the respective A and B quadrature encoding signals.
		This attribute exposes such count directions.

What:		/sys/bus/counter/devices/counterX/countY/enable
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Whether channel Y counter is enabled. Valid attribute values are
		boolean.

		This attribute is intended to serve as a pause/unpause mechanism
		for Count Y. Suppose a counter device is used to count the total
		movement of a conveyor belt: this attribute allows an operator
		to temporarily pause the counter, service the conveyor belt,
		and then finally unpause the counter to continue where it had
		left off.

What:		/sys/bus/counter/devices/counterX/countY/error_noise
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates whether excessive noise is
		present at the channel Y counter inputs.

What:		/sys/bus/counter/devices/counterX/countY/function
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Count function mode of Count Y; count function evaluation is
		triggered by conditions specified by the Count Y signalZ_action
		attributes. The following count functions are available:

		increase:
			Accumulated count is incremented.

		decrease:
			Accumulated count is decremented.

		pulse-direction:
			Rising edges on signal A updates the respective count.
			The input level of signal B determines direction.

		quadrature x1 a:
			If direction is forward, rising edges on quadrature pair
			signal A updates the respective count; if the direction
			is backward, falling edges on quadrature pair signal A
			updates the respective count. Quadrature encoding
			determines the direction.

		quadrature x1 b:
			If direction is forward, rising edges on quadrature pair
			signal B updates the respective count; if the direction
			is backward, falling edges on quadrature pair signal B
			updates the respective count. Quadrature encoding
			determines the direction.

		quadrature x2 a:
			Any state transition on quadrature pair signal A updates
			the respective count. Quadrature encoding determines the
			direction.

		quadrature x2 b:
			Any state transition on quadrature pair signal B updates
			the respective count. Quadrature encoding determines the
			direction.

		quadrature x4:
			Any state transition on either quadrature pair signals
			updates	the respective count. Quadrature encoding
			determines the direction.

What:		/sys/bus/counter/devices/counterX/countY/name
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates the device-specific name of
		Count Y. If possible, this should match the name of the
		respective channel as it appears in the device datasheet.

What:		/sys/bus/counter/devices/counterX/countY/prescaler
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Configure the prescaler value associated with Count Y.
		On the FlexTimer, the counter clock source passes through a
		prescaler (i.e. a counter). This acts like a clock
		divider.

What:		/sys/bus/counter/devices/counterX/countY/preset
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		If the counter device supports preset registers -- registers
		used to load counter channels to a set count upon device-defined
		preset operation trigger events -- the preset count for channel
		Y is provided by this attribute.

What:		/sys/bus/counter/devices/counterX/countY/preset_enable
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Whether channel Y counter preset operation is enabled. Valid
		attribute values are boolean.

What:		/sys/bus/counter/devices/counterX/countY/signalZ_action
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Action mode of Count Y for Signal Z. This attribute indicates
		the condition of Signal Z that triggers the count function
		evaluation for Count Y. The following action modes are
		available:

		none:
			Signal does not trigger the count function. In
			Pulse-Direction count function mode, this Signal is
			evaluated as Direction.

		rising edge:
			Low state transitions to high state.

		falling edge:
			High state transitions to low state.

		both edges:
			Any state transition.

What:		/sys/bus/counter/devices/counterX/countY/num_overflows
KernelVersion:	6.1
Contact:	linux-iio@vger.kernel.org
Description:
		This attribute indicates the number of overflows of count Y.

What:		/sys/bus/counter/devices/counterX/cascade_counts_enable_component_id
What:		/sys/bus/counter/devices/counterX/external_input_phase_clock_select_component_id
What:		/sys/bus/counter/devices/counterX/countY/capture_component_id
What:		/sys/bus/counter/devices/counterX/countY/ceiling_component_id
What:		/sys/bus/counter/devices/counterX/countY/floor_component_id
What:		/sys/bus/counter/devices/counterX/countY/count_mode_component_id
What:		/sys/bus/counter/devices/counterX/countY/direction_component_id
What:		/sys/bus/counter/devices/counterX/countY/enable_component_id
What:		/sys/bus/counter/devices/counterX/countY/error_noise_component_id
What:		/sys/bus/counter/devices/counterX/countY/prescaler_component_id
What:		/sys/bus/counter/devices/counterX/countY/preset_component_id
What:		/sys/bus/counter/devices/counterX/countY/preset_enable_component_id
What:		/sys/bus/counter/devices/counterX/countY/signalZ_action_component_id
What:		/sys/bus/counter/devices/counterX/countY/num_overflows_component_id
What:		/sys/bus/counter/devices/counterX/signalY/cable_fault_component_id
What:		/sys/bus/counter/devices/counterX/signalY/cable_fault_enable_component_id
What:		/sys/bus/counter/devices/counterX/signalY/filter_clock_prescaler_component_id
What:		/sys/bus/counter/devices/counterX/signalY/index_polarity_component_id
What:		/sys/bus/counter/devices/counterX/signalY/polarity_component_id
What:		/sys/bus/counter/devices/counterX/signalY/synchronous_mode_component_id
What:		/sys/bus/counter/devices/counterX/signalY/frequency_component_id
KernelVersion:	5.16
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates the component ID of the
		respective extension or Synapse.

What:		/sys/bus/counter/devices/counterX/countY/spike_filter_ns
KernelVersion:	5.14
Contact:	linux-iio@vger.kernel.org
Description:
		If the counter device supports programmable spike filter this
		attribute indicates the value in nanoseconds where noise pulses
		shorter or equal to configured value are ignored. Value 0 means
		filter is disabled.

What:		/sys/bus/counter/devices/counterX/events_queue_size
KernelVersion:	5.16
Contact:	linux-iio@vger.kernel.org
Description:
		Size of the Counter events queue in number of struct
		counter_event data structures. The number of elements will be
		rounded-up to a power of 2.

What:		/sys/bus/counter/devices/counterX/name
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates the device-specific name of
		the Counter. This should match the name of the device as it
		appears in its respective datasheet.

What:		/sys/bus/counter/devices/counterX/num_counts
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates the total number of Counts
		belonging to the Counter.

What:		/sys/bus/counter/devices/counterX/num_signals
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates the total number of Signals
		belonging to the Counter.

What:		/sys/bus/counter/devices/counterX/signalY/cable_fault
KernelVersion:	5.7
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates whether a differential
		encoder cable fault (not connected or loose wires) is detected
		for the respective channel of Signal Y. Valid attribute values
		are boolean. Detection must first be enabled via the
		corresponding cable_fault_enable attribute.

What:		/sys/bus/counter/devices/counterX/signalY/cable_fault_enable
KernelVersion:	5.7
Contact:	linux-iio@vger.kernel.org
Description:
		Whether detection of differential encoder cable faults for the
		respective channel of Signal Y is enabled. Valid attribute
		values are boolean.

What:		/sys/bus/counter/devices/counterX/signalY/filter_clock_prescaler
KernelVersion:	5.7
Contact:	linux-iio@vger.kernel.org
Description:
		Filter clock factor for input Signal Y. This prescaler value
		affects the inputs of both quadrature pair signals.

What:		/sys/bus/counter/devices/counterX/signalY/index_polarity
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Active level of index input Signal Y; irrelevant in
		non-synchronous load mode.

What:		/sys/bus/counter/devices/counterX/signalY/index_polarity_available
What:		/sys/bus/counter/devices/counterX/signalY/synchronous_mode_available
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Discrete set of available values for the respective Signal Y
		configuration are listed in this file.

What:		/sys/bus/counter/devices/counterX/signalY/polarity
KernelVersion:	6.1
Contact:	linux-iio@vger.kernel.org
Description:
		Active level of Signal Y. The following polarity values are
		available:

		positive:
			Signal high state considered active level (rising edge).

		negative:
			Signal low state considered active level (falling edge).

What:		/sys/bus/counter/devices/counterX/signalY/name
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates the device-specific name of
		Signal Y. If possible, this should match the name of the
		respective signal as it appears in the device datasheet.

What:		/sys/bus/counter/devices/counterX/signalY/signal
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Signal level state of Signal Y. The following signal level
		states are available:

		low:
			Low level state.

		high:
			High level state.

What:		/sys/bus/counter/devices/counterX/signalY/synchronous_mode
KernelVersion:	5.2
Contact:	linux-iio@vger.kernel.org
Description:
		Configure the counter associated with Signal Y for
		non-synchronous or synchronous load mode. Synchronous load mode
		cannot be selected in non-quadrature (Pulse-Direction) clock
		mode.

		non-synchronous:
			A logic low level is the active level at this index
			input. The index function (as enabled via preset_enable)
			is performed directly on the active level of the index
			input.

		synchronous:
			Intended for interfacing with encoder Index output in
			quadrature clock mode. The active level is configured
			via index_polarity. The index function (as enabled via
			preset_enable) is performed synchronously with the
			quadrature clock on the active level of the index input.

What:		/sys/bus/counter/devices/counterX/signalY/frequency
KernelVersion:	6.1
Contact:	linux-iio@vger.kernel.org
Description:
		Read-only attribute that indicates the signal Y frequency, in Hz.