Commit Graph

16 Commits

Author SHA1 Message Date
Kevin O'Connor 2d7c3a84ee manual_stepper: Add an "extras" module for manually controlling a stepper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-12 13:38:13 -05:00
Kevin O'Connor d088a7ca72 tmc2130: Share config reading helpers with tmc2208.py code
Add helper function for reading current, microsteps, and stealthchop
settings from the config file.  Use these helpers in both the tmc2130
and tmc2208 modules.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 17:39:07 -05:00
Kevin O'Connor 0920a518ce tmc2208: Rename self.field_helper to self.fields
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 17:15:43 -05:00
Kevin O'Connor 30b6414295 tmc2208: move local set_field/get_field helpers to FieldHelper class
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>
2019-02-03 14:07:27 -05:00
Kevin O'Connor 17a17c5b77 tmc2208: Add helper for setting fields from the config file
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 13:03:44 -05:00
Kevin O'Connor 83001959f1 tmc2208: Use field definitions during driver init
Reduce the amount of bit manipulations by using the FieldHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 12:22:12 -05:00
Dmitry Frolov 51f14b9c8c tmc2208: Add register field formatters
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Dmitry Frolov <dmitry.frolov@gmail.com>
2019-02-03 11:19:36 -05:00
Kevin O'Connor 955fdcaa0c tmc2130: Convert field helper into a class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-02-03 11:11:15 -05:00
lorf 54683c9535 tmc2208: Decode register fields in DUMP_TMC (#1156)
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>
2019-02-02 19:46:27 -05:00
Kevin O'Connor 2c31fd8313 tmc2208: Check for debugging mode before checking for a retransmit
Allow the tmc2208 code to be run from regression test cases.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-10 09:55:54 -05:00
Kevin O'Connor 857e7ed5f1 klippy: Convert printer_state("connect") to an event handler
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>
2019-01-08 11:09:55 -05:00
Petri Honkala f99002df4f tmc2208: error raise fixed for rx/tx mcu check
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-12-27 11:44:41 -05:00
Kevin O'Connor def524bdf4 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>
2018-10-16 13:09:23 -04:00
Kevin O'Connor 8c2991ceac tmc2208: Improve error handling
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>
2018-09-30 10:57:47 -04:00
Kevin O'Connor 30013a1fb8 mcu: Rename add_config_object() to register_config_callback()
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>
2018-09-03 11:48:22 -04:00
Kevin O'Connor ca7a80a946 tmc2208: Initial support for configuring TMC2208 drivers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-08-27 12:51:27 -04:00