Pascal Paillet | 38e1e90 | 2022-03-15 15:20:00 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ |
| 2 | /* |
| 3 | * Copyright (C) 2024 STMicroelectronics - All Rights Reserved |
| 4 | * Author: Paillet Pascal <p.paillet@foss.st.com> for STMicroelectronics. |
| 5 | */ |
| 6 | |
| 7 | #ifndef DT_BINDINGS_STM32_GPIO_H |
| 8 | #define DT_BINDINGS_STM32_GPIO_H |
| 9 | |
| 10 | /* Bank IDs used in GPIO driver API */ |
| 11 | #define GPIO_BANK_A 0U |
| 12 | #define GPIO_BANK_B 1U |
| 13 | #define GPIO_BANK_C 2U |
| 14 | #define GPIO_BANK_D 3U |
| 15 | #define GPIO_BANK_E 4U |
| 16 | #define GPIO_BANK_F 5U |
| 17 | #define GPIO_BANK_G 6U |
| 18 | #define GPIO_BANK_H 7U |
| 19 | #define GPIO_BANK_I 8U |
| 20 | #define GPIO_BANK_J 9U |
| 21 | #define GPIO_BANK_K 10U |
| 22 | #define GPIO_BANK_Z 25U |
| 23 | |
| 24 | /* Bit 0 is used to set GPIO in input mode */ |
| 25 | #define GPIOF_DIR_OUT 0x0 |
| 26 | #define GPIOF_DIR_IN 0x1 |
| 27 | |
| 28 | /* Bit 1 is used to set GPIO high level during init */ |
| 29 | #define GPIOF_INIT_LOW 0x0 |
| 30 | #define GPIOF_INIT_HIGH 0x2 |
| 31 | |
| 32 | #define GPIOF_IN (GPIOF_DIR_IN) |
| 33 | #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) |
| 34 | #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) |
| 35 | |
| 36 | /* Bit 2 is used to set GPIO pull up */ |
| 37 | #define GPIOF_PULL_UP 0x4 |
| 38 | /* Bit 3 is used to set GPIO pull down */ |
| 39 | #define GPIOF_PULL_DOWN 0x8 |
| 40 | |
| 41 | #endif /* DT_BINDINGS_STM32_GPIO_H */ |