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.

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