endstop_phase: Add support for detecting phase via TMC stepper drivers

The Trinamic stepper motor drivers are capable of reporting the
stepper phase - add support for using that capability to the
enddstop_phases module.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2018-10-10 19:48:35 -04:00
parent a2df01b88e
commit def524bdf4
4 changed files with 38 additions and 8 deletions

View File

@@ -137,6 +137,10 @@ class TMC2130:
data = [(reg | 0x80) & 0xff, (val >> 24) & 0xff, (val >> 16) & 0xff,
(val >> 8) & 0xff, val & 0xff]
self.spi_send_cmd.send([self.oid, data])
def get_microsteps(self):
return 256 >> self.mres
def get_phase(self):
return (self.get_register("MSCNT") & 0x3ff) >> self.mres
cmd_DUMP_TMC_help = "Read and display TMC stepper driver registers"
def cmd_DUMP_TMC(self, params):
self.printer.lookup_object('toolhead').get_last_move_time()