Open gautamjain opened 4 years ago
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.
Thanks. Makes sense.
However, some of the existing triMixed
instances do not have any child triSubxxx
fields. Should these be fixed?
E.g. GCONF
, GSTAT
, SWMODE
, RAMPSTAT
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: