Skip to content

Commit

Permalink
tmc2660: Change stallguard flags to better match tmc2130/tmc5160
Browse files Browse the repository at this point in the history
The tmc2660 spec has an ambiguous "SG" field that sometimes refers to
the "stallGuard" flag and sometimes refers to the "SG_RESULT" field.
The tmc2130 and tmc5160 have similar fields that are not ambiguous, so
adopt that naming strategy.

Signed-off-by: Kevin O'Connor <[email protected]>
  • Loading branch information
KevinOConnor committed Mar 15, 2021
1 parent 3233ec0 commit 88d0af3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions klippy/extras/tmc2660.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}

Fields["READRSP@RDSEL0"] = {
"SG": 0x01 << 4,
"stallGuard": 0x01 << 4,
"ot": 0x01 << 5,
"otpw": 0x01 << 6,
"s2ga": 0x01 << 7,
Expand All @@ -70,19 +70,19 @@
}

Fields["READRSP@RDSEL1"] = {
"SG": 0x01 << 4,
"stallGuard": 0x01 << 4,
"ot": 0x01 << 5,
"otpw": 0x01 << 6,
"s2ga": 0x01 << 7,
"s2gb": 0x01 << 8,
"ola": 0x01 << 9,
"olb": 0x01 << 10,
"stst": 0x01 << 11,
"SG@RDSEL1": 0x3ff << 14
"SG_RESULT": 0x3ff << 14
}

Fields["READRSP@RDSEL2"] = {
"SG": 0x01 << 4,
"stallGuard": 0x01 << 4,
"ot": 0x01 << 5,
"otpw": 0x01 << 6,
"s2ga": 0x01 << 7,
Expand All @@ -91,7 +91,7 @@
"olb": 0x01 << 10,
"stst": 0x01 << 11,
"SE": 0x1f << 14,
"SG@RDSEL2": 0x1f << 19
"SG_RESULT@RDSEL2": 0x1f << 19
}

SignedFields = ["SGT"]
Expand All @@ -103,7 +103,6 @@
"VSENSE": (lambda v: "%d(%dmV)" % (v, 165 if v else 305)),
"SDOFF": (lambda v: "1(Step/Dir disabled!)" if v else ""),
"DISS2G": (lambda v: "%d(Short to GND disabled!)" if v else ""),
"SG": (lambda v: "1(Stall!)" if v else ""),
})


Expand Down

0 comments on commit 88d0af3

Please sign in to comment.