state.h 1.1 KB

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