Skip to content

Commit

Permalink
gpio: support setting reset values
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourdeauducq committed Jun 5, 2018
1 parent ba3c5b4 commit fb92c5e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions misoc/cores/gpio.py
Expand Up @@ -11,17 +11,17 @@ def __init__(self, signal):


class GPIOOut(Module, AutoCSR):
def __init__(self, signal):
self._out = CSRStorage(len(signal))
def __init__(self, signal, reset_out=0):
self._out = CSRStorage(len(signal), reset=reset_o)
self.comb += signal.eq(self._out.storage)


class GPIOTristate(Module, AutoCSR):
def __init__(self, signals):
def __init__(self, signals, reset_out=0, reset_oe=0):
l = len(signals)
self._in = CSRStatus(l)
self._out = CSRStorage(l)
self._oe = CSRStorage(l)
self._out = CSRStorage(l, reset=reset_out)
self._oe = CSRStorage(l, reset=reset_oe)

for n, signal in enumerate(signals):
ts = TSTriple(1)
Expand Down

0 comments on commit fb92c5e

Please sign in to comment.