Part 1
요약·해설
공식 원문 427줄과 property 36행을 전수 대조해 pincfg-node defaults·port/line/function bit encoding·AF0~AF15/analog/GPIO cases·G0/C0/F070 remap restrictions·four slew levels 제약을 보존했습니다.
st,stm32-pinctrl
STMicroelectronics
36 rows
STM32 port/line/function encoding + remap/bias/drive/speed controls
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
7E2E6109EB93FF18EEB8613F340C637A54A80C673177539869D1B45E12FCEC98
:orphan:
.. raw:: html
<!--
FIXME: do not limit page width until content uses another representation
format other than tables
-->
<style>.wy-nav-content { max-width: none; !important }</style>
.. dtcompatible:: st,stm32-pinctrl
.. _dtbinding_st_stm32_pinctrl:
st,stm32-pinctrl
################
Vendor: :ref:`STMicroelectronics <dt_vendor_st>`
Description
***********
.. code-block:: none
STM32 Pin controller Node
Based on pincfg-node.yaml binding.
Note: `bias-disable` and `drive-push-pull` are default pin configurations.
They will be applied in case no `bias-foo` or `driver-bar` properties
are set.
Properties
**********
Top level properties
====================
These property descriptions apply to "st,stm32-pinctrl"
nodes themselves. This page also describes child node
properties in the following sections.
.. 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
* - ``remap-pa11``
- ``boolean``
- .. code-block:: none
Remaps the PA11 pin to operate as PA9 pin. Use of this property is restricted to STM32G0 and STM32C0 SoCs.
* - ``remap-pa12``
- ``boolean``
- .. code-block:: none
Remaps the PA12 pin to operate as PA10 pin. Use of this property is restricted to STM32G0 and STM32C0 SoCs.
* - ``remap-pa11-pa12``
- ``boolean``
- .. code-block:: none
Remaps the PA11/PA12 pin to operate as PA9/PA10 pin. Use of this property is restricted to STM32F070x SoCs.
.. 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-pinctrl" compatible.
.. list-table::
:widths: 1 1 4
:header-rows: 1
* - Name
- Type
- Details
* - ``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.
* - ``power-domain``
- ``phandle``
- .. code-block:: none
Power domain the device belongs to.
The device will be notified when the power domain it belongs to is either
suspended or resumed.
* - ``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.
* - ``status``
- ``string``
- .. code-block:: none
indicates the operational status of a device
Legal values: ``'ok'``, ``'okay'``, ``'disabled'``, ``'reserved'``, ``'fail'``, ``'fail-sss'``
See :ref:`dt-important-props` for more information.
* - ``compatible``
- ``string-array``
- .. code-block:: none
compatible strings
This property is **required**.
See :ref:`dt-important-props` for more information.
* - ``reg``
- ``array``
- .. code-block:: none
register space
This property is **required**.
See :ref:`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:`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:`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
* - ``zephyr,deferred-init``
- ``boolean``
- .. code-block:: none
Do not initialize device automatically on boot. Device should be manually
initialized using device_init().
Child node properties
=====================
.. list-table::
:widths: 1 1 4
:header-rows: 1
* - Name
- Type
- Details
* - ``bias-disable``
- ``boolean``
- .. code-block:: none
disable any pin bias
* - ``bias-pull-up``
- ``boolean``
- .. code-block:: none
enable pull-up resistor
* - ``bias-pull-down``
- ``boolean``
- .. code-block:: none
enable pull-down resistor
* - ``drive-push-pull``
- ``boolean``
- .. code-block:: none
drive actively high and low
* - ``drive-open-drain``
- ``boolean``
- .. code-block:: none
drive with open drain (hardware AND)
* - ``output-low``
- ``boolean``
- .. code-block:: none
set the pin to output mode with low level
* - ``output-high``
- ``boolean``
- .. code-block:: none
set the pin to output mode with high level
* - ``pinmux``
- ``int``
- .. code-block:: none
Reused from
https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
Integer array, represents gpio pin number and mux setting.
These defines are calculated as: ((port * 16 + line) << 8) | function
With:
- port: The gpio port index (PA = 0, PB = 1, ..., PK = 11)
- line: The line offset within the port (PA0 = 0, PA1 = 1, ..., PA15 = 15)
- function: The function number, can be:
* 0 : Alternate Function 0
* 1 : Alternate Function 1
* 2 : Alternate Function 2
* ...
* 15 : Alternate Function 15
* 16 : Analog
* 17 : GPIO
In case selected pin function is GPIO, pin is statically configured as
a plain input/output GPIO. Default configuration is input. Output value
can be configured by adding 'ouptut-low' or 'output-high' properties
to the pin configuration.
To simplify the usage, macro is available to generate "pinmux" field.
This macro is available here:
-include/zephyr/dt-bindings/pinctrl/stm32-pinctrl-common.h
Some examples of macro usage:
GPIO A9 set as alternate function 2
... {
pinmux = <STM32_PINMUX('A', 9, AF2)>;
};
GPIO A9 set as analog
... {
pinmux = <STM32_PINMUX('A', 9, ANALOG)>;
};
GPIO A9 set as GPIO output high
... {
pinmux = <STM32_PINMUX('A', 9, GPIO)>;
output-high;
};
This property is **required**.
* - ``slew-rate``
- ``string``
- .. code-block:: none
Pin speed. Default to low-speed. For few pins (PA11 and
PB3 depending on SoCs)hardware reset value could differ
(very-high-speed). Carefully check reference manual for these pins.
Default value: ``low-speed``
Legal values: ``'low-speed'``, ``'medium-speed'``, ``'high-speed'``, ``'very-high-speed'``
Part 3
한국어 전문 번역
st,stm32-pinctrl
Vendor: STMicroelectronics
공식 설명
STM32 Pin controller node입니다. pincfg-node.yaml binding을 기반으로 합니다.
bias-disable과 drive-push-pull은 기본 pin configuration입니다. bias-* 또는 driver-* property가 없으면 이 기본값이 적용됩니다.Port·line·function을 integer 하나로 encoding
STM32_PINMUX('A', 9, AF2)는 PA9 AF2를 선택합니다. Function 16은 analog, 17은 GPIO이며 GPIO 기본 방향은 input입니다.
A · 9
AF0~15 · analog · GPIO
Bias · push-pull/open-drain · output value
Four speeds · SoC-limited PA remap
PA11/PA12 remap property는 지정된 G0/C0/F070 계열에서만 유효합니다. 원문의 ouptut-low 오탈자는 영어 원문에 보존하고 한국어 설명에서는 정확한 property 이름을 사용합니다.
속성 전체 번역
공식 node-specific 3개, base 24개, child 9개 property를 모두 번역했습니다.
노드 전용 속성 · 3개
| 이름 | 형식 | 설명과 제약 |
|---|---|---|
remap-pa11 | boolean | PA11을 PA9 pin처럼 동작하도록 remap합니다. STM32G0과 STM32C0 SoC에서만 사용할 수 있습니다. |
remap-pa12 | boolean | PA12를 PA10 pin처럼 동작하도록 remap합니다. STM32G0과 STM32C0 SoC에서만 사용할 수 있습니다. |
remap-pa11-pa12 | boolean | PA11/PA12를 PA9/PA10 pin처럼 동작하도록 함께 remap합니다. STM32F070x SoC에서만 사용할 수 있습니다. |
Base binding property · 24개
공통 기본 바인딩에서 상속한 속성입니다. 이 compatible에서 사용하지 않는 속성도 공식 참조 문서에 실려 있으면 함께 표시합니다.
| 이름 | 형식 | 설명과 제약 |
|---|---|---|
wakeup-source | boolean | 이 장치를 시스템 깨우기에 사용할 수 있음을 나타냅니다. 이 속성이 있으면 깨우기 지원 플래그가 설정됩니다. 기본 상태에서는 장치의 인터럽트로 시스템을 깨우지 않으며, 실행 중에 깨우기 기능을 활성화할 수 있습니다. |
power-domain | phandle | 장치가 속한 전원 도메인의 phandle입니다. 해당 전원 도메인이 일시 중단되거나 다시 동작하면 장치에 알림이 전달됩니다. |
zephyr,pm-device-runtime-auto | boolean | 초기화 함수 실행 후 장치의 런타임 전원 관리를 자동으로 설정합니다. |
zephyr,disabling-power-states | phandles | 이 장치의 전원이 꺼지는 전원 상태 목록입니다. |
status | string | 장치의 동작 상태를 나타냅니다. 허용값: 'ok', 'okay', 'disabled', 'reserved', 'fail', 'fail-sss' |
compatible | string-array | 이 노드에 적용할 바인딩과 드라이버를 식별하는 compatible 문자열 목록입니다. 필수 |
reg | array | 장치 레지스터의 주소 범위를 지정합니다. 필수 |
reg-names | string-array | 각 register space의 이름입니다. |
interrupts | array | 장치에서 사용하는 인터럽트를 지정하는 목록입니다. |
interrupts-extended | compound | 인터럽트 컨트롤러의 phandle을 함께 지정하는 확장 형식의 인터럽트 명세입니다. |
interrupt-names | string-array | 각 interrupt의 이름입니다. |
interrupt-parent | phandle | 인터럽트 컨트롤러 노드를 가리키는 phandle입니다. |
label | string | 사람이 장치를 알아볼 수 있도록 붙이는 이름입니다. 과거에는 device_get_binding()의 인자로 사용했습니다. 사용 중단됨 |
clocks | phandle-array | 클록 게이트 또는 클록 공급원을 지정하는 phandle 배열입니다. |
clock-names | string-array | 각 clock의 이름입니다. |
#address-cells | int | 하위 노드의 reg 속성에서 주소를 나타내는 데 쓰는 셀 수입니다. |
#size-cells | int | 하위 노드의 reg 속성에서 크기를 나타내는 데 쓰는 셀 수입니다. |
dmas | phandle-array | DMA 채널을 지정하는 phandle 배열입니다. |
dma-names | string-array | 지정한 DMA 채널의 이름입니다. |
io-channels | phandle-array | I/O 채널을 지정하는 phandle 배열입니다. |
io-channel-names | string-array | 지정한 I/O 채널의 이름입니다. |
mboxes | phandle-array | 메일박스/IPM 채널을 지정하는 phandle 배열입니다. |
mbox-names | string-array | 지정한 메일박스/IPM 채널의 이름입니다. |
zephyr,deferred-init | boolean | 부팅할 때 장치를 자동으로 초기화하지 않습니다. 이후 device_init()를 호출해 직접 초기화해야 합니다. |
하위 노드 속성 · 9개
각 하위 노드에 적용되는 속성입니다.
| 이름 | 형식 | 설명과 제약 |
|---|---|---|
bias-disable | boolean | Pin의 모든 bias를 비활성화합니다. |
bias-pull-up | boolean | Pin의 pull-up resistor를 활성화합니다. |
bias-pull-down | boolean | Pin의 pull-down resistor를 활성화합니다. |
drive-push-pull | boolean | Pin을 high와 low 모두 능동 구동하는 push-pull mode로 설정합니다. |
drive-open-drain | boolean | Pin을 hardware AND 방식의 open-drain mode로 구동합니다. |
output-low | boolean | Pin을 output mode로 전환하고 low level을 출력합니다. |
output-high | boolean | Pin을 output mode로 전환하고 high level을 출력합니다. |
pinmux | int | GPIO pin number와 mux setting을 담는 integer array이며 ((port * 16 + line) << 8) | function으로 계산합니다. Function 0~15는 AF0~AF15, 16은 analog, 17은 GPIO입니다. STM32_PINMUX macro를 사용할 수 있으며 필수입니다. GPIO 선택 시 기본은 input이고 output-low/high로 static output 값을 지정합니다.필수 |
slew-rate | string | Pin speed를 low, medium, high, very-high에서 선택합니다. 기본은 low-speed지만 일부 SoC의 PA11/PB3 reset은 very-high일 수 있으므로 reference manual을 확인해야 합니다. 기본값: low-speed · 허용값: 'low-speed', 'medium-speed', 'high-speed', 'very-high-speed' |
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.