pin.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef __DT_BINDINGS_PIN_PIN_H__
  7. #define __DT_BINDINGS_PIN_PIN_H__
  8. /* Bit 0 express polarity */
  9. #define PIN_ACTIVE_HIGH 0
  10. #define PIN_ACTIVE_LOW 1
  11. /* Bit 1 express single-endedness */
  12. #define PIN_PUSH_PULL 0
  13. #define PIN_SINGLE_ENDED 2
  14. /* Bit 2 express Open drain or open source */
  15. #define PIN_LINE_OPEN_SOURCE 0
  16. #define PIN_LINE_OPEN_DRAIN 4
  17. /*
  18. * Open Drain/Collector is the combination of single-ended open drain interface.
  19. * Open Source/Emitter is the combination of single-ended open source interface.
  20. */
  21. #define PIN_OPEN_DRAIN (PIN_SINGLE_ENDED | PIN_LINE_OPEN_DRAIN)
  22. #define PIN_OPEN_SOURCE (PIN_SINGLE_ENDED | PIN_LINE_OPEN_SOURCE)
  23. /* Bit 3 express PIN suspend/resume and reset persistence */
  24. #define PIN_PERSISTENT 0
  25. #define PIN_TRANSITORY 8
  26. /* Bit 4 express pull up */
  27. #define PIN_PULL_UP 16
  28. /* Bit 5 express pull down */
  29. #define PIN_PULL_DOWN 32
  30. /* Bit 6 express pull disable */
  31. #define PIN_PULL_DISABLE 64
  32. #endif /* __DT_BINDINGS_PIN_PIN_H__ */