include/dt-bindings: stm32: provide stm32-pinctrl-common.h binding
Provide stm32-pinctrl-common.h matching st,stm32-pinmux binding. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
14be1f3cd7
commit
b48ba090e4
1 changed files with 33 additions and 0 deletions
|
@ -7,6 +7,39 @@
|
|||
#ifndef ZEPHYR_STM32_PINCTRL_COMMON_H_
|
||||
#define ZEPHYR_STM32_PINCTRL_COMMON_H_
|
||||
|
||||
/* Adapted from Linux: include/dt-bindings/pinctrl/stm32-pinfunc.h */
|
||||
|
||||
/**
|
||||
* @brief Pin modes
|
||||
*/
|
||||
|
||||
#define AF0 0x0
|
||||
#define AF1 0x1
|
||||
#define AF2 0x2
|
||||
#define AF3 0x3
|
||||
#define AF4 0x4
|
||||
#define AF5 0x5
|
||||
#define AF6 0x6
|
||||
#define AF7 0x7
|
||||
#define AF8 0x8
|
||||
#define AF9 0x9
|
||||
#define AF10 0xa
|
||||
#define AF11 0xb
|
||||
#define AF12 0xc
|
||||
#define AF13 0xd
|
||||
#define AF14 0xe
|
||||
#define AF15 0xf
|
||||
#define ANALOG 0x10
|
||||
#define GPIO 0x11 /* Reserved for future use */
|
||||
|
||||
/**
|
||||
* @brief Macro to generate pinmux int using port, pin number and mode arguments
|
||||
* This is taken from Linux equivalent st,stm32f429-pinctrl binding
|
||||
*/
|
||||
|
||||
#define PIN_NO(port, line) (((port) - 'A') * 0x10 + (line))
|
||||
#define STM32_PINMUX(port, line, mode) (((PIN_NO(port, line)) << 8) | (mode))
|
||||
|
||||
|
||||
/**
|
||||
* @brief numerical IDs for IO ports
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue