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.

177 lines
8.9 KiB

2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
9 months ago
11 months ago
9 months ago
9 months ago
2 years ago
1 year ago
2 years ago
  1. #pragma once
  2. #include <stdint.h>
  3. #define CMDID(cmdid, cmdSubId) ((cmdid << 8) + cmdSubId)
  4. #define NEW_CMDID(cmdid, cmdSubId) ((cmdid * 100) + cmdSubId)
  5. namespace iflytop {
  6. namespace zcr {
  7. typedef enum {
  8. #if 0
  9. virtual int32_t board_reset() = 0;
  10. #endif
  11. kboard_reset = 0x0000, //{} {}
  12. kevent_bus_reg_change_report = 0x0064, //{regindex,oldval,toval}
  13. kmodule_ping = 0x0100, //{}{}
  14. kmodule_get_status = 0x0104, //{}{int32_t}
  15. kmodule_stop = 0x0101, //{}{}
  16. kmodule_set_reg = 0x0105, //(int32_t index,int32_t val)->()
  17. kmodule_get_reg = 0x0106, //(int32_t index)->(int32_t val)
  18. kmodule_get_error = 0x010a, //
  19. kmodule_clear_error = 0x010b, //
  20. kmodule_active_cfg = 0x0110, //
  21. kxymotor_enable = 0x0301, //
  22. kxymotor_move_by = 0x0302, //
  23. kxymotor_move_to = 0x0303, //
  24. kxymotor_move_to_zero = 0x0304, //
  25. kxymotor_read_pos = 0x0306, //
  26. kxymotor_read_inio_index_in_stm32 = 0x0307, //
  27. kxymotor_read_inio = 0x0308, //
  28. kxymotor_set_pos = 0x0309, //
  29. kxymotor_motor_move_by_direct = 0x030a, //
  30. kxymotor_read_enc_direct = 0x030b, //
  31. ka8000_optical_module_power_ctrl = 0x0600, //
  32. ka8000_optical_open_laser = 0x0601, //
  33. ka8000_optical_close_laser = 0x0602, //
  34. ka8000_optical_set_laster_gain = 0x0603, //
  35. ka8000_optical_set_scan_amp_gain = 0x0604, //
  36. ka8000_optical_read_scanner_adc_val = 0x0605, //
  37. ka8000_optical_read_laster_adc_val = 0x0606, //
  38. ka8000_optical_scan_current_point_amp_adc_val = 0x0607, //
  39. ka8000_optical_start_capture = 0x0608, //
  40. ka8000_optical_read_raw = 0x0609, //
  41. ka8k_opt_v2_t_start_scan = 0x0700, //(int32_t scanDirection, int32_t lasterGain,int32_t scanGain)
  42. ka8k_opt_v2_f_start_scan = 0x0701, //(int32_t scanDirection, int32_t lasterGain,int32_t scanGain)
  43. ka8k_opt_v2_t_open_laster = 0x070a, //(int32_t lasterGain,int32_t scanGain) for_debug
  44. ka8k_opt_v2_t_close_laster = 0x070b, //() for_debug
  45. ka8k_opt_v2_t_readVal = 0x070c, //(int32_t *val0,int32_t *val1) for_debug
  46. ka8k_opt_v2_f_open_laster = 0x070d, //(int32_t lasterGain,int32_t scanGain) for_debug
  47. ka8k_opt_v2_f_close_laster = 0x070e, //() for_debug
  48. ka8k_opt_v2_f_readVal = 0x070f, //(int32_t *val0,int32_t *val1) for_debug
  49. kstep_motor_enable = 0x0201, //
  50. kstep_motor_read_pos = 0x020b, //
  51. kstep_motor_easy_rotate = 0x0211, //
  52. kstep_motor_easy_move_by = 0x0212, //
  53. kstep_motor_easy_move_to = 0x0213, //
  54. kstep_motor_easy_move_to_zero = 0x0214, //
  55. kstep_motor_easy_set_current_pos = 0x0215, //
  56. kstep_motor_easy_move_to_io = 0x0216, //
  57. kstep_motor_stop = 0x0228, //
  58. kstep_motor_active_cfg = 0x0229, //
  59. kstep_motor_read_io_state = 0x022a, //
  60. kstep_motor_easy_move_to_end_point = 0x022c, //
  61. kstep_motor_read_tmc5130_status = 0x0232, //
  62. kstep_motor_read_tmc5130_state = 0x0233, //
  63. kstep_motor_read_io_index_in_stm32 = 0x0238, //
  64. kstep_motor_set_subdevice_reg = 0x0239, //
  65. kstep_motor_get_subdevice_reg = 0x023a, //
  66. kstep_motor_easy_reciprocating_motion = 0x022d, //
  67. kstep_motor_easy_move_to_zero_point_quick = 0x022e, //
  68. kmini_servo_enable = 0x6601, //
  69. kmini_servo_read_pos = 0x6602, //
  70. kmini_servo_active_cfg = 0x6603, //
  71. kmini_servo_stop = 0x6604, //
  72. kmini_servo_set_mid_point = 0x6607, //
  73. kmini_servo_read_io_state = 0x6608, //
  74. kmini_servo_move_to = 0x6609, //
  75. kmini_servo_rotate = 0x660a, //
  76. kmini_servo_rotate_with_torque = 0x660b, //
  77. kmini_servo_set_cur_pos = 0x660c, //
  78. kextboard_read_inio = 0x6701, // para:{index}, ack:{state}
  79. kextboard_write_outio = 0x6702, // para:{index,state}, ack:{}
  80. kextboard_read_muti_inio = 0x6703, // para:{}, ack:{states}
  81. kextboard_read_inio_index_in_stm32 = 0x6704, // para:{index}, ack:{index_in_stm32}
  82. kextboard_read_outio_index_in_stm32 = 0x6705, // para:{index}, ack:{index_in_stm32}
  83. kextboard_read_outio = 0x6706, // para:{index}, ack:{state}
  84. kcode_scaner_start_scan = 0x6801, // para:{}, ack:{}
  85. kcode_scaner_stop_scan = 0x6802, // para:{}, ack:{}
  86. kcode_scaner_result_is_ready = 0x6803, // para:{}, ack:{}
  87. kcode_scaner_read_scaner_result = 0x6804, // para:{}, ack:{X}
  88. kcode_scaner_get_result_length = 0x6805, // para:{}, ack:{X}
  89. kfan_controler_set_speed = 0x6900, //
  90. ktemp_controler_start_hearting = 0x7000, //
  91. ktemp_controler_stop_hearting = 0x7001, //
  92. ktemp_controler_set_peltier_power_level = 0x7002, //
  93. ktemp_controler_set_pump_level = 0x7003, //
  94. ktemp_controler_set_fan_level = 0x7004, //
  95. ktemp_controler_enable_log = 0x7005, //
  96. ka8000_idcard_reader_read_raw = 0x7100, //
  97. ka8000_idcard_write_raw = 0x7101, //
  98. ka8000_idcard_erase = 0x7102, //
  99. ka8000_idcard_earse_unlock = 0x7103, //
  100. kevent_a8000_idcard_online = 0x71c8, //
  101. kevent_a8000_idcard_offline = 0x71c9, //
  102. kplate_code_scaner_push_card_and_scan = 0x7301, //
  103. kplate_code_scaner_stop_scan = 0x7302, //
  104. kplate_code_scaner_read_result = 0x7303, //
  105. kplate_code_scaner_read_result_point_num = 0x7304, //
  106. kplate_code_scaner_read_code = 0x7305, //
  107. kplate_code_scaner_adc_readraw = 0x7306, //
  108. kplate_code_scaner_open_laser = 0x7307, //
  109. kplate_code_scaner_close_laser = 0x7308, //
  110. /***********************************************************************************************************************
  111. * *
  112. ***********************************************************************************************************************/
  113. kpipette_zmotor_enable = 0x7400,
  114. kpipette_zmotor_move_zero = 0x7401,
  115. kpipette_zmotor_move_to_zero_point_quick = 0x7402,
  116. kpipette_zmotor_measure_distance = 0x7403,
  117. kpipette_zmotor_read_measure_distance_result = 0x7404,
  118. kpipette_zmotor_move_by = 0x7405,
  119. kpipette_zmotor_move_to = 0x7406,
  120. kpipette_init_device = 0x7407,
  121. kpipette_put_tip = 0x7408,
  122. kpipette_lld_prepare = 0x7409,
  123. kpipette_lld = 0x740A,
  124. kpipette_aspirate_prepare = 0x740B,
  125. kpipette_set_llf_velocity = 0x740C,
  126. kpipette_set_aspirate_operation_verifi_p_thre = 0x740D,
  127. kpipette_set_aspirate_operation_verifi_eigen_time = 0x740E,
  128. kpipette_set_aspirate_operation_verifi_tolerance = 0x740F,
  129. kpipette_aspirate = 0x7410,
  130. kpipette_aspirate_and_verify = 0x7411,
  131. kpipette_shake_up = 0x7412,
  132. kpipette_aspirate_infer_pressure = 0x7413,
  133. kpipette_aspirate_infer_eigen_time = 0x7414,
  134. kpipette_get_aspirate_infer_pressure_result = 0x7415,
  135. kpipette_get_aspirate_infer_eigen_time_result = 0x7416,
  136. kpipette_get_sensor_sample_data = 0x7417,
  137. kpipette_get_sensor_sample_data_num = 0x7418,
  138. kpipette_zmotor_read_zero_point_state = 0x7419,
  139. kpipette_zmotor_read_dev_status_cache = 0x741A,
  140. kpipette_lld_is_detect_liquid = 0x741B,
  141. kpipette_lld_test = 0x741C,
  142. kpipette_set_lld_startz = 0x741D,
  143. kpipette_set_lld_endz = 0x741E,
  144. kpipette_set_lld_type = 0x741F,
  145. kpipette_set_lld_c_threshold = 0x7420,
  146. kpipette_set_lld_p_threshold = 0x7421,
  147. kpipette_set_llf_startz = 0x7422,
  148. kpipette_set_llf_endz = 0x7423,
  149. } cmdid_t;
  150. typedef struct {
  151. int index;
  152. const char* fnname;
  153. } cmdinfo_t;
  154. const char* cmdid2str(int32_t code);
  155. cmdinfo_t* cmdid_get_table();
  156. int cmdid_get_table_size();
  157. } // namespace zcr
  158. } // namespace iflytop