-class Pin(Enum):
- """Reference Pin object"""
-
- def __init__(self, pin_id):
- """Identifier for pin, referencing platform-specific pin id"""
- self._id = pin_id
-
- def __repr__(self):
- # pylint: disable=import-outside-toplevel, cyclic-import
- import board
-
- for key in dir(board):
- if getattr(board, key) is self:
- return "board.{}".format(key)
- import microcontroller.pin as pin
-
- # pylint: enable=import-outside-toplevel, cyclic-import
-
- for key in dir(pin):
- if getattr(pin, key) is self:
- return "microcontroller.pin.{}".format(key)
- return repr(self)
-
-