If you need urgent consulting help click here

st,stm32-pinctrl

Vendor: STMicroelectronics

Description

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.

Properties not inherited from the base binding file.

Name

Type

Details

remap-pa11

boolean

Remaps the PA11 pin to operate as PA9 pin. Use of this property is restricted to STM32G0 SoCs.

remap-pa12

boolean

Remaps the PA12 pin to operate as PA10 pin. Use of this property is restricted to STM32G0 SoCs.

remap-pa11-pa12

boolean

Remaps the PA11/PA12 pin to operate as PA9/PA10 pin. Use of this property is restricted to STM32F070x SoCs.

Deprecated properties not inherited from the base binding file.

(None)

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.

Name

Type

Details

reg

array

register space

This property is required.

See Important properties for more information.

status

string

indicates the operational status of a device

Legal values: 'ok', 'okay', 'disabled', 'reserved', 'fail', 'fail-sss'

See Important properties for more information.

compatible

string-array

compatible strings

This property is required.

See Important properties for more information.

reg-names

string-array

name of each register space

interrupts

array

interrupts for device

See Important properties for more information.

interrupts-extended

compound

extended interrupt specifier for device

interrupt-names

string-array

name of each interrupt

interrupt-parent

phandle

phandle to interrupt controller node

label

string

Human readable string describing the device (used as device_get_binding() argument)

See Important properties for more information.

clocks

phandle-array

Clock gate information

clock-names

string-array

name of each clock

#address-cells

int

number of address cells in reg property

#size-cells

int

number of size cells in reg property

dmas

phandle-array

DMA channels specifiers

dma-names

string-array

Provided names of DMA channel specifiers

io-channels

phandle-array

IO channels specifiers

io-channel-names

string-array

Provided names of IO channel specifiers

mboxes

phandle-array

mailbox / IPM channels specifiers

mbox-names

string-array

Provided names of mailbox / IPM channel specifiers

wakeup-source

boolean

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

Power domain the device belongs to.

The device will be notified when the power domain it belongs to is either
suspended or resumed.

Child node properties

Name

Type

Details

pinmux

int

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 alernate 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

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'

bias-disable

boolean

disable any pin bias

bias-pull-up

boolean

enable pull-up resistor

bias-pull-down

boolean

enable pull-down resistor

drive-push-pull

boolean

drive actively high and low

drive-open-drain

boolean

drive with open drain (hardware AND)

output-low

boolean

set the pin to output mode with low level

output-high

boolean

set the pin to output mode with high level