tmc: Add support for virtual enable pins

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>
This commit is contained in:
Kevin O'Connor
2019-06-12 23:28:22 -04:00
committed by KevinOConnor
parent 041831f93a
commit 7702f0a027
7 changed files with 67 additions and 18 deletions

View File

@@ -291,9 +291,9 @@ class TMC5160:
# Setup mcu communication
self.fields = tmc.FieldHelper(Fields, SignedFields, FieldFormatters)
self.mcu_tmc = tmc2130.MCU_TMC_SPI(config, Registers, self.fields)
# Allow virtual endstop to be created
# Allow virtual pins to be created
diag1_pin = config.get('diag1_pin', None)
tmc.TMCEndstopHelper(config, self.mcu_tmc, diag1_pin)
tmc.TMCVirtualPinHelper(config, self.mcu_tmc, diag1_pin)
# Register commands
cmdhelper = tmc.TMCCommandHelper(config, self.mcu_tmc)
cmdhelper.setup_register_dump(ReadRegisters)