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