|
|
@ -65,6 +65,29 @@ void StepMotorCtrlTab::construct(QTabWidget *fathertab) { |
|
|
|
ICM->step_motor_read_io_state(getDeviceId(), atoi(args[0]), &io); |
|
|
|
ZQUI::ins()->ishow("IO:%d", io); |
|
|
|
}); |
|
|
|
|
|
|
|
box->newFunc("读取5130电机详细状态", {"ioindex"}, [this](int argn, const char **args) { |
|
|
|
ICM->callcmd0(getDeviceId(), kstep_motor_read_tmc5130_status); |
|
|
|
|
|
|
|
TMC5130MotorStatus_t status; |
|
|
|
static_assert(sizeof(status) == 4, "sizeof(TMC5130MotorStatus_t) != 4"); |
|
|
|
|
|
|
|
memcpy(&status, ICM->getAckBuf(), 4); |
|
|
|
|
|
|
|
ZQUI::ins()->ishow("sg_result :%d", status.sg_result); |
|
|
|
ZQUI::ins()->ishow("reserved0 :%d", status.reserved0); |
|
|
|
ZQUI::ins()->ishow("fsactive :%d", status.fsactive); |
|
|
|
ZQUI::ins()->ishow("cs_actual :%d", status.cs_actual); |
|
|
|
ZQUI::ins()->ishow("reserved1 :%d", status.reserved1); |
|
|
|
ZQUI::ins()->ishow("stallguard :%d", status.stallguard); |
|
|
|
ZQUI::ins()->ishow("ot :%d", status.ot); |
|
|
|
ZQUI::ins()->ishow("otpw :%d", status.otpw); |
|
|
|
ZQUI::ins()->ishow("s2ga :%d", status.s2ga); |
|
|
|
ZQUI::ins()->ishow("s2gb :%d", status.s2gb); |
|
|
|
ZQUI::ins()->ishow("ola :%d", status.ola); |
|
|
|
ZQUI::ins()->ishow("olb :%d", status.olb); |
|
|
|
ZQUI::ins()->ishow("stst :%d", status.stst); |
|
|
|
}); |
|
|
|
} |
|
|
|
tab->addSpacer(); |
|
|
|
} |
|
|
|