# Copyright (c) 2020 Linaro Limited # SPDX-License-Identifier: Apache-2.0 description: STM32 Pin controller Node compatible: "st,stm32f1-pinctrl" include: [base.yaml] properties: reg: required: true child-binding: description: | This binding gives a base representation of the STM32F1 pins configration properties: pinmux: required: true type: int description: | Adapted 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 << 6) | remap) 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 configuration mode, can be: * 0 : Alternate function output * 1 : Input * 2 : Analog - remap: The pin remapping configuration. It allows to assign the pin function to a different peripheral. Remain configuration can be: * 0 : No remap * 1 : Partial remap 1 * 2 : Partial remap 2 * 3 : Partial remap 3 * 4 : Full remap To simplify the usage, macro is available to generate "pinmux" field. This macro is available here: -include/dt-bindings/pinctrl/stm32f1-pinctrl.h Some examples of macro usage: GPIO A9 set as alernate with no remap ... { pinmux = ; }; GPIO A9 set as alernate with full remap ... { pinmux = ; }; GPIO A9 set as input ... { pinmux = ; }; bias-disable: required: false type: boolean description: | Pin bias (push-pull) disabled. This is the default pin configuration and will be applied if no bias- property is specified. Only available in input mode ("floating" configuration). bias-pull-down: required: false type: boolean description: | Weak pull down resistor enabled. Not compatible with output configuration modes (atlernate or general purpose output). bias-pull-up: required: false type: boolean description: | Weak pull up resistor enabled. Not compatible with output configuration modes (atlernate or general purpose output). drive-push-pull: required: false type: boolean description: | Pin driven actively high and low. This is the default pin configueration and will be applied if no drive- property is specified. Only valid for output configuration modes. drive-open-drain: required: false type: boolean description: | Pin driven in open drain. Only valid for output configuration modes. slew-rate: required: false type: string default: "max-speed-10mhz" enum: - "max-speed-10mhz" # Default - "max-speed-2mhz" - "max-speed-50mhz" description: | Pin output mode, maximum achievable speed. Only applies to output mode (alternate).