1*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/count 2*4882a593SmuzhiyunKernelVersion: 5.2 3*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 4*4882a593SmuzhiyunDescription: 5*4882a593Smuzhiyun Count data of Count Y represented as a string. 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/ceiling 8*4882a593SmuzhiyunKernelVersion: 5.2 9*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 10*4882a593SmuzhiyunDescription: 11*4882a593Smuzhiyun Count value ceiling for Count Y. This is the upper limit for the 12*4882a593Smuzhiyun respective counter. 13*4882a593Smuzhiyun 14*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/floor 15*4882a593SmuzhiyunKernelVersion: 5.2 16*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 17*4882a593SmuzhiyunDescription: 18*4882a593Smuzhiyun Count value floor for Count Y. This is the lower limit for the 19*4882a593Smuzhiyun respective counter. 20*4882a593Smuzhiyun 21*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/count_mode 22*4882a593SmuzhiyunKernelVersion: 5.2 23*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 24*4882a593SmuzhiyunDescription: 25*4882a593Smuzhiyun Count mode for channel Y. The ceiling and floor values for 26*4882a593Smuzhiyun Count Y are used by the count mode where required. The following 27*4882a593Smuzhiyun count modes are available: 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun normal: 30*4882a593Smuzhiyun Counting is continuous in either direction. 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun range limit: 33*4882a593Smuzhiyun An upper or lower limit is set, mimicking limit switches 34*4882a593Smuzhiyun in the mechanical counterpart. The upper limit is set to 35*4882a593Smuzhiyun the Count Y ceiling value, while the lower limit is set 36*4882a593Smuzhiyun to the Count Y floor value. The counter freezes at 37*4882a593Smuzhiyun count = ceiling when counting up, and at count = floor 38*4882a593Smuzhiyun when counting down. At either of these limits, the 39*4882a593Smuzhiyun counting is resumed only when the count direction is 40*4882a593Smuzhiyun reversed. 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun non-recycle: 43*4882a593Smuzhiyun The counter is disabled whenever a counter overflow or 44*4882a593Smuzhiyun underflow takes place. The counter is re-enabled when a 45*4882a593Smuzhiyun new count value is loaded to the counter via a preset 46*4882a593Smuzhiyun operation or direct write. 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun modulo-n: 49*4882a593Smuzhiyun A count value boundary is set between the Count Y floor 50*4882a593Smuzhiyun value and the Count Y ceiling value. The counter is 51*4882a593Smuzhiyun reset to the Count Y floor value at count = ceiling when 52*4882a593Smuzhiyun counting up, while the counter is set to the Count Y 53*4882a593Smuzhiyun ceiling value at count = floor when counting down; the 54*4882a593Smuzhiyun counter does not freeze at the boundary points, but 55*4882a593Smuzhiyun counts continuously throughout. 56*4882a593Smuzhiyun 57*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/count_mode_available 58*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/error_noise_available 59*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/function_available 60*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/signalZ_action_available 61*4882a593SmuzhiyunKernelVersion: 5.2 62*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 63*4882a593SmuzhiyunDescription: 64*4882a593Smuzhiyun Discrete set of available values for the respective Count Y 65*4882a593Smuzhiyun configuration are listed in this file. Values are delimited by 66*4882a593Smuzhiyun newline characters. 67*4882a593Smuzhiyun 68*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/direction 69*4882a593SmuzhiyunKernelVersion: 5.2 70*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 71*4882a593SmuzhiyunDescription: 72*4882a593Smuzhiyun Read-only attribute that indicates the count direction of Count 73*4882a593Smuzhiyun Y. Two count directions are available: forward and backward. 74*4882a593Smuzhiyun 75*4882a593Smuzhiyun Some counter devices are able to determine the direction of 76*4882a593Smuzhiyun their counting. For example, quadrature encoding counters can 77*4882a593Smuzhiyun determine the direction of movement by evaluating the leading 78*4882a593Smuzhiyun phase of the respective A and B quadrature encoding signals. 79*4882a593Smuzhiyun This attribute exposes such count directions. 80*4882a593Smuzhiyun 81*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/enable 82*4882a593SmuzhiyunKernelVersion: 5.2 83*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 84*4882a593SmuzhiyunDescription: 85*4882a593Smuzhiyun Whether channel Y counter is enabled. Valid attribute values are 86*4882a593Smuzhiyun boolean. 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun This attribute is intended to serve as a pause/unpause mechanism 89*4882a593Smuzhiyun for Count Y. Suppose a counter device is used to count the total 90*4882a593Smuzhiyun movement of a conveyor belt: this attribute allows an operator 91*4882a593Smuzhiyun to temporarily pause the counter, service the conveyor belt, 92*4882a593Smuzhiyun and then finally unpause the counter to continue where it had 93*4882a593Smuzhiyun left off. 94*4882a593Smuzhiyun 95*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/error_noise 96*4882a593SmuzhiyunKernelVersion: 5.2 97*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 98*4882a593SmuzhiyunDescription: 99*4882a593Smuzhiyun Read-only attribute that indicates whether excessive noise is 100*4882a593Smuzhiyun present at the channel Y counter inputs. 101*4882a593Smuzhiyun 102*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/function 103*4882a593SmuzhiyunKernelVersion: 5.2 104*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 105*4882a593SmuzhiyunDescription: 106*4882a593Smuzhiyun Count function mode of Count Y; count function evaluation is 107*4882a593Smuzhiyun triggered by conditions specified by the Count Y signalZ_action 108*4882a593Smuzhiyun attributes. The following count functions are available: 109*4882a593Smuzhiyun 110*4882a593Smuzhiyun increase: 111*4882a593Smuzhiyun Accumulated count is incremented. 112*4882a593Smuzhiyun 113*4882a593Smuzhiyun decrease: 114*4882a593Smuzhiyun Accumulated count is decremented. 115*4882a593Smuzhiyun 116*4882a593Smuzhiyun pulse-direction: 117*4882a593Smuzhiyun Rising edges on signal A updates the respective count. 118*4882a593Smuzhiyun The input level of signal B determines direction. 119*4882a593Smuzhiyun 120*4882a593Smuzhiyun quadrature x1 a: 121*4882a593Smuzhiyun If direction is forward, rising edges on quadrature pair 122*4882a593Smuzhiyun signal A updates the respective count; if the direction 123*4882a593Smuzhiyun is backward, falling edges on quadrature pair signal A 124*4882a593Smuzhiyun updates the respective count. Quadrature encoding 125*4882a593Smuzhiyun determines the direction. 126*4882a593Smuzhiyun 127*4882a593Smuzhiyun quadrature x1 b: 128*4882a593Smuzhiyun If direction is forward, rising edges on quadrature pair 129*4882a593Smuzhiyun signal B updates the respective count; if the direction 130*4882a593Smuzhiyun is backward, falling edges on quadrature pair signal B 131*4882a593Smuzhiyun updates the respective count. Quadrature encoding 132*4882a593Smuzhiyun determines the direction. 133*4882a593Smuzhiyun 134*4882a593Smuzhiyun quadrature x2 a: 135*4882a593Smuzhiyun Any state transition on quadrature pair signal A updates 136*4882a593Smuzhiyun the respective count. Quadrature encoding determines the 137*4882a593Smuzhiyun direction. 138*4882a593Smuzhiyun 139*4882a593Smuzhiyun quadrature x2 b: 140*4882a593Smuzhiyun Any state transition on quadrature pair signal B updates 141*4882a593Smuzhiyun the respective count. Quadrature encoding determines the 142*4882a593Smuzhiyun direction. 143*4882a593Smuzhiyun 144*4882a593Smuzhiyun quadrature x4: 145*4882a593Smuzhiyun Any state transition on either quadrature pair signals 146*4882a593Smuzhiyun updates the respective count. Quadrature encoding 147*4882a593Smuzhiyun determines the direction. 148*4882a593Smuzhiyun 149*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/name 150*4882a593SmuzhiyunKernelVersion: 5.2 151*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 152*4882a593SmuzhiyunDescription: 153*4882a593Smuzhiyun Read-only attribute that indicates the device-specific name of 154*4882a593Smuzhiyun Count Y. If possible, this should match the name of the 155*4882a593Smuzhiyun respective channel as it appears in the device datasheet. 156*4882a593Smuzhiyun 157*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/preset 158*4882a593SmuzhiyunKernelVersion: 5.2 159*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 160*4882a593SmuzhiyunDescription: 161*4882a593Smuzhiyun If the counter device supports preset registers -- registers 162*4882a593Smuzhiyun used to load counter channels to a set count upon device-defined 163*4882a593Smuzhiyun preset operation trigger events -- the preset count for channel 164*4882a593Smuzhiyun Y is provided by this attribute. 165*4882a593Smuzhiyun 166*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/preset_enable 167*4882a593SmuzhiyunKernelVersion: 5.2 168*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 169*4882a593SmuzhiyunDescription: 170*4882a593Smuzhiyun Whether channel Y counter preset operation is enabled. Valid 171*4882a593Smuzhiyun attribute values are boolean. 172*4882a593Smuzhiyun 173*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/countY/signalZ_action 174*4882a593SmuzhiyunKernelVersion: 5.2 175*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 176*4882a593SmuzhiyunDescription: 177*4882a593Smuzhiyun Action mode of Count Y for Signal Z. This attribute indicates 178*4882a593Smuzhiyun the condition of Signal Z that triggers the count function 179*4882a593Smuzhiyun evaluation for Count Y. The following action modes are 180*4882a593Smuzhiyun available: 181*4882a593Smuzhiyun 182*4882a593Smuzhiyun none: 183*4882a593Smuzhiyun Signal does not trigger the count function. In 184*4882a593Smuzhiyun Pulse-Direction count function mode, this Signal is 185*4882a593Smuzhiyun evaluated as Direction. 186*4882a593Smuzhiyun 187*4882a593Smuzhiyun rising edge: 188*4882a593Smuzhiyun Low state transitions to high state. 189*4882a593Smuzhiyun 190*4882a593Smuzhiyun falling edge: 191*4882a593Smuzhiyun High state transitions to low state. 192*4882a593Smuzhiyun 193*4882a593Smuzhiyun both edges: 194*4882a593Smuzhiyun Any state transition. 195*4882a593Smuzhiyun 196*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/name 197*4882a593SmuzhiyunKernelVersion: 5.2 198*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 199*4882a593SmuzhiyunDescription: 200*4882a593Smuzhiyun Read-only attribute that indicates the device-specific name of 201*4882a593Smuzhiyun the Counter. This should match the name of the device as it 202*4882a593Smuzhiyun appears in its respective datasheet. 203*4882a593Smuzhiyun 204*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/num_counts 205*4882a593SmuzhiyunKernelVersion: 5.2 206*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 207*4882a593SmuzhiyunDescription: 208*4882a593Smuzhiyun Read-only attribute that indicates the total number of Counts 209*4882a593Smuzhiyun belonging to the Counter. 210*4882a593Smuzhiyun 211*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/num_signals 212*4882a593SmuzhiyunKernelVersion: 5.2 213*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 214*4882a593SmuzhiyunDescription: 215*4882a593Smuzhiyun Read-only attribute that indicates the total number of Signals 216*4882a593Smuzhiyun belonging to the Counter. 217*4882a593Smuzhiyun 218*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/signalY/signal 219*4882a593SmuzhiyunKernelVersion: 5.2 220*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 221*4882a593SmuzhiyunDescription: 222*4882a593Smuzhiyun Signal data of Signal Y represented as a string. 223*4882a593Smuzhiyun 224*4882a593SmuzhiyunWhat: /sys/bus/counter/devices/counterX/signalY/name 225*4882a593SmuzhiyunKernelVersion: 5.2 226*4882a593SmuzhiyunContact: linux-iio@vger.kernel.org 227*4882a593SmuzhiyunDescription: 228*4882a593Smuzhiyun Read-only attribute that indicates the device-specific name of 229*4882a593Smuzhiyun Signal Y. If possible, this should match the name of the 230*4882a593Smuzhiyun respective signal as it appears in the device datasheet. 231