diff --git a/.cproject b/.cproject
index 2fe8943..70d98d5 100644
--- a/.cproject
+++ b/.cproject
@@ -30,7 +30,7 @@
-
+
-
+
@@ -231,7 +231,7 @@
-
+
@@ -252,10 +252,10 @@
-
+
-
+
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
index 5a82b33..8b143f5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "protocol"]
path = protocol
- url = zwsd@192.168.1.3:p_graphite_digester_v2/graphite_digester_protocol.git
+ url = zwsd@192.168.1.3:p_chinagoldgroup_hand_acid/hand_acid_ble_protocol.git
+[submodule "sdk"]
+ path = sdk
+ url = zwsd@192.168.1.3:p_chinagoldgroup_hand_acid/chinagoldgroup_hand_acid_stm32_sdk.git
\ No newline at end of file
diff --git a/.project b/.project
index 58b4f8e..e09ccaa 100644
--- a/.project
+++ b/.project
@@ -1,6 +1,6 @@
- graphite_digester_subboard
+ hand_acid_mainboard
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index 998c292..bc93e9c 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/graphite_digester_subboard.ioc b/graphite_digester_subboard.ioc
index d17728a..e94066c 100644
--- a/graphite_digester_subboard.ioc
+++ b/graphite_digester_subboard.ioc
@@ -215,8 +215,8 @@ ProjectManager.MultiThreaded=true
ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false
-ProjectManager.ProjectFileName=graphite_digester_subboard.ioc
-ProjectManager.ProjectName=graphite_digester_subboard
+ProjectManager.ProjectFileName=hand_acid_mainboard.ioc
+ProjectManager.ProjectName=hand_acid_mainboard
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x1001
diff --git a/graphite_digester_subboard.cfg b/hand_acid_mainboard.cfg
similarity index 100%
rename from graphite_digester_subboard.cfg
rename to hand_acid_mainboard.cfg
diff --git a/graphite_digester_subboard.launch b/hand_acid_mainboard.launch
similarity index 95%
rename from graphite_digester_subboard.launch
rename to hand_acid_mainboard.launch
index f22ad83..cbf8b36 100644
--- a/graphite_digester_subboard.launch
+++ b/hand_acid_mainboard.launch
@@ -12,7 +12,7 @@
-
+
@@ -37,7 +37,7 @@
-
+
@@ -47,7 +47,7 @@
-
+
@@ -82,13 +82,13 @@
-
-
+
+
-
+
diff --git a/usrc/components/zcancmder/basic.cpp b/usrc/components/zcancmder/basic.cpp
deleted file mode 100644
index ac8ec59..0000000
--- a/usrc/components/zcancmder/basic.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "basic.hpp"
-
-#include
-#include
-
-using namespace iflytop;
-using namespace std;
-uint16_t CanPacketRxBuffer::get_packetindex() {
- zcr_cmd_header_t *cmdheader = (zcr_cmd_header_t *)rxdata;
- return cmdheader->packetindex;
-}
-uint16_t CanPacketRxBuffer::get_cmdid() {
- zcr_cmd_header_t *cmdheader = (zcr_cmd_header_t *)rxdata;
-
- return CMDID(cmdheader->cmdMainId, cmdheader->cmdSubId);
-}
-uint8_t CanPacketRxBuffer::get_cmdSubId() {
- zcr_cmd_header_t *cmdheader = (zcr_cmd_header_t *)rxdata;
- return cmdheader->cmdSubId;
-}
-uint8_t CanPacketRxBuffer::get_packetType() {
- zcr_cmd_header_t *cmdheader = (zcr_cmd_header_t *)rxdata;
- return cmdheader->packetType;
-}
-uint8_t *CanPacketRxBuffer::get_params() {
- zcr_cmd_header_t *cmdheader = (zcr_cmd_header_t *)rxdata;
- return cmdheader->data;
-}
-uint16_t CanPacketRxBuffer::get_params_len() { return rxdataSize - sizeof(zcr_cmd_header_t); }
-void CanPacketRxBuffer::clear() {
- id = 0;
- memset(&m_canPacket, 0, sizeof(m_canPacket) / sizeof(m_canPacket[0]));
- m_canPacketNum = 0;
- m_npacket = 0;
- memset(rxdata, 0, sizeof(rxdata));
- rxdataSize = 0;
-
- dataIsReady = false;
- isOnReceive = false;
- isUsed = false;
- lostpacket = false;
-}
-
-bool CanPacketRxBuffer::iscmd(int32_t id) {
- zcr_cmd_header_t *cmdheader = (zcr_cmd_header_t *)rxdata;
- uint16_t maincmdid = ((uint32_t)id >> 8) & 0xFFFF;
- uint8_t cmdSubId = ((uint32_t)id) & 0xFF;
- return cmdheader->cmdMainId == maincmdid && cmdheader->cmdSubId == cmdSubId;
-}
-zcr_cmd_header_t *CanPacketRxBuffer::get_cmdheader() {
- zcr_cmd_header_t *cmdheader = (zcr_cmd_header_t *)rxdata;
- return cmdheader;
-}
-
-uint8_t *CanPacketRxBuffer::get_rx_raw() { return rxdata; }
-uint16_t CanPacketRxBuffer::get_rx_raw_len() { return rxdataSize; }
\ No newline at end of file
diff --git a/usrc/components/zcancmder/basic.hpp b/usrc/components/zcancmder/basic.hpp
deleted file mode 100644
index 2bd26ec..0000000
--- a/usrc/components/zcancmder/basic.hpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// Created by zwsd
-//
-
-#pragma once
-#include "sdk/sdk.hpp"
-#include "protocol/protocol.hpp"
-
-namespace iflytop {
-namespace zcr {
-typedef enum {
- kpacketHeader = 0,
- kpacketData = 1,
- kpacketTail = 2,
-} packet_type_t;
-
-typedef struct {
- // CAN_RxHeaderTypeDef pHeader;
- uint8_t dlc;
- uint8_t aData[8]; /*8byte table*/
-} CANPacket;
-
-}; // namespace zcr
-using namespace zcr;
-
-class CanPacketRxBuffer {
- public:
- uint16_t id = 0;
- CANPacket m_canPacket[100] = {0}; // 用于接收can消息
- uint8_t m_canPacketNum = 0;
- uint8_t m_npacket = 0;
- uint8_t rxdata[1000] = {0};
- int rxdataSize = 0;
-
- bool dataIsReady = false;
- bool isOnReceive = false;
- bool isUsed = false;
- bool lostpacket = false;
- bool dataIsProcessed = false;
- int32_t lastrxtime = 0;
-
- public:
- uint16_t get_packetindex();
- uint16_t get_cmdid();
- uint8_t get_cmdSubId();
- uint8_t get_packetType();
- uint8_t *get_params();
- uint16_t get_params_len();
- void clear();
-
- uint8_t* get_rx_raw();
- uint16_t get_rx_raw_len();
-
- zcr_cmd_header_t *get_cmdheader();
-
- bool iscmd(int32_t id);
-
- template
- T *get_param_as() {
- return (T *)get_params();
- }
-};
-
-} // namespace iflytop
diff --git a/usrc/components/zcancmder/protocol_event_bus_sender.cpp b/usrc/components/zcancmder/protocol_event_bus_sender.cpp
deleted file mode 100644
index 356e527..0000000
--- a/usrc/components/zcancmder/protocol_event_bus_sender.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-#include "protocol_event_bus_sender.hpp"
-namespace iflytop {
-using namespace std;
-
-void ProtocolEventBusSender::initialize(IZCanReceiver* zcanreceiver) {
- m_zcanreceiver = zcanreceiver;
- lock_.init();
-}
-
-
-void ProtocolEventBusSender::push_reg_state_change_event(int32_t moduleid, int32_t regindex, int32_t oldval, int32_t toval) {
- zlock_guard l(lock_);
-
- zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf;
- int32_t* data = (int32_t*)cmd_header->data;
- cmd_header->subModuleid = moduleid;
- cmd_header->cmdMainId = zcr::kevent_bus_reg_change_report >> 8;
- cmd_header->subModuleid = zcr::kevent_bus_reg_change_report & 0xff;
-
- data[0] = regindex;
- data[1] = oldval;
- data[2] = toval;
- m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 3);
-}
-
-void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t data0) {
- zlock_guard l(lock_);
-
- zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf;
- int32_t* data = (int32_t*)cmd_header->data;
- cmd_header->subModuleid = moduleid;
- cmd_header->cmdMainId = cmdindex >> 8;
- cmd_header->subModuleid = cmdindex & 0xff;
-
- data[0] = data0;
- m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 1);
-}
-void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t data0, int32_t data1) {
- zlock_guard l(lock_);
-
- zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf;
- int32_t* data = (int32_t*)cmd_header->data;
- cmd_header->subModuleid = moduleid;
- cmd_header->cmdMainId = cmdindex >> 8;
- cmd_header->subModuleid = cmdindex & 0xff;
-
- data[0] = data0;
- data[1] = data1;
- m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 1);
-}
-void ProtocolEventBusSender::report(int32_t moduleid, int32_t cmdindex, int32_t data0, int32_t data1, int32_t data2) {
- zlock_guard l(lock_);
-
- zcr_cmd_header_t* cmd_header = (zcr_cmd_header_t*)txbuf;
- int32_t* data = (int32_t*)cmd_header->data;
- cmd_header->subModuleid = moduleid;
- cmd_header->cmdMainId = cmdindex >> 8;
- cmd_header->subModuleid = cmdindex & 0xff;
-
- data[0] = data0;
- data[1] = data1;
- data[2] = data2;
- m_zcanreceiver->triggerEvent(cmd_header, (uint8_t*)data, 4 * 1);
-}
-
-} // namespace iflytop
\ No newline at end of file
diff --git a/usrc/components/zcancmder/protocol_event_bus_sender.hpp b/usrc/components/zcancmder/protocol_event_bus_sender.hpp
deleted file mode 100644
index 40c9e20..0000000
--- a/usrc/components/zcancmder/protocol_event_bus_sender.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#pragma once
-
-#include "basic.hpp"
-
-namespace iflytop {
-using namespace std;
-
-class ProtocolEventBusSender {
- IZCanReceiver* m_zcanreceiver = nullptr;
- zmutex lock_;
-
- uint8_t txbuf[128];
-
- public:
- static ProtocolEventBusSender* inst() {
- static ProtocolEventBusSender instance;
- return &instance;
- }
-
- void initialize(IZCanReceiver* zcanreceiver);
-
- void push_reg_state_change_event(int32_t moduleid, int32_t regindex, int32_t oldval, int32_t toval);
-
- void report(int32_t moduleid, int32_t cmdindex, int32_t data0);
- void report(int32_t moduleid, int32_t cmdindex, int32_t data0, int32_t data1);
- void report(int32_t moduleid, int32_t cmdindex, int32_t data0, int32_t data1, int32_t data2);
-
- private:
- void _report(int32_t moduleid, int32_t cmdindex, int32_t ndata, int32_t* data);
-};
-} // namespace iflytop
diff --git a/usrc/components/zcancmder/zcan_protocol_parser.cpp b/usrc/components/zcancmder/zcan_protocol_parser.cpp
deleted file mode 100644
index 69775c7..0000000
--- a/usrc/components/zcancmder/zcan_protocol_parser.cpp
+++ /dev/null
@@ -1,392 +0,0 @@
-#include "zcan_protocol_parser.hpp"
-
-#include
-#include
-
-
-using namespace iflytop;
-using namespace std;
-#define TAG "PROTO"
-
-#define REGFN(fn) regCmdFn(k##fn, fn);
-
-void ZCanProtocolParser::initialize(IZCanReceiver* cancmder) {
- m_cancmder = cancmder;
- m_cancmder->registerListener(this);
-
- REGFN(module_ping);
- REGFN(module_get_status);
- REGFN(module_set_reg);
- REGFN(module_get_reg);
- REGFN(module_get_error);
- REGFN(module_clear_error);
- REGFN(module_stop);
-
- // REGFN(step_motor_enable);
- // REGFN(step_motor_read_pos);
- // REGFN(step_motor_easy_rotate);
- // REGFN(step_motor_easy_move_by);
- // REGFN(step_motor_easy_move_to);
- // REGFN(step_motor_easy_move_to_zero);
- // REGFN(step_motor_easy_set_current_pos);
- // REGFN(step_motor_easy_move_to_io);
- // REGFN(step_motor_active_cfg);
- // REGFN(step_motor_stop);
- // REGFN(step_motor_read_io_state);
- // REGFN(step_motor_easy_move_to_end_point);
-
- // REGFN(step_motor_read_tmc5130_status);
- // REGFN(step_motor_read_tmc5130_state);
- // REGFN(step_motor_read_tmc4361a_status);
- // REGFN(step_motor_read_tmc4361a_state);
- // REGFN(step_motor_read_tmc2160_status);
- // REGFN(step_motor_read_tmc2160_state);
- // REGFN(step_motor_read_io_index_in_stm32);
-
- // REGFN(mini_servo_enable);
- // REGFN(mini_servo_read_pos);
- // REGFN(mini_servo_active_cfg);
- // REGFN(mini_servo_stop);
- // REGFN(mini_servo_set_mid_point);
- // REGFN(mini_servo_read_io_state);
-
- // REGFN(mini_servo_move_to);
- // REGFN(mini_servo_rotate);
- // REGFN(mini_servo_rotate_with_torque);
-
- // REGFN(extboard_read_inio);
- // REGFN(extboard_write_outio);
- // REGFN(extboard_read_muti_inio);
- // REGFN(extboard_read_inio_index_in_stm32);
- // REGFN(extboard_read_outio_index_in_stm32);
- // REGFN(extboard_read_outio);
-
-
-}
-void ZCanProtocolParser::_registerModule(uint16_t id, ZIModule* module) { m_modulers[id] = module; }
-void ZCanProtocolParser::registerModule(ZIModule* module) {
- int32_t moduleid = 0;
- module->getid(&moduleid);
- uint16_t id = moduleid;
- _registerModule(id, module);
-}
-
-void ZCanProtocolParser::onRceivePacket(zcr_cmd_header_t* rxcmd, uint8_t* data, int32_t len) {
- // printf("onRceivePacket cmdid:%d subModuleid:%d cmdSubId:%d\n", rxcmd->cmdMainId, rxcmd->subModuleid, rxcmd->cmdSubId);
- uint16_t subModuleid = rxcmd->subModuleid;
- auto it = m_modulers.find(subModuleid);
- if (it == m_modulers.end()) {
- return;
- }
-
- ZIModule* module = it->second;
- int32_t cmdid = CMDID(rxcmd->cmdMainId, rxcmd->cmdSubId);
- _onRceivePacket(module, rxcmd, cmdid, rxcmd->data, len);
-}
-
-void ZCanProtocolParser::regCmdFn(int32_t cmdid, cmdcb_t cb) {
- cmdfnlist[cmdfnNum].cmdid = cmdid;
- cmdfnlist[cmdfnNum].cb = cb;
- cmdfnNum++;
-}
-ZCanProtocolParser::cmdfn_t* ZCanProtocolParser::findcmdfn(int32_t cmdid) {
- for (int i = 0; i < cmdfnNum; i++) {
- if (cmdfnlist[i].cmdid == cmdid) {
- return &cmdfnlist[i];
- }
- }
- return nullptr;
-}
-
-void ZCanProtocolParser::_onRceivePacket(ZIModule* module, zcr_cmd_header_t* rxcmd, int32_t cmdid, uint8_t* param, int32_t len) {
- int paramNum = (len) / sizeof(int32_t);
- int32_t* ack = (int32_t*)&ackbuf[0];
-
- cmdfn_t* fn = findcmdfn(cmdid);
- if (!fn) {
- m_cancmder->sendErrorAck(rxcmd, err::kcmd_not_support);
- return;
- }
- cmdcontxt_t cxt = {0};
- cxt.module = module;
- cxt.rxcmd = rxcmd;
- cxt.cmdid = cmdid;
- cxt.params = (int32_t*)param;
- cxt.paramRaw = param;
- cxt.paramlen = len;
- cxt.acklen = 0;
- cxt.ackbuf = ackbuf;
-
- memset(ackbuf, 0, sizeof(ackbuf));
-
- int32_t ecode = fn->cb(&cxt);
- if (ecode != 0) {
- m_cancmder->sendErrorAck(rxcmd, ecode);
- } else {
- m_cancmder->sendBufAck(rxcmd, cxt.ackbuf, cxt.acklen);
- }
- return;
-}
-
-#define CHECK_AND_GET_MODULE(paraNum) \
- auto* module = dynamic_cast(cxt->module); \
- if (module == nullptr) return err::kcmd_not_support; \
- if (paraNum >= 0 && paraNum != cxt->paramlen / 4) return err::kcmd_param_num_error;
-
-#define GET_MODULE(paraNum) \
- auto* module = dynamic_cast(cxt->module); \
- if (module == nullptr) return err::kcmd_not_support;
-
-#define MODULE_CLASS ZIModule
-int32_t ZCanProtocolParser::module_ping(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- return module->module_ping();
-}
-int32_t ZCanProtocolParser::module_get_status(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->module_get_status(&ack[0]);
-}
-int32_t ZCanProtocolParser::module_set_reg(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(2);
- return module->module_set_reg(cxt->params[0], cxt->params[1]);
-}
-int32_t ZCanProtocolParser::module_get_reg(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->module_get_reg(cxt->params[0], &ack[0]);
-}
-
-int32_t ZCanProtocolParser::module_get_error(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->module_get_error(&ack[0]);
-}
-int32_t ZCanProtocolParser::module_clear_error(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- return module->module_clear_error();
-}
-
-int32_t ZCanProtocolParser::module_stop(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- return module->module_stop();
-}
-int32_t ZCanProtocolParser::module_active_cfg(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- return module->module_active_cfg();
-}
-
-#undef MODULE_CLASS
-
-/***********************************************************************************************************************
- * ZIStepMotor *
- ***********************************************************************************************************************/
-#if 0
-#define MODULE_CLASS ZIStepMotor
-
-int32_t ZCanProtocolParser::step_motor_enable(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->step_motor_enable(cxt->params[0]);
-}
-int32_t ZCanProtocolParser::step_motor_stop(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->step_motor_stop(cxt->params[0]);
-}
-int32_t ZCanProtocolParser::step_motor_read_pos(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->step_motor_read_pos(&ack[0]);
-}
-int32_t ZCanProtocolParser::step_motor_easy_rotate(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->step_motor_easy_rotate(cxt->params[0]);
-}
-
-int32_t ZCanProtocolParser::step_motor_easy_move_by(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->step_motor_easy_move_by(cxt->params[0]);
-}
-int32_t ZCanProtocolParser::step_motor_easy_move_to(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->step_motor_easy_move_to(cxt->params[0]);
-}
-int32_t ZCanProtocolParser::step_motor_easy_move_to_zero(cmdcontxt_t* cxt) {
- GET_MODULE(0);
- return module->step_motor_easy_move_to_zero();
-}
-int32_t ZCanProtocolParser::step_motor_easy_set_current_pos(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->step_motor_easy_set_current_pos(cxt->params[0]);
-}
-int32_t ZCanProtocolParser::step_motor_easy_move_to_io(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(2);
- return module->step_motor_easy_move_to_io(cxt->params[0], cxt->params[1]);
-}
-
-int32_t ZCanProtocolParser::step_motor_active_cfg(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- return module->step_motor_active_cfg();
-}
-int32_t ZCanProtocolParser::step_motor_read_io_state(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->step_motor_read_io_state(cxt->params[0], ack);
-}
-
-int32_t ZCanProtocolParser::step_motor_easy_move_to_end_point(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- return module->step_motor_easy_move_to_end_point();
-}
-
-int32_t ZCanProtocolParser::step_motor_read_tmc5130_status(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->step_motor_read_tmc5130_status(&ack[0]);
-}
-int32_t ZCanProtocolParser::step_motor_read_tmc5130_state(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->step_motor_read_tmc5130_state(&ack[0]);
-}
-int32_t ZCanProtocolParser::step_motor_read_tmc4361a_status(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->step_motor_read_tmc4361a_status(&ack[0]);
-}
-int32_t ZCanProtocolParser::step_motor_read_tmc4361a_state(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->step_motor_read_tmc4361a_state(&ack[0]);
-}
-int32_t ZCanProtocolParser::step_motor_read_tmc2160_status(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->step_motor_read_tmc2160_status(&ack[0]);
-}
-int32_t ZCanProtocolParser::step_motor_read_tmc2160_state(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->step_motor_read_tmc2160_state(&ack[0]);
-}
-int32_t ZCanProtocolParser::step_motor_read_io_index_in_stm32(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->step_motor_read_io_index_in_stm32(cxt->params[0], ack);
-}
-
-#undef MODULE_CLASS
-#define MODULE_CLASS ZIMiniServo
-// virtual int32_t mini_servo_enable(int32_t enable) = 0;
-// virtual int32_t mini_servo_read_pos(int32_t* pos) = 0;
-// virtual int32_t mini_servo_active_cfg() = 0;
-// virtual int32_t mini_servo_stop(int32_t breakstop) = 0;
-
-// virtual int32_t mini_servo_rotate(int32_t direction) = 0;
-// virtual int32_t mini_servo_move_to(int32_t position) = 0;
-
-// virtual int32_t mini_servo_set_mid_point() = 0;
-// virtual int32_t mini_servo_read_io_state(int32_t ioindex) = 0;
-int32_t ZCanProtocolParser::mini_servo_enable(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->mini_servo_enable(cxt->params[0]);
-}
-int32_t ZCanProtocolParser::mini_servo_read_pos(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->mini_servo_read_pos(&ack[0]);
-}
-int32_t ZCanProtocolParser::mini_servo_active_cfg(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- return module->mini_servo_active_cfg();
-}
-int32_t ZCanProtocolParser::mini_servo_stop(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->mini_servo_stop(cxt->params[0]);
-}
-int32_t ZCanProtocolParser::mini_servo_set_mid_point(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- return module->mini_servo_set_mid_point();
-}
-int32_t ZCanProtocolParser::mini_servo_read_io_state(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->mini_servo_read_io_state(cxt->params[0], ack);
-}
-
-int32_t ZCanProtocolParser::mini_servo_move_to(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->mini_servo_move_to(cxt->params[0]);
-}
-int32_t ZCanProtocolParser::mini_servo_rotate(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->mini_servo_rotate(cxt->params[0]);
-}
-int32_t ZCanProtocolParser::mini_servo_rotate_with_torque(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- return module->mini_servo_rotate_with_torque(cxt->params[0]);
-}
-
-#undef MODULE_CLASS
-
-/***********************************************************************************************************************
- * ZIBoard *
- ***********************************************************************************************************************/
-#define MODULE_CLASS ZIBoard
-int32_t ZCanProtocolParser::extboard_read_inio(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->extboard_read_inio(cxt->params[0], ack);
-}
-int32_t ZCanProtocolParser::extboard_write_outio(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(2);
- return module->kextboard_write_outio(cxt->params[0], cxt->params[1]);
-}
-
-int32_t ZCanProtocolParser::extboard_read_muti_inio(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(0);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->extboard_read_muti_inio(ack);
-}
-
-int32_t ZCanProtocolParser::extboard_read_inio_index_in_stm32(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->extboard_read_inio_index_in_stm32(cxt->params[0], ack);
-}
-int32_t ZCanProtocolParser::extboard_read_outio_index_in_stm32(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->extboard_read_outio_index_in_stm32(cxt->params[0], ack);
-}
-
-int32_t ZCanProtocolParser::extboard_read_outio(cmdcontxt_t* cxt) {
- CHECK_AND_GET_MODULE(1);
- int32_t* ack = (int32_t*)cxt->ackbuf;
- cxt->acklen = 4;
- return module->extboard_read_outio(cxt->params[0], ack);
-}
-
-#undef MODULE_CLASS
-#endif
-
-/***********************************************************************************************************************
- * ZIPipetteCtrlModule *
- ***********************************************************************************************************************/
diff --git a/usrc/components/zcancmder/zcan_protocol_parser.hpp b/usrc/components/zcancmder/zcan_protocol_parser.hpp
deleted file mode 100644
index 8042f9d..0000000
--- a/usrc/components/zcancmder/zcan_protocol_parser.hpp
+++ /dev/null
@@ -1,103 +0,0 @@
-#pragma once
-#include