tmc5160: Merge field formatters into tmc2130.py

The tmc5160 field formatters were mostly duplicates of the tmc2130 -
add the "reset" field to tmc2130.py so both drivers have similar
reporting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-02-26 14:09:20 -05:00
parent 21383fa32e
commit 2d781b8340
2 changed files with 1 additions and 5 deletions

View File

@ -74,6 +74,7 @@ SignedFields = ["CUR_A", "CUR_B", "sgt"]
FieldFormatters = { FieldFormatters = {
"I_scale_analog": (lambda v: "1(ExtVREF)" if v else ""), "I_scale_analog": (lambda v: "1(ExtVREF)" if v else ""),
"shaft": (lambda v: "1(Reverse)" if v else ""), "shaft": (lambda v: "1(Reverse)" if v else ""),
"reset": (lambda v: "1(Reset)" if v else ""),
"drv_err": (lambda v: "1(ErrorShutdown!)" if v else ""), "drv_err": (lambda v: "1(ErrorShutdown!)" if v else ""),
"uv_cp": (lambda v: "1(Undervoltage!)" if v else ""), "uv_cp": (lambda v: "1(Undervoltage!)" if v else ""),
"VERSION": (lambda v: "%#x" % v), "VERSION": (lambda v: "%#x" % v),

View File

@ -215,11 +215,6 @@ Fields["TSTEP"] = {
SignedFields = ["CUR_A", "CUR_B", "sgt", "XACTUAL", "VACTUAL", "PWM_SCALE_AUTO"] SignedFields = ["CUR_A", "CUR_B", "sgt", "XACTUAL", "VACTUAL", "PWM_SCALE_AUTO"]
FieldFormatters = dict(tmc2130.FieldFormatters) FieldFormatters = dict(tmc2130.FieldFormatters)
FieldFormatters.update({
"reset": (lambda v: "1(reset)" if v else ""),
"drv_err": (lambda v: "1(ErrorShutdown!)" if v else ""),
"uv_cp": (lambda v: "1(Undervoltage!)" if v else ""),
})
###################################################################### ######################################################################