Commit 5f9e3820 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

software: add dump for writemregs command too

Signed-off-by: Theodor-Adrian Stana's avatarTheodor Stana <t.stana@cern.ch>
parent de3d3e21
......@@ -82,36 +82,40 @@ class EI2C:
if (ei2cdefine.DUMP):
self.f.close()
def writemregs(self, slot, addr, val):
def write(self, slot, addr, val):
self.write_cnt += 1
#reg = addr/4 + 1
#print '%02x' % sl
cmd = "writemregs %d %x %s\r\n" % (slot, addr, ' '.join(format(b,'x') for b in val))
#print cmd
cmd = "writereg %d %x %x\r\n" % (slot, addr, val)
if (ei2cdefine.DUMP):
self.f.write(cmd);
self.handle.send(cmd)
self._strip_resp(self.handle.recv(30))
def readmregs(self, slot, addr, nrregs):
def read(self, slot, addr):
self.read_cnt += 1
#reg = addr/4 + 1
cmd = "readmregs %d %x %d\r\n" % (slot, addr, nrregs)
cmd = "readreg %d %x\r\n" % (slot, addr)
if (ei2cdefine.DUMP):
self.f.write(cmd);
self.handle.send(cmd)
resp = self._strip_resp(self.handle.recv(30))
return resp
def write(self, slot, addr, val):
def writemregs(self, slot, addr, val):
self.write_cnt += 1
#reg = addr/4 + 1
cmd = "writereg %d %x %x\r\n" % (slot, addr, val)
#print '%02x' % sl
cmd = "writemregs %d %x %s\r\n" % (slot, addr, ' '.join(format(b,'x') for b in val))
if (ei2cdefine.DUMP):
self.f.write(cmd);
#print cmd
self.handle.send(cmd)
self._strip_resp(self.handle.recv(30))
def read(self, slot, addr):
def readmregs(self, slot, addr, nrregs):
self.read_cnt += 1
#reg = addr/4 + 1
cmd = "readreg %d %x\r\n" % (slot, addr)
cmd = "readmregs %d %x %d\r\n" % (slot, addr, nrregs)
if (ei2cdefine.DUMP):
self.f.write(cmd);
self.handle.send(cmd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment