#pragma once #include #include #include "apibasic/basic.hpp" typedef struct { uint32_t sg_result : 10; uint32_t reserved0 : 5; uint32_t fsactive : 1; uint32_t cs_actual : 5; uint32_t reserved1 : 3; uint32_t stallguard : 1; uint32_t ot : 1; uint32_t otpw : 1; uint32_t s2ga : 1; uint32_t s2gb : 1; uint32_t ola : 1; uint32_t olb : 1; uint32_t stst : 1; } TMC5130MotorStatus_t; namespace iflytop { using namespace std; class ZIStepMotor { public: virtual ~ZIStepMotor() {} virtual int32_t step_motor_enable(int32_t enable) = 0; virtual int32_t step_motor_stop(int32_t breakstop) = 0; virtual int32_t step_motor_read_pos(int32_t* pos) = 0; virtual int32_t step_motor_easy_rotate(int32_t direction) = 0; virtual int32_t step_motor_easy_move_by(int32_t distance) = 0; virtual int32_t step_motor_easy_move_to(int32_t position) = 0; virtual int32_t step_motor_easy_move_to_zero() = 0; virtual int32_t step_motor_easy_set_current_pos(int32_t pos) = 0; virtual int32_t step_motor_easy_move_to_io(int32_t ioindex, int32_t direction) = 0; virtual int32_t step_motor_active_cfg() = 0; virtual int32_t step_motor_read_io_state(int32_t ioindex, int32_t* state) = 0; /*********************************************************************************************************************** * DEBUG * ***********************************************************************************************************************/ virtual int32_t step_motor_read_tmc5130_status(int32_t* errorflag) = 0; }; } // namespace iflytop