You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to write to a triMixed field, a ValueError is thrown. For example:
self.writeInt('GCONF', 0)
causes:
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/root/py_ws/tripipy/trinamicDriver.py", line203, inwriteIntcreg.writeBytes(ba, value=regValue)
File"/root/py_ws/tripipy/trinamicDriver.py", line603, inwriteBytesraiseValueError('register %s cannot accept new value in writeBytes'%self.name)
ValueError: registerGCONFcannotacceptnewvalueinwriteBytes
Can you help me understand why write_bytes() shouldn't accept a new value? It seems like this error will always be thrown:
classtriMixed(triRegister):
...
defwriteBytes(self, ba, value=None):
""" fills the given 5 byte buffer with the bytes to write to the chip. """ifnotvalueisNone:
raiseValueError('register %s cannot accept new value in writeBytes'%self.name)
self.packBytes(ba, self.curval)
The text was updated successfully, but these errors were encountered:
A triMixed instance should have child triSubxxx fields, use set on the child fields to change the overall value of the total field, and then call writeBytes with value None on the triMixed field to transmit the current value to the chip.
eh? GSTAT uses GSTATflags which is defined in tmc5130regs.py, and similar for the others - when they're read only in particular (and they are all just flag bits) they just use a subclass of intflag so the various flags are named
If you try to write to a
triMixed
field, aValueError
is thrown. For example:causes:
Can you help me understand why
write_bytes()
shouldn't accept a new value? It seems like this error will always be thrown:The text was updated successfully, but these errors were encountered: