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