1 /* $NetBSD: stm32-pinfunc.h,v 1.4 2020/01/03 15:04:34 skrll Exp $ */ 2 3 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ 4 /* 5 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved 6 * Author: Torgue Alexandre <alexandre.torgue@st.com> for STMicroelectronics. 7 */ 8 9 #ifndef _DT_BINDINGS_STM32_PINFUNC_H 10 #define _DT_BINDINGS_STM32_PINFUNC_H 11 12 /* define PIN modes */ 13 #define GPIO 0x0 14 #define AF0 0x1 15 #define AF1 0x2 16 #define AF2 0x3 17 #define AF3 0x4 18 #define AF4 0x5 19 #define AF5 0x6 20 #define AF6 0x7 21 #define AF7 0x8 22 #define AF8 0x9 23 #define AF9 0xa 24 #define AF10 0xb 25 #define AF11 0xc 26 #define AF12 0xd 27 #define AF13 0xe 28 #define AF14 0xf 29 #define AF15 0x10 30 #define ANALOG 0x11 31 32 /* define Pins number*/ 33 #define PIN_NO(port, line) (((port) - 'A') * 0x10 + (line)) 34 35 #define STM32_PINMUX(port, line, mode) (((PIN_NO(port, line)) << 8) | (mode)) 36 37 /* package information */ 38 #define STM32MP_PKG_AA 0x1 39 #define STM32MP_PKG_AB 0x2 40 #define STM32MP_PKG_AC 0x4 41 #define STM32MP_PKG_AD 0x8 42 43 #endif /* _DT_BINDINGS_STM32_PINFUNC_H */ 44 45