You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.9 KiB

2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
  1. #pragma once
  2. #include <stdint.h>
  3. #include <functional>
  4. #include "apibasic/basic.hpp"
  5. typedef struct {
  6. uint32_t sg_result : 10;
  7. uint32_t reserved0 : 5;
  8. uint32_t fsactive : 1;
  9. uint32_t cs_actual : 5;
  10. uint32_t reserved1 : 3;
  11. uint32_t stallguard : 1;
  12. uint32_t ot : 1;
  13. uint32_t otpw : 1;
  14. uint32_t s2ga : 1;
  15. uint32_t s2gb : 1;
  16. uint32_t ola : 1;
  17. uint32_t olb : 1;
  18. uint32_t stst : 1;
  19. } TMC5130MotorStatus_t;
  20. namespace iflytop {
  21. using namespace std;
  22. class ZIStepMotor {
  23. public:
  24. virtual ~ZIStepMotor() {}
  25. virtual int32_t step_motor_enable(int32_t enable) = 0;
  26. virtual int32_t step_motor_stop(int32_t breakstop) = 0;
  27. virtual int32_t step_motor_read_pos(int32_t* pos) = 0;
  28. virtual int32_t step_motor_easy_rotate(int32_t direction) = 0;
  29. virtual int32_t step_motor_easy_move_by(int32_t distance) = 0;
  30. virtual int32_t step_motor_easy_move_to(int32_t position) = 0;
  31. virtual int32_t step_motor_easy_move_to_zero() = 0;
  32. virtual int32_t step_motor_easy_set_current_pos(int32_t pos) = 0;
  33. virtual int32_t step_motor_easy_move_to_io(int32_t ioindex, int32_t direction) = 0;
  34. virtual int32_t step_motor_active_cfg() = 0;
  35. virtual int32_t step_motor_read_io_state(int32_t ioindex, int32_t* state) = 0;
  36. /***********************************************************************************************************************
  37. * DEBUG *
  38. ***********************************************************************************************************************/
  39. virtual int32_t step_motor_read_tmc5130_status(int32_t* errorflag) = 0;
  40. };
  41. } // namespace iflytop