Add support for Triple-Z steppers/endstops

This commit is contained in:
Holger Müller
2018-06-19 18:55:49 +02:00
committed by Scott Lahteine
parent bc06406d7d
commit 1a6f2b29b8
37 changed files with 901 additions and 155 deletions

View File

@@ -282,6 +282,41 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define Z2_STEP_READ READ(Z2_STEP_PIN)
#endif
// Z3 Stepper
#if HAS_Z3_ENABLE
#if ENABLED(Z3_IS_L6470)
extern L6470 stepperZ3;
#define Z3_ENABLE_INIT NOOP
#define Z3_ENABLE_WRITE(STATE) do{ if (STATE) stepperZ3.Step_Clock(stepperZ3.getStatus() & STATUS_HIZ); else stepperZ3.softFree(); }while(0)
#define Z3_ENABLE_READ (stepperZ3.getStatus() & STATUS_HIZ)
#define Z3_DIR_INIT NOOP
#define Z3_DIR_WRITE(STATE) stepperZ3.Step_Clock(STATE)
#define Z3_DIR_READ (stepperZ3.getStatus() & STATUS_DIR)
#else
#if ENABLED(Z3_IS_TMC26X)
extern TMC26XStepper stepperZ3;
#define Z3_ENABLE_INIT NOOP
#define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE)
#define Z3_ENABLE_READ stepperZ3.isEnabled()
#else
#if ENABLED(Z3_IS_TMC2130)
extern TMC2130Stepper stepperZ3;
#elif ENABLED(Z3_IS_TMC2208)
extern TMC2208Stepper stepperZ3;
#endif
#define Z3_ENABLE_INIT SET_OUTPUT(Z3_ENABLE_PIN)
#define Z3_ENABLE_WRITE(STATE) WRITE(Z3_ENABLE_PIN,STATE)
#define Z3_ENABLE_READ READ(Z3_ENABLE_PIN)
#endif
#define Z3_DIR_INIT SET_OUTPUT(Z3_DIR_PIN)
#define Z3_DIR_WRITE(STATE) WRITE(Z3_DIR_PIN,STATE)
#define Z3_DIR_READ READ(Z3_DIR_PIN)
#endif
#define Z3_STEP_INIT SET_OUTPUT(Z3_STEP_PIN)
#define Z3_STEP_WRITE(STATE) WRITE(Z3_STEP_PIN,STATE)
#define Z3_STEP_READ READ(Z3_STEP_PIN)
#endif
// E0 Stepper
#if AXIS_DRIVER_TYPE(E0, L6470)
extern L6470 stepperE0;