amaranth/examples/tbuf.py
2019-01-26 16:25:05 +00:00

13 lines
220 B
Python

from nmigen import *
from nmigen.cli import main
pin = Signal()
pin_t = TSTriple()
m = Module()
m.submodules += pin_t.get_tristate(pin)
if __name__ == "__main__":
main(m, ports=[pin, pin_t.oe, pin_t.i, pin_t.o])