Browse Source

update

change_pipette_api
zhaohe 1 year ago
parent
commit
43d7c10b67
  1. 1
      api/apibasic/cmdid.hpp
  2. 6
      api/apibasic/errorcode.cpp
  3. 18
      api/apibasic/errorcode.hpp
  4. 1
      api/zi_module.cpp
  5. 1
      api/zi_module.hpp
  6. 21
      api/zi_motor.hpp

1
api/apibasic/cmdid.hpp

@ -62,6 +62,7 @@ typedef enum {
kstep_motor_stop = CMDID(2, 40), // para:{4}, ack:{}
kstep_motor_active_cfg = CMDID(2, 41), // para:{4}, ack:{}
kstep_motor_read_io_state = CMDID(2, 42), // para:{4}, ack:{}
kstep_motor_read_motoric_status = CMDID(2, 43), //
/***********************************************************************************************************************
* MINI_SERVO *

6
api/apibasic/errorcode.cpp

@ -93,6 +93,10 @@ static ecode_table_item_t table[] = {
ERR_ITERM(kstep_motor_run_overtime),
ERR_ITERM(kstep_motor_not_enable),
ERR_ITERM(kstep_motor_ioindex_out_of_range),
ERR_ITERM(kstep_motor_subic_reset),
ERR_ITERM(kstep_motor_drv_err),
ERR_ITERM(kstep_motor_uv_cp),
ERR_ITERM(kstep_motor_not_found_point_edge),
ERR_ITERM(kmini_servo_not_enable),
ERR_ITERM(kmini_servo_mode_not_support),
};
@ -107,7 +111,7 @@ const char* error2str(int32_t code) {
}
ecode_table_item_t* error_get_table() { return table; }
int error_get_table_size() { return sizeof(table) / sizeof(table[0]); }
int error_get_table_size() { return sizeof(table) / sizeof(table[0]); }
} // namespace err
} // namespace iflytop

18
api/apibasic/errorcode.hpp

@ -107,13 +107,17 @@ typedef enum {
/**
* @brief step motor error
*/
kstep_motor_not_found_zero_point = ERROR_CODE(600, 0), // 未找到零点
kstep_motor_not_go_zero = ERROR_CODE(600, 1), // 设备未归零
kstep_motor_over_temperature = ERROR_CODE(600, 2), // 过温
kstep_motor_over_voltage = ERROR_CODE(600, 3), // 过压
kstep_motor_run_overtime = ERROR_CODE(600, 4), // 运行超时
kstep_motor_not_enable = ERROR_CODE(600, 5), // 电机未使能
kstep_motor_ioindex_out_of_range = ERROR_CODE(600, 6), // IO超出范围
kstep_motor_not_found_zero_point = ERROR_CODE(600, 0), // 未找到零点
kstep_motor_not_go_zero = ERROR_CODE(600, 1), // 设备未归零
kstep_motor_over_temperature = ERROR_CODE(600, 2), // 过温
kstep_motor_over_voltage = ERROR_CODE(600, 3), // 过压
kstep_motor_run_overtime = ERROR_CODE(600, 4), // 运行超时
kstep_motor_not_enable = ERROR_CODE(600, 5), // 电机未使能
kstep_motor_ioindex_out_of_range = ERROR_CODE(600, 6), // IO超出范围
kstep_motor_subic_reset = ERROR_CODE(600, 7), // 子IC复位
kstep_motor_drv_err = ERROR_CODE(600, 8), // 驱动器异常
kstep_motor_uv_cp = ERROR_CODE(600, 9), // 驱动器异常
kstep_motor_not_found_point_edge = ERROR_CODE(600, 10), // 未找到零点
/**
* @brief mini servo error

1
api/zi_module.cpp

@ -86,7 +86,6 @@ int32_t ZIModule::module_get_error(int32_t *iserror) {
}
int32_t ZIModule::module_clear_error() {
creg.module_errorcode = 0;
creg.module_errorbitflag0 = 0;
return 0;
}

1
api/zi_module.hpp

@ -39,7 +39,6 @@ using namespace std;
typedef struct {
int32_t module_errorcode;
int32_t module_errorbitflag0;
int32_t m_module_status;
} module_common_reg_t;

21
api/zi_motor.hpp

@ -5,6 +5,22 @@
#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;
} TMC5130ErrorFlag_t;
namespace iflytop {
using namespace std;
class ZIStepMotor {
@ -21,5 +37,10 @@ class ZIStepMotor {
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_motoric_status(int32_t* errorflag) = 0;
};
} // namespace iflytop
Loading…
Cancel
Save