1 /* 2 * Copyright (c) 2006-2022, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __DT_BINDINGS_PIN_STATE_H__ 8 #define __DT_BINDINGS_PIN_STATE_H__ 9 10 #define PIND_FLAGS_BIT_DIR_SET (1 << 0) 11 #define PIND_FLAGS_BIT_DIR_OUT (1 << 1) 12 #define PIND_FLAGS_BIT_DIR_VAL (1 << 2) 13 #define PIND_FLAGS_BIT_OPEN_DRAIN (1 << 3) 14 #define PIND_FLAGS_BIT_NONEXCLUSIVE (1 << 4) 15 16 /* Don't change anything */ 17 #define PIND_ASIS 0 18 /* Set lines to input mode */ 19 #define PIND_IN PIND_FLAGS_BIT_DIR_SET 20 /* Set lines to output and drive them low */ 21 #define PIND_OUT_LOW (PIND_FLAGS_BIT_DIR_SET | PIND_FLAGS_BIT_DIR_OUT) 22 /* Set lines to output and drive them high */ 23 #define PIND_OUT_HIGH (PIND_FLAGS_BIT_DIR_SET | PIND_FLAGS_BIT_DIR_OUT | PIND_FLAGS_BIT_DIR_VAL) 24 /* Set lines to open-drain output and drive them low */ 25 #define PIND_OUT_LOW_OPEN_DRAIN (PIND_OUT_LOW | PIND_FLAGS_BIT_OPEN_DRAIN) 26 /* Set lines to open-drain output and drive them high */ 27 #define PIND_OUT_HIGH_OPEN_DRAIN (PIND_OUT_HIGH | PIND_FLAGS_BIT_OPEN_DRAIN) 28 29 #endif /* __DT_BINDINGS_PIN_STATE_H__ */ 30