From: Sebastien Bourdeauducq Date: Thu, 5 Dec 2013 23:06:53 +0000 (+0100) Subject: gpio: add InOut X-Git-Tag: 24jan2021_ls180~2756 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55a39269d22bbe5058d585cca269889c3cee51cc;p=litex.git gpio: add InOut --- diff --git a/misoclib/gpio/__init__.py b/misoclib/gpio/__init__.py index d02332ec..c29dc0fd 100644 --- a/misoclib/gpio/__init__.py +++ b/misoclib/gpio/__init__.py @@ -12,6 +12,14 @@ class GPIOOut(Module, AutoCSR): self._r_out = CSRStorage(flen(signal)) self.comb += signal.eq(self._r_out.storage) +class GPIOInOut(Module): + def __init__(self, in_signal, out_signal): + self.submodules.gpio_in = GPIOIn(in_signal) + self.submodules.gpio_out = GPIOOut(out_signal) + + def get_csrs(self): + return self.gpio_in.get_csrs() + self.gpio_out.get_csrs() + class Blinker(Module): def __init__(self, signal, divbits=26): counter = Signal(divbits)