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.

535 lines
33 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #pragma once
  2. #include <stdint.h>
  3. #include "api/basic_type.hpp"
  4. #include "api/i_mini_servo_module.hpp"
  5. #include "api/i_step_motor_ctrl_module.hpp"
  6. #include "api/i_xyrobot_ctrl_module.hpp"
  7. #include "zcancmder_protocol_basic.hpp"
  8. namespace iflytop {
  9. namespace zcr {
  10. typedef enum {
  11. kcmd_ping = CMDID(0, 0),
  12. kcmd_read_io = CMDID(1, 0),
  13. kcmd_set_io = CMDID(2, 0),
  14. kcmd_readadc_raw = CMDID(3, 0),
  15. kcmd_m211887_operation = CMDID(1000, 0), // ��������������
  16. kcmd_read_presure_sensor = CMDID(1001, 0), // ѹ��������
  17. kcmd_triple_warning_light_ctl = CMDID(1002, 0), // ��ɫ��ʾ�ƿ���
  18. kcmd_high_power_electrical_ctl = CMDID(1003, 0), // �����ʵ�Դ����
  19. kcmd_peristaltic_pump_ctl = CMDID(1004, 0), // Һ�ÿ���
  20. kcmd_read_huacheng_pressure_sensor = CMDID(1005, 0), // ����ѹ��������
  21. /*******************************************************************************
  22. * |Module_1006:XYRobot˿ģ *
  23. *******************************************************************************/
  24. kcmd_xy_robot_ctrl_enable = CMDID(1006, 0), // ������ʹ��
  25. kcmd_xy_robot_ctrl_stop = CMDID(1006, 1), // ������ֹͣ
  26. kcmd_xy_robot_ctrl_move_to_zero = CMDID(1006, 2), // �����˻���
  27. kcmd_xy_robot_ctrl_move_to_zero_with_calibrate = CMDID(1006, 3), // �����˻��㲢�궨
  28. kcmd_xy_robot_ctrl_move_to = CMDID(1006, 4), // �������ƶ���ָ��λ��
  29. kcmd_xy_robot_ctrl_move_by = CMDID(1006, 5), // �������ƶ�ָ������
  30. kcmd_xy_robot_ctrl_force_change_current_pos = CMDID(1006, 6), // ǿ���޸ĵ�ǰλ��
  31. kcmd_xy_robot_ctrl_read_version = CMDID(1006, 50), // ��ȡģ���ͺŰ汾��Ϣ
  32. kcmd_xy_robot_ctrl_read_status = CMDID(1006, 51), // ��ȡģ�龫��״̬��Ϣ
  33. kcmd_xy_robot_ctrl_read_detailed_status = CMDID(1006, 52), // ��ȡģ����ϸ״̬��Ϣ
  34. kcmd_xy_robot_ctrl_set_base_param = CMDID(1006, 100), // ���������
  35. kcmd_xy_robot_ctrl_get_base_param = CMDID(1006, 101), // ���������
  36. // kcmd_xy_robot_ctrl_set_warning_limit_param = CMDID(1006, 101), // ���ÿ������Ʋ���
  37. // kcmd_xy_robot_ctrl_set_run_to_zero_param = CMDID(1006, 102), // ���ù�������
  38. /*******************************************************************************
  39. * |Module_1007:ģ *
  40. *******************************************************************************/
  41. kcmd_step_motor_ctrl_enable = CMDID(1007, 0), // ʹ��
  42. kcmd_step_motor_ctrl_stop = CMDID(1007, 1), // ֹͣ
  43. kcmd_step_motor_ctrl_move_to_zero = CMDID(1007, 2), // ����
  44. kcmd_step_motor_ctrl_move_to_zero_with_calibrate = CMDID(1007, 3), // ���㲢У׼
  45. kcmd_step_motor_ctrl_move_to = CMDID(1007, 4), // �ƶ���
  46. kcmd_step_motor_ctrl_move_by = CMDID(1007, 5), // �����ƶ�
  47. kcmd_step_motor_ctrl_force_change_current_pos = CMDID(1007, 6), // �����ƶ�
  48. kcmd_step_motor_ctrl_rotate = CMDID(1007, 7), // �����ƶ�
  49. kcmd_step_motor_ctrl_read_version = CMDID(1007, 50), // ��ȡģ���ͺŰ汾��Ϣ
  50. kcmd_step_motor_ctrl_read_status = CMDID(1007, 51), // ��ȡģ�龫��״̬��Ϣ
  51. kcmd_step_motor_ctrl_read_detailed_status = CMDID(1007, 52), // ��ȡģ����ϸ״̬��Ϣ
  52. kcmd_step_motor_ctrl_set_base_param = CMDID(1007, 100), // ���������
  53. kcmd_step_motor_ctrl_get_base_param = CMDID(1007, 101), // ���������
  54. /*******************************************************************************
  55. * |Module_1008: *
  56. *******************************************************************************/
  57. kcmd_mini_servo_ctrl_enable = CMDID(1008, 0), // ʹ��
  58. kcmd_mini_servo_ctrl_stop = CMDID(1008, 1), // ֹͣ
  59. kcmd_mini_servo_ctrl_position_calibrate = CMDID(1008, 2), // У׼
  60. kcmd_mini_servo_ctrl_rotate = CMDID(1008, 3), // �ٶ�ģʽ
  61. kcmd_mini_servo_ctrl_move_to = CMDID(1008, 4), // λ��ģʽ����
  62. kcmd_mini_servo_ctrl_move_by = CMDID(1008, 5), // λ��ģʽ����
  63. kcmd_mini_servo_ctrl_run_with_torque = CMDID(1008, 6), // ����Ť��ģʽ
  64. kcmd_mini_servo_ctrl_move_by_nolimit = CMDID(1008, 7), // �����ƶ�,λ��ģʽ������,�ƶ���������λ�ú���Сλ�����ƣ����޷���ȡ����ǰλ��
  65. kcmd_mini_servo_ctrl_read_version = CMDID(1008, 50), // ��ȡģ���ͺŰ汾��Ϣ
  66. kcmd_mini_servo_ctrl_read_status = CMDID(1008, 51), // ��ȡģ�龫��״̬��Ϣ
  67. kcmd_mini_servo_ctrl_read_detailed_status = CMDID(1008, 52), // ��ȡģ����ϸ״̬��Ϣ
  68. kcmd_mini_servo_ctrl_set_run_param = CMDID(1008, 100),
  69. kcmd_mini_servo_ctrl_get_run_param = CMDID(1008, 101),
  70. kcmd_mini_servo_ctrl_set_warning_limit_param = CMDID(1008, 102),
  71. kcmd_mini_servo_ctrl_get_warning_limit_param = CMDID(1008, 103),
  72. kcmd_mini_servo_ctrl_set_basic_param = CMDID(1008, 104),
  73. kcmd_mini_servo_ctrl_get_basic_param = CMDID(1008, 105),
  74. /*******************************************************************************
  75. * |Module_1009:EEPROM *
  76. *******************************************************************************/
  77. kcmd_eeprom_read_block = CMDID(1009, 0), // ��ȡEEPROM
  78. kcmd_eeprom_write_block = CMDID(1009, 1), // �EEPROM
  79. /*******************************************************************************
  80. * |Module_1010:ɨ *
  81. *******************************************************************************/
  82. kcmd_barcode_reader_start_scan = CMDID(1010, 0), // ��ȡɨ����
  83. kcmd_barcode_reader_stop_scan = CMDID(1010, 1), // ֹͣ��ȡɨ����
  84. /*******************************************************************************
  85. * |Module_1011:-ˮ-ȿϵͳ *
  86. *******************************************************************************/
  87. // ����Ŀ���¶�
  88. kcmd_heater_ctrl_module_start_ctrl_temperature = CMDID(1011, 0), // ����Ŀ���¶�
  89. kcmd_heater_ctrl_module_read_stop_temperature = CMDID(1011, 1), // ��ȡֹͣ�¶�
  90. kcmd_heater_ctrl_module_read_version = CMDID(1011, 50), // ��ȡģ���ͺŰ汾��Ϣ
  91. kcmd_heater_ctrl_module_read_status = CMDID(1011, 51), // ��ȡģ�龫��״̬��Ϣ
  92. kcmd_heater_ctrl_module_read_detailed_status = CMDID(1011, 52), // ��ȡģ����ϸ״̬��Ϣ
  93. kcmd_heater_ctrl_module_set_run_param = CMDID(1011, 100), // ���������
  94. kcmd_heater_ctrl_module_set_warning_limit_param = CMDID(1011, 101), // �������Ʋ���
  95. /*******************************************************************************
  96. * |Module_1012:ѧģɨ *
  97. *******************************************************************************/
  98. kcmd_optical_barcode_reader_start_scan = CMDID(1012, 0), // ��ʼɨ��
  99. kcmd_optical_barcode_reader_stop_scan = CMDID(1012, 1), // ֹͣɨ��
  100. kcmd_optical_barcode_reader_motor_move_to = CMDID(1012, 4), // ˮƽ�����ƶ���
  101. kcmd_optical_barcode_reader_motor_move_to_zero = CMDID(1012, 6), // ����У׼
  102. kcmd_optical_barcode_reader_motor_move_to_zero_with_calibrate = CMDID(1012, 7), // ����У׼
  103. kcmd_optical_barcode_reader_motor_stop = CMDID(1012, 8), // ����ֹͣ
  104. kcmd_optical_barcode_reader_motor_enable = CMDID(1012, 9), // ����ʹ��
  105. kcmd_optical_barcode_reader_read_version = CMDID(1012, 50), // ��ȡģ���ͺŰ汾��Ϣ
  106. kcmd_optical_barcode_reader_read_status = CMDID(1012, 51), // ��ȡģ�龫��״̬��Ϣ
  107. kcmd_optical_barcode_reader_read_detailed_status = CMDID(1012, 52), // ��ȡģ����ϸ״̬��Ϣ
  108. kcmd_optical_barcode_reader_set_run_param = CMDID(1012, 100), // ���������
  109. kcmd_optical_barcode_reader_set_warning_limit_param = CMDID(1012, 101), // �������Ʋ���
  110. kcmd_optical_barcode_reader_set_run_to_zero_param = CMDID(1012, 102), // ���ù�������
  111. /*******************************************************************************
  112. * |Module_1013:в *
  113. *******************************************************************************/
  114. kcmd_board_clamp_module_push_and_scan = CMDID(1013, 0), // �Ƴ���Ӧ�岢ɨ��
  115. kcmd_board_clamp_module_moter_move_to = CMDID(1013, 1), // �����ƶ���
  116. kcmd_board_clamp_module_moter_move_by = CMDID(1013, 2), // �����ƶ���
  117. kcmd_board_clamp_module_moter_move_to_zero = CMDID(1013, 3), // ��������
  118. kcmd_board_clamp_module_moter_move_to_zero_with_calibrate = CMDID(1013, 4), // �������㲢У׼
  119. kcmd_board_clamp_module_moter_stop = CMDID(1013, 5), // ����ֹͣ
  120. kcmd_board_clamp_module_moter_enable = CMDID(1013, 6), // ����ʹ��
  121. kcmd_board_clamp_module_read_version = CMDID(1013, 50), // ��ȡģ���ͺŰ汾��Ϣ
  122. kcmd_board_clamp_module_read_status = CMDID(1013, 51), // ��ȡģ�龫��״̬��Ϣ
  123. kcmd_board_clamp_module_read_detailed_status = CMDID(1013, 52), // ��ȡģ����ϸ״̬��Ϣ
  124. kcmd_board_clamp_module_set_run_param = CMDID(1013, 100), // ���������
  125. kcmd_board_clamp_module_set_warning_limit_param = CMDID(1013, 101), // �������Ʋ���
  126. kcmd_board_clamp_module_set_run_to_zero_param = CMDID(1013, 102), // ���ù�������
  127. // ����
  128. /*******************************************************************************
  129. * |Module_1014: *
  130. *******************************************************************************/
  131. kcmd_fan_module_fan_ctrl = CMDID(1014, 0), // ���ȿ���
  132. kcmd_fan_module_fan_read_status = CMDID(1014, 50), // ��ȡģ�龫��״̬��Ϣ
  133. kcmd_fan_module_fan_read_detailed_status = CMDID(1014, 51), // ��ȡģ����ϸ״̬��Ϣ
  134. // ����͸��
  135. /*******************************************************************************
  136. * |Module_1015:͸ *
  137. *******************************************************************************/
  138. kcmd_serial_module_send_data = CMDID(1015, 0), // ����͸����������
  139. kcmd_serial_module_start_read_data = CMDID(1015, 1), // ����͸����ȡ����
  140. kcmd_serial_module_start_stop_data = CMDID(1015, 2), // ����͸��ֹͣ��ȡ����
  141. kcmd_serial_module_read_status = CMDID(1015, 50), // ��ȡģ��״̬��Ϣ
  142. kcmd_serial_module_set_cfg = CMDID(1015, 100), // ����͸����������
  143. // ��Һǹ����
  144. /*******************************************************************************
  145. * |Module_1016:Һǹ *
  146. *******************************************************************************/
  147. #if 0
  148. virtual int32_t enable(u8 enable) = 0;
  149. virtual int32_t stop(u8 stop_type) = 0;
  150. virtual int32_t zero_pos_calibrate(action_cb_status_t status_cb) = 0;
  151. virtual int32_t reset_device(action_cb_status_t status_cb) = 0;
  152. virtual int32_t take_tip(s16 vel, s16 height_mm, s16 tip_hight_mm, action_cb_status_t status_cb) = 0;
  153. virtual int32_t remove_tip(s16 vel, s16 height_mm, action_cb_status_t status_cb) = 0;
  154. virtual int32_t move_to(s16 vel, s16 height_mm, action_cb_status_t status_cb) = 0;
  155. virtual int32_t move_to_with_lld(s16 vel, s16 lld_cap_thr, s16 lld_max_hight_mm, s16 lld_rela_hight_mm, action_cb_status_t status_cb) = 0;
  156. virtual int32_t shake_volume(s16 shake_times, s16 shake_volume, action_cb_status_t status_cb) = 0;
  157. virtual int32_t take_and_split_liquid(s16 take_volume_mm, action_cb_status_t status_cb) = 0;
  158. /*******************************************************************************
  159. * ReadStatus *
  160. *******************************************************************************/
  161. virtual int32_t get_status(status_t &status) = 0;
  162. /*******************************************************************************
  163. * SETTING *
  164. *******************************************************************************/
  165. virtual int32_t set_z_motor_para(const I_StepMotorCtrlModule::base_param_t &z_motor_param) = 0;
  166. virtual int32_t get_z_motor_para(I_StepMotorCtrlModule::base_param_t &z_motor_param) = 0;
  167. virtual int32_t set_base_param(const base_param_t &base_param) = 0;
  168. virtual int32_t get_base_param(base_param_t &base_param) = 0;
  169. #endif
  170. kcmd_pipette_module_enable = CMDID(1016, 0), // ʹ��
  171. kcmd_pipette_module_stop = CMDID(1016, 1), // ֹͣ
  172. kcmd_pipette_module_zero_pos_calibrate = CMDID(1016, 2), // ���㲢У׼
  173. kcmd_barcode_reader_reset_device = CMDID(1016, 3), // �����豸,����,������tipͷ
  174. #if 0
  175. kcmd_pipette_module_z_motor_enable = CMDID(1016, 0), // ʹ��
  176. kcmd_pipette_module_z_motor_move_to = CMDID(1016, 1), // �ƶ���
  177. kcmd_pipette_module_z_motor_move_to_zero = CMDID(1016, 2), // ����
  178. kcmd_pipette_module_z_motor_move_to_zero_with_calibrate = CMDID(1016, 3), // ���㲢У׼
  179. kcmd_pipette_module_z_motor_stop = CMDID(1016, 4), // ֹͣ
  180. kcmd_pipette_module_take_liquid = CMDID(1016, 4), // ȡҺ��
  181. kcmd_pipette_module_split_liquid = CMDID(1016, 5), // ��Һ��
  182. kcmd_pipette_module_take_tip = CMDID(1016, 6), // ȡtip
  183. kcmd_pipette_module_remove_tip = CMDID(1016, 7), // �Ƴ�tip
  184. kcmd_pipette_module_read_version = CMDID(1016, 50), // ��ȡģ���ͺŰ汾��Ϣ
  185. kcmd_pipette_module_read_status = CMDID(1016, 51), // ��ȡģ�龫��״̬��Ϣ
  186. kcmd_pipette_module_read_detailed_status = CMDID(1016, 52), // ��ȡģ����ϸ״̬��Ϣ
  187. kcmd_pipette_module_set_run_param = CMDID(1016, 100), // ���������
  188. kcmd_pipette_module_set_warning_limit_param = CMDID(1016, 101), // �������Ʋ���
  189. kcmd_pipette_module_set_run_to_zero_param = CMDID(1016, 102), // ���ù�������
  190. #endif
  191. } CmdID_t;
  192. #pragma pack(push, 1)
  193. ZPACKET_CMD_ACK(kcmd_ping, //
  194. CMD(u8 boardid;), //
  195. ACK(u8 boardid;));
  196. ZPACKET_CMD_ACK(kcmd_read_io, //
  197. CMD(u8 ioid;), //
  198. ACK(u8 ioid; u8 val;));
  199. ZPACKET_CMD_ACK(kcmd_set_io, //
  200. CMD(u8 ioid; u8 val;), //
  201. ACK(u8 ioid; u8 val;));
  202. ZPACKET_CMD_ACK(kcmd_readadc_raw, //
  203. CMD(u8 sensorid;), //
  204. ACK(u8 sensorid; s32 val;));
  205. /*******************************************************************************
  206. * |Module_1006:XYRobot˿ģ *
  207. *******************************************************************************/
  208. // ACTION
  209. ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_enable, CMD(u8 id; u8 enable;), ACK(u8 id;));
  210. ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_stop, CMD(u8 id; u8 stop_type;), ACK(u8 id;));
  211. ZPACKET_CMD_ACK_AND_REPORT(kcmd_xy_robot_ctrl_move_to_zero, CMD(u8 id;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  212. ZPACKET_CMD_ACK_AND_REPORT(kcmd_xy_robot_ctrl_move_to_zero_with_calibrate, CMD(u8 id; s32 nowx; s32 nowy;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  213. ZPACKET_CMD_ACK_AND_REPORT(kcmd_xy_robot_ctrl_move_to, CMD(u8 id; s32 x; s32 y; s32 speed;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  214. ZPACKET_CMD_ACK_AND_REPORT(kcmd_xy_robot_ctrl_move_by, CMD(u8 id; s32 dx; s32 dy; s32 speed;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  215. ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_force_change_current_pos, CMD(u8 id; s32 x; s32 y;), ACK(u8 id;));
  216. // READ
  217. ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_read_version, CMD(u8 id;), ACK(u8 id; I_XYRobotCtrlModule::version_t ack;));
  218. ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_read_status, CMD(u8 id;), ACK(u8 id; I_XYRobotCtrlModule::status_t ack;));
  219. ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_read_detailed_status, CMD(u8 id;), ACK(u8 id; I_XYRobotCtrlModule::detailed_status_t ack;));
  220. // SET
  221. ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_set_base_param, CMD(u8 id; I_XYRobotCtrlModule::base_param_t param;), ACK(u8 id;));
  222. ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_get_base_param, CMD(u8 id;), ACK(u8 id; I_XYRobotCtrlModule::base_param_t ack;));
  223. // ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_set_warning_limit_param, CMD(u8 id; u8 opt_type; I_XYRobotCtrlModule::warning_limit_param_t param;), ACK(u8 id; I_XYRobotCtrlModule::warning_limit_param_t ack;));
  224. // ZPACKET_CMD_ACK(kcmd_xy_robot_ctrl_set_run_to_zero_param, CMD(u8 id; u8 opt_type; I_XYRobotCtrlModule::run_to_zero_param_t param;), ACK(u8 id; I_XYRobotCtrlModule::run_to_zero_param_t ack;));
  225. /*******************************************************************************
  226. * |Module_1007:ģ *
  227. *******************************************************************************/
  228. ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_enable, CMD(u8 id; u8 enable;), ACK(u8 id;));
  229. ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_stop, CMD(u8 id; u8 stop_type;), ACK(u8 id;));
  230. ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_to_zero, CMD(u8 id;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  231. ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_to_zero_with_calibrate, CMD(u8 id; s32 nowx; s32 nowy;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  232. ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_to, CMD(u8 id; s32 x; s32 speed;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  233. ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_move_by, CMD(u8 id; s32 dx; s32 speed;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  234. ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_force_change_current_pos, CMD(u8 id; s32 x;), ACK(u8 id;));
  235. ZPACKET_CMD_ACK_AND_REPORT(kcmd_step_motor_ctrl_rotate, CMD(u8 id; s32 speed; s32 run_time;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  236. // READ
  237. ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_read_version, CMD(u8 id;), ACK(u8 id; I_StepMotorCtrlModule::version_t ack;));
  238. ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_read_status, CMD(u8 id;), ACK(u8 id; I_StepMotorCtrlModule::status_t ack;));
  239. ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_read_detailed_status, CMD(u8 id;), ACK(u8 id; I_StepMotorCtrlModule::detailed_status_t ack;));
  240. // SET
  241. ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_set_base_param, CMD(u8 id; u8 opt_type; I_StepMotorCtrlModule::base_param_t param;), ACK(u8 id;));
  242. ZPACKET_CMD_ACK(kcmd_step_motor_ctrl_get_base_param, CMD(u8 id;), ACK(u8 id; I_StepMotorCtrlModule::base_param_t ack;));
  243. /*******************************************************************************
  244. * |Module_1008: *
  245. *******************************************************************************/
  246. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_enable, CMD(u8 id; u8 enable;), ACK(u8 id;));
  247. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_stop, CMD(u8 id; u8 stop_type;), ACK(u8 id;));
  248. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_position_calibrate, CMD(u8 id; s32 calibrate_pos;), ACK(u8 id;));
  249. ZPACKET_CMD_ACK_AND_REPORT(kcmd_mini_servo_ctrl_rotate, CMD(u8 id; s32 speed; s32 torque; s32 run_time;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  250. ZPACKET_CMD_ACK_AND_REPORT(kcmd_mini_servo_ctrl_move_to, CMD(u8 id; s32 pos; s32 speed; s32 torque;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  251. ZPACKET_CMD_ACK_AND_REPORT(kcmd_mini_servo_ctrl_move_by, CMD(u8 id; s32 pos; s32 speed; s32 torque;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  252. ZPACKET_CMD_ACK_AND_REPORT(kcmd_mini_servo_ctrl_run_with_torque, CMD(u8 id; s32 torque; s32 run_time;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  253. ZPACKET_CMD_ACK_AND_REPORT(kcmd_mini_servo_ctrl_move_by_nolimit, CMD(u8 id; s32 pos; s32 speed; s32 torque;), ACK(u8 id;), REPORT(u8 id; int32_t exec_status;));
  254. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_read_version, CMD(u8 id;), ACK(u8 id; I_MiniServoModule::version_t ack;));
  255. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_read_status, CMD(u8 id;), ACK(u8 id; I_MiniServoModule::status_t ack;));
  256. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_read_detailed_status, CMD(u8 id;), ACK(u8 id; I_MiniServoModule::detailed_status_t ack;));
  257. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_set_run_param, CMD(u8 id; u8 opt_type; I_MiniServoModule::run_param_t param;), ACK(u8 id; I_MiniServoModule::run_param_t ack;));
  258. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_set_basic_param, CMD(u8 id; u8 opt_type; I_MiniServoModule::basic_param_t param;), ACK(u8 id; I_MiniServoModule::basic_param_t ack;));
  259. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_set_warning_limit_param, CMD(u8 id; u8 opt_type; I_MiniServoModule::warning_limit_param_t param;), ACK(u8 id; I_MiniServoModule::warning_limit_param_t ack;));
  260. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_get_run_param, CMD(u8 id; u8 opt_type;), ACK(u8 id; I_MiniServoModule::run_param_t ack;));
  261. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_get_basic_param, CMD(u8 id; u8 opt_type;), ACK(u8 id; I_MiniServoModule::basic_param_t ack;));
  262. ZPACKET_CMD_ACK(kcmd_mini_servo_ctrl_get_warning_limit_param, CMD(u8 id; u8 opt_type;), ACK(u8 id; I_MiniServoModule::warning_limit_param_t ack;));
  263. /*******************************************************************************
  264. * |Module_1009:EEPROM *
  265. *******************************************************************************/
  266. ZPACKET_CMD_ACK(kcmd_eeprom_read_block,
  267. CMD(u8 id; u16 addr; u16 len;), //
  268. ACK(u8 id; u16 addr; u16 len; u8 data[0];));
  269. ZPACKET_CMD_ACK(kcmd_eeprom_write_block,
  270. CMD(u8 id; u16 addr; u16 len; u8 data[0];), //
  271. ACK(u8 id; u16 addr; u16 len;));
  272. /*******************************************************************************
  273. * |Module_1010:ɨ *
  274. *******************************************************************************/
  275. ZPACKET_CMD_ACK_AND_REPORT(kcmd_barcode_reader_start_scan,
  276. CMD(u8 id;), //
  277. ACK(u8 id;), //
  278. REPORT(u8 id; u8 status; u16 barcodelen; u8 barcode[0];));
  279. ZPACKET_CMD_ACK(kcmd_barcode_reader_stop_scan,
  280. CMD(u8 id;), //
  281. ACK(u8 id;));
  282. /*******************************************************************************
  283. * |Module_1011:-ˮ-ȿϵͳ *
  284. *******************************************************************************/
  285. ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_start_ctrl_temperature,
  286. CMD(u8 id; s32 target_temperature;), //
  287. ACK(u8 id;));
  288. ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_read_stop_temperature,
  289. CMD(u8 id;), //
  290. ACK(u8 id;));
  291. ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_read_version,
  292. CMD(u8 id;), //
  293. ACK(u8 id; uint32_t version;));
  294. ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_read_status,
  295. CMD(u8 id;), //
  296. ACK(u8 id; u8 status; s32 temperature;));
  297. ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_read_detailed_status,
  298. CMD(u8 id;), //
  299. ACK(u8 id; u8 status; s32 temperature;));
  300. ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_set_run_param,
  301. CMD(u8 id; u8 opt_type; s32 kp; s32 ki; s32 kd; s32 max_pwm; s32 min_temperature; s32 max_temperature;), //
  302. ACK(u8 id; u8 opt_type; s32 kp; s32 ki; s32 kd; s32 max_pwm; s32 min_temperature; s32 max_temperature;));
  303. ZPACKET_CMD_ACK(kcmd_heater_ctrl_module_set_warning_limit_param,
  304. CMD(u8 id; u8 opt_type;), //
  305. ACK(u8 id; u8 opt_type;));
  306. /*******************************************************************************
  307. * |Module_1012:ѧģɨ *
  308. *******************************************************************************/
  309. ZPACKET_CMD_ACK_AND_REPORT(kcmd_optical_barcode_reader_start_scan,
  310. CMD(u8 id;), //
  311. ACK(u8 id;), //
  312. REPORT(u8 id; u8 status; u16 codelen; u16 code[0];));
  313. ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_stop_scan,
  314. CMD(u8 id;), //
  315. ACK(u8 id;));
  316. ZPACKET_CMD_ACK_AND_REPORT(kcmd_optical_barcode_reader_motor_move_to,
  317. CMD(u8 id; u8 motor_id; s32 pos; s32 speed;), //
  318. ACK(u8 id;), //
  319. REPORT(u8 id; u8 status; s32 pos;));
  320. ZPACKET_CMD_ACK_AND_REPORT(kcmd_optical_barcode_reader_motor_move_to_zero,
  321. CMD(u8 id; u8 motor_id;), //
  322. ACK(u8 id;), //
  323. REPORT(u8 id; u8 status;));
  324. ZPACKET_CMD_ACK_AND_REPORT(kcmd_optical_barcode_reader_motor_move_to_zero_with_calibrate,
  325. CMD(u8 id; u8 motor_id; s32 now_pos;), //
  326. ACK(u8 id;), //
  327. REPORT(u8 id; u8 status; s32 zero_shift;));
  328. ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_motor_stop,
  329. CMD(u8 id; u8 motor_id;), //
  330. ACK(u8 id;));
  331. ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_read_version,
  332. CMD(u8 id;), //
  333. ACK(u8 id;));
  334. ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_read_status,
  335. CMD(u8 id;), //
  336. ACK(u8 id; u8 status; u8 hasmove2zero[2]; s32 pos[2];));
  337. ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_read_detailed_status,
  338. CMD(u8 id;), //
  339. ACK(u8 id; u8 status; u8 hasmove2zero[2]; s32 pos[2]; s32 acc[2]; s32 speed[2];));
  340. ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_set_run_param, //
  341. CMD(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];), //
  342. ACK(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];));
  343. ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_set_warning_limit_param,
  344. CMD(u8 id; u8 opt_type; s32 pad;), //
  345. ACK(u8 id; u8 opt_type; s32 pad;));
  346. ZPACKET_CMD_ACK(kcmd_optical_barcode_reader_set_run_to_zero_param,
  347. CMD(u8 id; u8 opt_type; s32 move_to_zero_max_d[2]; s32 leave_from_zero_max_d[2]; s32 speed[2]; s32 dec[2];), //
  348. ACK(u8 id; u8 opt_type; s32 move_to_zero_max_d[2]; s32 leave_from_zero_max_d[2]; s32 speed[2]; s32 dec[2];));
  349. /*******************************************************************************
  350. * Module_1013:в *
  351. *******************************************************************************/
  352. ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_push_and_scan,
  353. CMD(u8 id;), //
  354. ACK(u8 id;), //
  355. REPORT(u8 id; u8 status; u16 barcodelen; u8 barcode[0];));
  356. ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_moter_move_to,
  357. CMD(u8 id; u8 motor_id; s32 pos; s32 speed;), //
  358. ACK(u8 id;), //
  359. REPORT(u8 id; u8 status; s32 pos;));
  360. ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_moter_move_by,
  361. CMD(u8 id; u8 motor_id; s32 pos; s32 speed;), //
  362. ACK(u8 id;), //
  363. REPORT(u8 id; u8 status; s32 pos;));
  364. ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_moter_move_to_zero,
  365. CMD(u8 id; u8 motor_id;), //
  366. ACK(u8 id;), //
  367. REPORT(u8 id; u8 status;));
  368. ZPACKET_CMD_ACK_AND_REPORT(kcmd_board_clamp_module_moter_move_to_zero_with_calibrate,
  369. CMD(u8 id; u8 motor_id; s32 now_pos;), //
  370. ACK(u8 id;), //
  371. REPORT(u8 id; u8 status; s32 zero_shift;));
  372. ZPACKET_CMD_ACK(kcmd_board_clamp_module_moter_stop,
  373. CMD(u8 id; u8 motor_id;), //
  374. ACK(u8 id;));
  375. ZPACKET_CMD_ACK(kcmd_board_clamp_module_read_version,
  376. CMD(u8 id;), //
  377. ACK(u8 id;));
  378. ZPACKET_CMD_ACK(kcmd_board_clamp_module_read_status,
  379. CMD(u8 id;), //
  380. ACK(u8 id; u8 status; u8 hasmove2zero[2]; s32 pos[2];));
  381. ZPACKET_CMD_ACK(kcmd_board_clamp_module_read_detailed_status,
  382. CMD(u8 id;), //
  383. ACK(u8 id; u8 status; u8 hasmove2zero[2]; s32 pos[2]; s32 acc[2]; s32 speed[2];));
  384. ZPACKET_CMD_ACK(kcmd_board_clamp_module_set_run_param, //
  385. CMD(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];), //
  386. ACK(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];));
  387. ZPACKET_CMD_ACK(kcmd_board_clamp_module_set_warning_limit_param,
  388. CMD(u8 id; u8 opt_type; s32 pad;), //
  389. ACK(u8 id; u8 opt_type; s32 pad;));
  390. ZPACKET_CMD_ACK(kcmd_board_clamp_module_set_run_to_zero_param,
  391. CMD(u8 id; u8 opt_type; s32 move_to_zero_max_d[2]; s32 leave_from_zero_max_d[2]; s32 speed[2]; s32 dec[2];), //
  392. ACK(u8 id; u8 opt_type; s32 move_to_zero_max_d[2]; s32 leave_from_zero_max_d[2]; s32 speed[2]; s32 dec[2];));
  393. /*******************************************************************************
  394. * |Module_1014: *
  395. *******************************************************************************/
  396. ZPACKET_CMD_ACK(kcmd_fan_module_fan_ctrl,
  397. CMD(u8 id; u8 level;), //
  398. ACK(u8 id;));
  399. ZPACKET_CMD_ACK(kcmd_fan_module_fan_read_status,
  400. CMD(u8 id;), //
  401. ACK(u8 id; u8 status; u8 level;));
  402. ZPACKET_CMD_ACK(kcmd_fan_module_fan_read_detailed_status,
  403. CMD(u8 id;), //
  404. ACK(u8 id; u8 status; u8 level; int16_t fbcount;));
  405. /*******************************************************************************
  406. * |Module_1016:Һǹ *
  407. *******************************************************************************/
  408. ZPACKET_CMD_ACK(kcmd_pipette_module_motor_enable,
  409. CMD(u8 id; u8 enable;), //
  410. ACK(u8 id;));
  411. ZPACKET_CMD_ACK_AND_REPORT(kcmd_pipette_module_motor_move_to,
  412. CMD(u8 id; u8 motor_id; s32 pos; s32 speed;), //
  413. ACK(u8 id;), //
  414. REPORT(u8 id; u8 status; s32 pos;));
  415. ZPACKET_CMD_ACK_AND_REPORT(kcmd_pipette_module_motor_move_to_zero,
  416. CMD(u8 id; u8 motor_id;), //
  417. ACK(u8 id;), //
  418. REPORT(u8 id; u8 status;));
  419. ZPACKET_CMD_ACK_AND_REPORT(kcmd_pipette_module_motor_move_to_zero_with_calibrate,
  420. CMD(u8 id; u8 motor_id; s32 now_pos;), //
  421. ACK(u8 id;), //
  422. REPORT(u8 id; u8 status; s32 zero_shift;));
  423. ZPACKET_CMD_ACK(kcmd_pipette_module_motor_stop,
  424. CMD(u8 id; u8 motor_id;), //
  425. ACK(u8 id;));
  426. ZPACKET_CMD_ACK(kcmd_pipette_module_take_liquid,
  427. CMD(u8 id; u8 motor_id; s32 speed; s32 pos;), //
  428. ACK(u8 id;));
  429. ZPACKET_CMD_ACK(kcmd_pipette_module_split_liquid,
  430. CMD(u8 id; u8 motor_id; s32 speed; s32 pos;), //
  431. ACK(u8 id;));
  432. ZPACKET_CMD_ACK(kcmd_pipette_module_take_tip,
  433. CMD(u8 id; u8 motor_id; s32 speed; s32 pos;), //
  434. ACK(u8 id;));
  435. ZPACKET_CMD_ACK(kcmd_pipette_module_remove_tip,
  436. CMD(u8 id; u8 motor_id; s32 speed; s32 pos;), //
  437. ACK(u8 id;));
  438. #if 0
  439. kcmd_pipette_module_read_status = CMDID(1016, 51), // ��ȡģ�龫��״̬��Ϣ
  440. kcmd_pipette_module_read_detailed_status = CMDID(1016, 52), // ��ȡģ����ϸ״̬��Ϣ
  441. kcmd_pipette_module_set_run_param = CMDID(1016, 100), // ���������
  442. kcmd_pipette_module_set_warning_limit_param = CMDID(1016, 101), // �������Ʋ���
  443. kcmd_pipette_module_set_run_to_zero_param = CMDID(1016, 102), // ���ù�������
  444. #endif
  445. ZPACKET_CMD_ACK(kcmd_pipette_module_read_version,
  446. CMD(u8 id;), //
  447. ACK(u8 id;));
  448. ZPACKET_CMD_ACK(kcmd_pipette_module_read_status,
  449. CMD(u8 id;), //
  450. ACK(u8 id; u8 status; s32 pos[2];));
  451. ZPACKET_CMD_ACK(kcmd_pipette_module_read_detailed_status,
  452. CMD(u8 id;), //
  453. ACK(u8 id; u8 status; s32 pos[2]; s32 acc[2]; s32 speed[2];));
  454. ZPACKET_CMD_ACK(kcmd_pipette_module_set_run_param,
  455. CMD(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];), //
  456. ACK(u8 id; u8 opt_type; s32 acc[2]; s32 dec[2]; s32 max_speed[2]; s32 min_pos[2]; s32 max_pos[2];));
  457. ZPACKET_CMD_ACK(kcmd_pipette_module_set_warning_limit_param,
  458. CMD(u8 id; u8 opt_type; s32 pad;), //
  459. ACK(u8 id; u8 opt_type; s32 pad;));
  460. #pragma pack(pop)
  461. } // namespace zcr
  462. } // namespace iflytop