mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
17 lines
440 B
Python
17 lines
440 B
Python
class LiteScopeIODriver():
|
|
def __init__(self, regs, name):
|
|
self.regs = regs
|
|
self.name = name
|
|
self.build()
|
|
|
|
def build(self):
|
|
for key, value in self.regs.d.items():
|
|
if self.name in key:
|
|
key = key.replace(self.name + "_", "")
|
|
setattr(self, key, value)
|
|
|
|
def write(self, value):
|
|
self.o.write(value)
|
|
|
|
def read(self):
|
|
return self.i.read()
|