From 55a39269d22bbe5058d585cca269889c3cee51cc Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 6 Dec 2013 00:06:53 +0100 Subject: [PATCH] gpio: add InOut --- misoclib/gpio/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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) -- 2.30.2