2015-02-18 09:32:34 -05:00
|
|
|
class LiteScopeIODriver():
|
2015-04-13 07:09:44 -04:00
|
|
|
def __init__(self, regs, name):
|
|
|
|
self.regs = regs
|
|
|
|
self.name = name
|
|
|
|
self.build()
|
2015-02-18 09:32:34 -05:00
|
|
|
|
2015-04-13 07:09:44 -04:00
|
|
|
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)
|
2015-02-18 09:32:34 -05:00
|
|
|
|
2015-04-13 07:09:44 -04:00
|
|
|
def write(self, value):
|
|
|
|
self.o.write(value)
|
2015-02-18 09:32:34 -05:00
|
|
|
|
2015-04-13 07:09:44 -04:00
|
|
|
def read(self):
|
|
|
|
return self.i.read()
|