aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/tmc5160.py
Commit message (Collapse)AuthorAgeFilesLines
* tmc: Add support for a get_status() methodKevin O'Connor2021-08-301-0/+1
| | | | | | Export mcu_phase_offset and drv_status information. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* endstop_phase: Convert to using tmc mcu_phase_offsetKevin O'Connor2021-08-081-2/+1
| | | | | | | Now that the TMC drivers track the phase offset, use that to implement endstop phase. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Move stepper phase reading code to TMCCommandHelper classKevin O'Connor2021-08-061-3/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Consistently use lower case for all TMC field namesKevin O'Connor2021-08-061-54/+54
| | | | | | | | | | | | The Trinamic specs aren't consistent with upper vs lower case, which can be confusing. Improve clarity by using lower case names consistently in the code. Register names will continue to use all upper case naming in the code. Update the SET_TMC_FIELD command to automatically convert field names to lower case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Fix order of init during sensorless homingKevin O'Connor2021-02-281-0/+3
| | | | | | | | | | | With commit 53b10d3a the setup of sensorless homing could occur before the driver was enabled which would cause the reinitialization of the driver settings to undo the sensorless homing setup. Use set_field() when setting the sensorless homing registers so that it wont conflict with a driver init. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Merge field formatters into tmc2130.pyKevin O'Connor2021-02-271-5/+0
| | | | | | | | 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>
* tmc: Move SET_TMC_CURRENT command to TMCCommandHelper()Kevin O'Connor2021-02-271-24/+2
| | | | | | | Refactor the tmc driver implementations so that there is a single implementation of the SET_TMC_CURRENT command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Add set_current()/get_current() helpers to TMC5160CurrentHelperKevin O'Connor2021-02-271-14/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: diag0 support (#3159)Trevor Jones2020-08-091-2/+1
| | | | | Allow for diag0 only hardware to use sensorless homing. Signed-off-by: Trevor Jones <trevorjones141@gmail.com>
* extras: Use "from . import module" for relative importsKevin O'Connor2020-06-151-1/+1
| | | | | | Use alternate import syntax to improve Python3 compatibility. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Change the default for the pwm_freq field to zeroKevin O'Connor2020-05-241-1/+1
| | | | | | | The tmc5160 spec shows a default of zero, so use that same default for Klipper. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Use new GCodeCommand wrappersKevin O'Connor2020-05-051-18/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Support setting GLOBALSCALER to fine tune current selectionKevin O'Connor2020-03-041-4/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: PWMCONF is write onlyPetri Honkala2019-12-041-1/+1
| | | | Signed-off-by: Petri Honkala <cruwaller@gmail.com>
* tmc2130: Do not error if run current below hold current (#2190)Florian Heilmann2019-11-211-2/+2
| | | Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* tmc: Configure "intpol" field from TMCMicrostepHelperKevin O'Connor2019-06-281-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Add support for virtual enable pinsKevin O'Connor2019-06-281-2/+2
| | | | | | | Add support for enabling the stepper via the communication channel. This improves support for boards with a shared enable line. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Simplify internal DUMP_TMC interfaceKevin O'Connor2019-06-251-4/+1
| | | | | | | | Only the tmc2208 driver needs special read register translation logic. Rework the code so a default implementation is available for all the other drivers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* config: Update tmc5160 block in example-extras.cfgKevin O'Connor2019-06-181-1/+0
| | | | | | | | | | List all the configurable parameters in the tmc5160 example block and use similar wording as the other tmc drivers. Also, don't allow DEDGE to be configured as it would just break the current code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc: Move common TMC stepper driver code to new file tmc.pyKevin O'Connor2019-06-101-7/+7
| | | | | | Move common code from tmc2130.py to tmc.py. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Rework remaining config helpers to use mcu_tmc interfaceKevin O'Connor2019-06-101-19/+7
| | | | | | | | Introduce TMCMicrostepHelper and TMCStealthchopHelper helper code that uses the mcu_tmc interface. Update the callers to use these new helpers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Move TMC virtual endstop code into a new TMCEndstopHelper classKevin O'Connor2019-06-101-9/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Move current setting code to its own helper classKevin O'Connor2019-06-101-66/+61
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Transmit register initialization during connect callbackKevin O'Connor2019-06-101-2/+0
| | | | | | | | Perform the register initialization directly from TMCCommandHelper and perform it during the "connect" phase. This unifies the register setup for the TMC2130, TMC2208, TMC2660, and TMC5160. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Use TMCCommandHelperKevin O'Connor2019-06-101-46/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Use tmc2130.MCU_TMC_SPI for low-level get/set_register accessKevin O'Connor2019-06-101-43/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Rename registers to Registers and fields to FieldsKevin O'Connor2019-06-101-87/+87
| | | | | | | Minor change to the code so that it is more similar to the other tmc drivers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* test: Add test cases for tmc driversKevin O'Connor2019-06-101-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2130: Check field name validity. (#1697)Artem Belevich2019-06-021-1/+3
| | | | | This avoids crashing Klipper if user entered invalid field name. Signed-off-by: Artem Belevich <artemb@gmail.com>
* tmc2130: Add support for two's complement signed fields to FieldHelperKevin O'Connor2019-05-291-2/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc5160: Add support for TMC5160 steppers (#1637)Stephan2019-05-201-0/+437
Signed-off-by: Stephan Oelze <stephan.oelze@gmail.com>