tmc2130.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef TMC2130_H
  2. #define TMC2130_H
  3. //mode
  4. extern uint8_t tmc2130_mode;
  5. //holding and running currents
  6. extern uint8_t tmc2130_current_h[4];
  7. extern uint8_t tmc2130_current_r[4];
  8. //flags for axis stall detection
  9. extern uint8_t tmc2130_axis_stalled[4];
  10. extern uint8_t sg_thrs_x;
  11. extern uint8_t sg_thrs_y;
  12. #define TMC2130_MODE_NORMAL 0
  13. #define TMC2130_MODE_SILENT 1
  14. //initialize tmc2130
  15. extern void tmc2130_init();
  16. //update stall guard (called from st_synchronize inside the loop)
  17. extern bool tmc2130_update_sg();
  18. //temperature watching (called from )
  19. extern void tmc2130_check_overtemp();
  20. //enter homing (called from homeaxis before homing starts)
  21. extern void tmc2130_home_enter(uint8_t axis);
  22. //exit homing (called from homeaxis after homing ends)
  23. extern void tmc2130_home_exit();
  24. //
  25. extern uint8_t tmc2130_didLastHomingStall();
  26. //set holding current for any axis (M911)
  27. extern void tmc2130_set_current_h(uint8_t axis, uint8_t current);
  28. //set running current for any axis (M912)
  29. extern void tmc2130_set_current_r(uint8_t axis, uint8_t current);
  30. //print currents (M913)
  31. extern void tmc2130_print_currents();
  32. #endif //TMC2130_H