1# Copyright (c) 2022, Prevas A/S
2# SPDX-License-Identifier: Apache-2.0
3
4description: NXP MCUX QDEC
5
6compatible: "nxp,mcux-qdec"
7
8include: [pinctrl-device.yaml, sensor-device.yaml]
9
10properties:
11  reg:
12    required: true
13
14  interrupts:
15    required: true
16
17  counts-per-revolution:
18    type: int
19    required: true
20    description: |
21      This is a number that is used to determine how many revolutions
22      were done based on the current counter's value.
23
24  single-phase-mode:
25    type: boolean
26    description: |
27      Bypass the quadrature decoder. A positive transition of the PHASEA input
28      generates a count signal. The PHASEB input and the REV bit control the
29      counter direction.
30
31  filter-count:
32    type: int
33    enum: [0, 1, 2, 3, 4, 5, 6, 7]
34    description: |
35      The number of consecutive samples that must agree prior to the input
36      filter accepting an input transition. A value of 0 represents 3
37      samples. A value of 7 represents 10 samples.
38
39  filter-sample-period:
40    type: int
41    description: |
42      The sampling period (in IPBus clock cycles) of the decoder input signals.
43      Each input is sampled multiple times at the rate specified by the Filter
44      Sample Period. If FILT_PER is 0 (default), then the input filter is
45      bypassed. Bypassing the digital filter enables the position/position
46      difference counters to operate with count rates up to the IPBus
47      frequency. Turning on the input filter introduces a latency of:
48      ((FILT_CNT + 3) * FILT_PER) FILT clock cycles + 2 IPBus clock periods.
49
50  xbar:
51    type: phandle
52    required: true
53    description: |
54      The xbar phandle.
55