tripipy
tripipy copied to clipboard
triMixed register does not allow writeBytes
If you try to write to a triMixed
field, a ValueError
is thrown. For example:
self.writeInt('GCONF', 0)
causes:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/py_ws/tripipy/trinamicDriver.py", line 203, in writeInt
creg.writeBytes(ba, value=regValue)
File "/root/py_ws/tripipy/trinamicDriver.py", line 603, in writeBytes
raise ValueError('register %s cannot accept new value in writeBytes' % self.name)
ValueError: register GCONF cannot accept new value in writeBytes
Can you help me understand why write_bytes()
shouldn't accept a new value? It seems like this error will always be thrown:
class triMixed(triRegister):
...
def writeBytes(self, ba, value=None):
"""
fills the given 5 byte buffer with the bytes to write to the chip.
"""
if not value is None:
raise ValueError('register %s cannot accept new value in writeBytes' % self.name)
self.packBytes(ba, self.curval)