Move these helper functions to the FieldHelper class so that they can
be used by other Trinamic drivers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Report values of TMC2208 register fields in DUMP_TMC command to help in
tuning and diagnostics.
This also adds functions to refer to register fields by name for TMC drivers
and register mappings for TMC2208.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Dmitry Frolov <dmitry.frolov@gmail.com>
Convert all users of the printer_state("connect") handler to register
a "klippy:connect" event handler instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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>
Configure the tmc2208 during the 'connect' phase so that a problem
during configuration is properly raised as a config error. Catch
errors during DUMP_TMC and raise them as g-code errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change the name of the config registration method and pass an explicit
reference to the callback to the new method. This makes the
relationship between mcu registration and build_config() more clear in
the calling code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>