diff options
author | Alex Voinea <voinea.dragos.alexandru@gmail.com> | 2022-12-22 03:23:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-21 21:23:23 -0500 |
commit | 9b60daf62dd7c02164c53f2baa72e3e6c8af441f (patch) | |
tree | b70abfddf2e68cba3e9ba97c1ce84a70f36d1794 /klippy/extras/tmc5160.py | |
parent | aac613bf44ca1feb4334ab35378b48711baccb60 (diff) | |
download | kutter-9b60daf62dd7c02164c53f2baa72e3e6c8af441f.tar.gz kutter-9b60daf62dd7c02164c53f2baa72e3e6c8af441f.tar.xz kutter-9b60daf62dd7c02164c53f2baa72e3e6c8af441f.zip |
tmc: Configurable microstep lookup table (#5920)
Make all the microstep lookup table registers configurable via the
config file. It also loads the default values.
TMC220x and TMC2660 do not support this feature.
Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
Diffstat (limited to 'klippy/extras/tmc5160.py')
-rw-r--r-- | klippy/extras/tmc5160.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/klippy/extras/tmc5160.py b/klippy/extras/tmc5160.py index 4d970271..5d570958 100644 --- a/klippy/extras/tmc5160.py +++ b/klippy/extras/tmc5160.py @@ -171,6 +171,27 @@ Fields["IOIN"] = { Fields["LOST_STEPS"] = { "lost_steps": 0xfffff << 0 } +Fields["MSLUT0"] = { "mslut0": 0xffffffff } +Fields["MSLUT1"] = { "mslut1": 0xffffffff } +Fields["MSLUT2"] = { "mslut2": 0xffffffff } +Fields["MSLUT3"] = { "mslut3": 0xffffffff } +Fields["MSLUT4"] = { "mslut4": 0xffffffff } +Fields["MSLUT5"] = { "mslut5": 0xffffffff } +Fields["MSLUT6"] = { "mslut6": 0xffffffff } +Fields["MSLUT7"] = { "mslut7": 0xffffffff } +Fields["MSLUTSEL"] = { + "x3": 0xFF << 24, + "x2": 0xFF << 16, + "x1": 0xFF << 8, + "w3": 0x03 << 6, + "w2": 0x03 << 4, + "w1": 0x03 << 2, + "w0": 0x03 << 0, +} +Fields["MSLUTSTART"] = { + "start_sin": 0xFF << 0, + "start_sin90": 0xFF << 16, +} Fields["MSCNT"] = { "mscnt": 0x3ff << 0 } @@ -299,6 +320,7 @@ class TMC5160: self.get_phase_offset = cmdhelper.get_phase_offset self.get_status = cmdhelper.get_status # Setup basic register values + tmc.TMCWaveTableHelper(config, self.mcu_tmc) tmc.TMCStealthchopHelper(config, self.mcu_tmc, TMC_FREQUENCY) # CHOPCONF set_config_field = self.fields.set_config_field |