tmc: SET_TMC_FIELD VELOCITY

Ability to specify `VELOCITY` as a parameter for SET_TMC_FIELD. Useful for configuring at runtime the TSTEP based fields of the driver.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
This commit is contained in:
Alex Voinea
2023-03-16 13:11:34 +01:00
committed by KevinOConnor
parent 0469710a69
commit 73f4c6cd00
9 changed files with 37 additions and 10 deletions

View File

@@ -186,7 +186,8 @@ class TMC2208:
def __init__(self, config):
# Setup mcu communication
self.fields = tmc.FieldHelper(Fields, SignedFields, FieldFormatters)
self.mcu_tmc = tmc_uart.MCU_TMC_uart(config, Registers, self.fields)
self.mcu_tmc = tmc_uart.MCU_TMC_uart(config, Registers, self.fields, 0,
TMC_FREQUENCY)
self.fields.set_field("pdn_disable", True)
# Register commands
current_helper = tmc2130.TMCCurrentHelper(config, self.mcu_tmc)