Quadrature encoders, such as rotary encoders and linear encoders, are devices which are capable of encoding the relative position and direction of motion of a shaft. This patch introduces several IIO constants for supporting quadrature encoder counter devices. IIO_COUNT: Current count (main data provided by the counter device) IIO_INDEX: Counter device index value
Unified · Split
| @@ -329,6 +329,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_pressure_scale · 328 unmodified lines | ||
| 329 | 329 | What: /sys/bus/iio/devices/iio:deviceX/in_humidityrelative_scale |
| 330 | 330 | What: /sys/bus/iio/devices/iio:deviceX/in_velocity_sqrt(x^2+y^2+z^2)_scale |
| 331 | 331 | What: /sys/bus/iio/devices/iio:deviceX/in_illuminance_scale |
| 332 | +What: /sys/bus/iio/devices/iio:deviceX/in_countY_scale | |
| 332 | 333 | KernelVersion: 2.6.35 |
| 333 | 334 | Contact: linux-iio@vger.kernel.org |
| 334 | 335 | Description: |
| @@ -1579,3 +1580,20 @@ Contact: linux-iio@vger.kernel.org · 1244 unmodified lines | ||
| 1579 | 1580 | Description: |
| 1580 | 1581 | Raw (unscaled no offset etc.) electric conductivity reading that |
| 1581 | 1582 | can be processed to siemens per meter. |
| 1583 | + | |
| 1584 | +What: /sys/bus/iio/devices/iio:deviceX/in_countY_raw | |
| 1585 | +KernelVersion: 4.9 | |
| 1586 | +Contact: linux-iio@vger.kernel.org | |
| 1587 | +Description: | |
| 1588 | + Raw counter device counts from channel Y. For quadrature | |
| 1589 | + counters, multiplication by an available [Y]_scale results in | |
| 1590 | + the counts of a single quadrature signal phase from channel Y. | |
| 1591 | + | |
| 1592 | +What: /sys/bus/iio/devices/iio:deviceX/in_indexY_raw | |
| 1593 | +KernelVersion: 4.9 | |
| 1594 | +Contact: linux-iio@vger.kernel.org | |
| 1595 | +Description: | |
| 1596 | + Raw counter device index value from channel Y. This attribute | |
| 1597 | + provides an absolute positional reference (e.g. a pulse once per | |
| 1598 | + revolution) which may be used to home positional systems as | |
| 1599 | + required. | |
| @@ -81,6 +81,8 @@ static const char * const iio_chan_type_name_spec[] = { · 80 unmodified lines | ||
| 81 | 81 | [IIO_PH] = "ph", |
| 82 | 82 | [IIO_UVINDEX] = "uvindex", |
| 83 | 83 | [IIO_ELECTRICALCONDUCTIVITY] = "electricalconductivity", |
| 84 | + [IIO_COUNT] = "count", | |
| 85 | + [IIO_INDEX] = "index", | |
| 84 | 86 | }; |
| 85 | 87 | |
| 86 | 88 | static const char * const iio_modifier_names[] = { |
| @@ -40,6 +40,8 @@ enum iio_chan_type { · 39 unmodified lines | ||
| 40 | 40 | IIO_PH, |
| 41 | 41 | IIO_UVINDEX, |
| 42 | 42 | IIO_ELECTRICALCONDUCTIVITY, |
| 43 | + IIO_COUNT, | |
| 44 | + IIO_INDEX, | |
| 43 | 45 | }; |
| 44 | 46 | |
| 45 | 47 | enum iio_modifier { |