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

infineon,xmc4xxx-pinctrl

Vendor: Infineon Technologies

Note

An implementation of a driver matching this compatible is available in drivers/pinctrl/pinctrl_xmc4xxx.c.

Description

The Infineon XMC4XXX pin controller is responsible for connecting peripheral outputs
to specific port/pins (also known as alternate functions) and configures pin properties.

The pinctrl settings are referenced in a device tree peripheral node. For example in a UART
node:

&usic1ch1 {
    compatible = "infineon,xmc4xxx-uart";
    pinctrl-0 = <&uart_tx_p0_1_u1c1 &uart_rx_p0_0_u1c1>;
    pinctrl-names = "default";
    input-src = "DX0D";
    ...
};

pinctrl-0 is the phandle that stores the pin settings for two pins: &uart_tx_p0_1_u1c1
and &uart_rx_p0_0_u1c1. These nodes are pre-defined and their naming convention is designed
to help the user select the correct pin settings. Note the use of peripheral type,
pin direction, port/pin number and USIC in the name.

The pre-defined nodes only set the alternate function of the output pin. The
configuration for the pin (i.e. drive strength) should be set in the board setup.
The set of possible configurations are defined in the properties section below (in addition
to the inherited property-allowlist list from pincfg-node.yaml).

To create a new pin configuration, the user may append to the &pinctrl node, for example

#include <zephyr/dt-bindings/pinctrl/xmc4xxx-pinctrl.h>
&pinctrl {
    my_node_config: my_node_config {
    pinmux = <XMC4XXX_PINMUX_SET(0, 1, 2)>;
    drive-push-pull;
      ... other supported pin configurations ..
};
where XMC4XXX_PINMUX_SET(PORT, PIN, ALTERNATE_FUNCTION) is a helper macro for setting the
alternate function for a given port/pin. Setting ALTERNATE_FUNCTION = 0 means that no
alternate function is selected.

The pinctrl driver only sets the alternate function for output pins. The input mux is
handled by the peripheral drivers. For example the &usic1ch1 node has input-src property for
this purpose. There are no pre-defined nodes for the input mux and this must be properly set
by the user. Refer to the peripheral .yaml file (i.e. infineon,xmc4xxx-uart.yaml) and
XMC4XXX documentation.

Properties

Top level properties

These property descriptions apply to “infineon,xmc4xxx-pinctrl” nodes themselves. This page also describes child node properties in the following sections.

Properties not inherited from the base binding file.

(None)

Child node properties

Name

Type

Details

pinmux

int

Encodes port/pin and alternate function. See helper macro XMC4XX_PINMUX_SET().
Alternate function is only set for output pins; It selects  ALT1-ALT4
output line in the GPIO element. The alternate function for input pins is
handled separately by the peripheral. It is upto the peripheral to configure which
input pin to use (For example see parameter input-src in infineon,xmc4xxx-uart.yaml).

This property is required.

drive-strength

string

Drive strength of the output pin. Following options as in XMC_GPIO_OUTPUT_STRENGTH
See xmc4_gpio.h. This only has an effect if the pin is in drive-push-pull mode.

This property is required.

Legal values: 'strong-sharp-edge', 'strong-medium-edge', 'strong-soft-edge', 'strong-slow-edge', 'medium', 'medium-unknown1-edge', 'medium-unknown2-edge', 'weak'

invert-input

boolean

Inverts the input.

hwctrl

string

Pre-assigns hardware control of the pin to a certain peripheral.

This property is required.

Legal values: 'disabled', 'periph1', 'periph2'

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