The latest development version of this page may be more current than this released 3.7.0 version.

st,stm32-qdec

Vendor: STMicroelectronics

Description

STM32 quadrature decoder

Properties

Properties not inherited from the base binding file.

Name

Type

Details

pinctrl-0

phandles

Pin configuration/s for the first state. Content is specific to the
selected pin controller driver implementation.

This property is required.

pinctrl-1

phandles

Pin configuration/s for the second state. See pinctrl-0.

pinctrl-2

phandles

Pin configuration/s for the third state. See pinctrl-0.

pinctrl-3

phandles

Pin configuration/s for the fourth state. See pinctrl-0.

pinctrl-4

phandles

Pin configuration/s for the fifth state. See pinctrl-0.

pinctrl-names

string-array

Names for the provided states. The number of names needs to match the
number of states.

This property is required.

st,encoder-mode

int

Set encoder mode.
The following modes are supported:
0x1: Encoder mode 1 (Default)
0x2: Encoder mode 2
0x3: Encoder mode 3
Some MCUs supports additional modes:
0x10002: Encoder mode: Clock plus direction, x2 mode
0x10003: Encoder mode: Clock plus direction, x1 mode
0x10004: Encoder mode: Directional Clock, x2 mode
0x10005: Encoder mode: Directional Clock, x1 mode
0x10006: Quadrature encoder mode: x1 mode, counting on tim_ti1fp1
0x10007: Quadrature encoder mode: x1 mode, counting on tim_ti2fp2
Default value complies with stm32 low level timer encoder init value.

Default value: 1

Legal values: 1, 2, 3, 65538, 65539, 65540, 65541, 65542, 65543

st,input-polarity-inverted

boolean

Encoder is triggered by a falling edge on the input pin

st,input-filter-level

int

Intensity of the filter applied to the input signal. This is
implemented by scaling the sampling frequency and adding a counter
in which N consecutive samples with same value are needed to validate
a transition.
Mapping is as follows (F_clk is the timer's clock):
0: No filter, sampling is done at F_dts (default value)
1: Fs = F_clk, N=2
2: Fs = F_clk, N=4
3: Fs = F_clk, N=8
4: Fs = F_clk/2, N=6
5: Fs = F_clk/2, N=8
6: Fs = F_clk/4, N=6
7: Fs = F_clk/4, N=8
8: Fs = F_clk/8, N=6
9: Fs = F_clk/8, N=8
10: Fs = F_clk/16, N=5
11: Fs = F_clk/16, N=6
12: Fs = F_clk/16, N=8
13: Fs = F_clk/32, N=5
14: Fs = F_clk/32, N=6
15: Fs = F_clk/32, N=8
Default value is set by hardware at reset

Legal values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15

st,counts-per-revolution

int

This is a number >= 1 that is used to determine how many revolutions
were done based on the current counter's value.

This property is required.