:orphan: .. raw:: html .. dtcompatible:: st,stm32-qdec .. _dtbinding_st_stm32_qdec: st,stm32-qdec ############# Vendor: :ref:`STMicroelectronics N.V. ` .. note:: An implementation of a driver matching this compatible is available in :zephyr_file:`drivers/sensor/st/qdec_stm32/qdec_stm32.c`. Description *********** .. code-block:: none STM32 quadrature decoder Properties ********** .. tabs:: .. group-tab:: Node specific properties Properties not inherited from the base binding file. .. list-table:: :widths: 1 1 4 :header-rows: 1 * - Name - Type - Details * - ``pinctrl-0`` - ``phandles`` - .. code-block:: none Pin configuration/s for the first state. Content is specific to the selected pin controller driver implementation. This property is **required**. * - ``pinctrl-names`` - ``string-array`` - .. code-block:: none Names for the provided states. The number of names needs to match the number of states. This property is **required**. * - ``st,encoder-mode`` - ``int`` - .. code-block:: none 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`` - .. code-block:: none Encoder is triggered by a falling edge on the input pin * - ``st,input-filter-level`` - ``int`` - .. code-block:: none 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`` - .. code-block:: none 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**. * - ``pinctrl-1`` - ``phandles`` - .. code-block:: none Pin configuration/s for the second state. See pinctrl-0. * - ``pinctrl-2`` - ``phandles`` - .. code-block:: none Pin configuration/s for the third state. See pinctrl-0. * - ``pinctrl-3`` - ``phandles`` - .. code-block:: none Pin configuration/s for the fourth state. See pinctrl-0. * - ``pinctrl-4`` - ``phandles`` - .. code-block:: none Pin configuration/s for the fifth state. See pinctrl-0. .. group-tab:: Deprecated node specific properties Deprecated properties not inherited from the base binding file. (None) .. group-tab:: Base properties Properties inherited from the base binding file, which defines common properties that may be set on many nodes. Not all of these may apply to the "st,stm32-qdec" compatible. .. list-table:: :widths: 1 1 4 :header-rows: 1 * - Name - Type - Details * - ``status`` - ``string`` - .. code-block:: none indicates the operational status of a device Legal values: ``'ok'``, ``'okay'``, ``'disabled'``, ``'reserved'``, ``'fail'``, ``'fail-sss'`` See :ref:`zephyr:dt-important-props` for more information. * - ``compatible`` - ``string-array`` - .. code-block:: none compatible strings This property is **required**. See :ref:`zephyr:dt-important-props` for more information. * - ``reg`` - ``array`` - .. code-block:: none register space See :ref:`zephyr:dt-important-props` for more information. * - ``reg-names`` - ``string-array`` - .. code-block:: none name of each register space * - ``interrupts`` - ``array`` - .. code-block:: none interrupts for device See :ref:`zephyr:dt-important-props` for more information. * - ``interrupts-extended`` - ``compound`` - .. code-block:: none extended interrupt specifier for device * - ``interrupt-names`` - ``string-array`` - .. code-block:: none name of each interrupt * - ``interrupt-parent`` - ``phandle`` - .. code-block:: none phandle to interrupt controller node * - ``label`` - ``string`` - .. code-block:: none Human readable string describing the device (used as device_get_binding() argument) See :ref:`zephyr:dt-important-props` for more information. This property is **deprecated**. * - ``clocks`` - ``phandle-array`` - .. code-block:: none Clock gate information * - ``clock-names`` - ``string-array`` - .. code-block:: none name of each clock * - ``#address-cells`` - ``int`` - .. code-block:: none number of address cells in reg property * - ``#size-cells`` - ``int`` - .. code-block:: none number of size cells in reg property * - ``dmas`` - ``phandle-array`` - .. code-block:: none DMA channels specifiers * - ``dma-names`` - ``string-array`` - .. code-block:: none Provided names of DMA channel specifiers * - ``io-channels`` - ``phandle-array`` - .. code-block:: none IO channels specifiers * - ``io-channel-names`` - ``string-array`` - .. code-block:: none Provided names of IO channel specifiers * - ``mboxes`` - ``phandle-array`` - .. code-block:: none mailbox / IPM channels specifiers * - ``mbox-names`` - ``string-array`` - .. code-block:: none Provided names of mailbox / IPM channel specifiers * - ``power-domains`` - ``phandle-array`` - .. code-block:: none Power domain specifiers * - ``power-domain-names`` - ``string-array`` - .. code-block:: none Provided names of power domain specifiers * - ``#power-domain-cells`` - ``int`` - .. code-block:: none Number of cells in power-domains property * - ``zephyr,deferred-init`` - ``boolean`` - .. code-block:: none Do not initialize device automatically on boot. Device should be manually initialized using device_init(). * - ``wakeup-source`` - ``boolean`` - .. code-block:: none Property to identify that a device can be used as wake up source. When this property is provided a specific flag is set into the device that tells the system that the device is capable of wake up the system. Wake up capable devices are disabled (interruptions will not wake up the system) by default but they can be enabled at runtime if necessary. * - ``zephyr,pm-device-runtime-auto`` - ``boolean`` - .. code-block:: none Automatically configure the device for runtime power management after the init function runs. * - ``zephyr,disabling-power-states`` - ``phandles`` - .. code-block:: none List of power states that will disable this device power.