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.

55 lines
1.3 KiB

11 months ago
  1. #pragma once
  2. #include <stdint.h>
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #define ERROR_CODE(errortype, suberrorcode) (errortype + suberrorcode)
  7. typedef enum {
  8. ksucc = 0,
  9. kfail = 1,
  10. kparam_out_of_range = 102,
  11. kcmd_not_support = 103,
  12. kdevice_is_busy = 104,
  13. kdevice_is_offline = 105,
  14. kovertime = 106,
  15. knoack = 107,
  16. kerrorack = 108,
  17. kdevice_offline = 109,
  18. ksubdevice_overtime = 111,
  19. kbuffer_not_enough = 112,
  20. kcmd_param_num_error = 114,
  21. kcheckcode_is_error = 115,
  22. killegal_operation = 116,
  23. kstep_motor_not_found_zero_point = 600,
  24. kstep_motor_not_go_zero = 601,
  25. kstep_motor_over_temperature = 602,
  26. kstep_motor_over_voltage = 603,
  27. kstep_motor_run_overtime = 604,
  28. kstep_motor_not_enable = 605,
  29. kstep_motor_ioindex_out_of_range = 606,
  30. kstep_motor_subic_reset = 607,
  31. kstep_motor_drv_err = 608,
  32. kstep_motor_uv_cp = 609,
  33. kstep_motor_not_found_point_edge = 610,
  34. } error_t;
  35. typedef struct {
  36. int index;
  37. const char* info;
  38. } ecode_table_item_t;
  39. const char* error2str(int32_t code);
  40. ecode_table_item_t* error_get_table();
  41. int error_get_table_size();
  42. #ifdef __cplusplus
  43. }
  44. #endif