soc/cores/gpio: uniformize with others cores

This commit is contained in:
Florent Kermarrec 2019-09-29 16:10:44 +02:00
parent 78cecbe36b
commit e9ed4761b5
1 changed files with 3 additions and 0 deletions

View File

@ -6,18 +6,21 @@ from migen.genlib.cdc import MultiReg
from litex.soc.interconnect.csr import *
# GPIO Input ----------------------------------------------------------------------------------------
class GPIOIn(Module, AutoCSR):
def __init__(self, signal):
self._in = CSRStatus(len(signal))
self.specials += MultiReg(signal, self._in.status)
# GPIO Output --------------------------------------------------------------------------------------
class GPIOOut(Module, AutoCSR):
def __init__(self, signal):
self._out = CSRStorage(len(signal))
self.comb += signal.eq(self._out.storage)
# GPIO Input/Output --------------------------------------------------------------------------------
class GPIOInOut(Module):
def __init__(self, in_signal, out_signal):