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.

50 lines
1.6 KiB

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. namespace iflytop {
  4. using namespace std;
  5. #define STATE_INDEX(type, subconfigindex) (type + subconfigindex)
  6. typedef enum {
  7. /**
  8. * @brief ״̬
  9. *
  10. * 0 -> 100 ģͨ״̬
  11. * 100 -> 199 1״̬
  12. * 100 -> 299 2״̬
  13. * 1000 -> 1100 xy״̬
  14. *
  15. *
  16. */
  17. kstate_module_status = STATE_INDEX(0, 0), // 0idle,1busy,2error
  18. kstate_module_errorcode = STATE_INDEX(0, 1), //
  19. kstate_motor1_move = STATE_INDEX(100, 0), //
  20. kstate_motor1_enable = STATE_INDEX(100, 1), //
  21. kstate_motor1_current = STATE_INDEX(100, 2), //
  22. kstate_motor1_vel = STATE_INDEX(100, 3), //
  23. kstate_motor1_pos = STATE_INDEX(100, 4), //
  24. kstate_motor1_temperature = STATE_INDEX(100, 5), //
  25. kstate_motor1_dpos = STATE_INDEX(100, 6), //
  26. kstate_motor2_move = STATE_INDEX(110, 0), //
  27. kstate_motor2_enable = STATE_INDEX(110, 1), //
  28. kstate_motor2_current = STATE_INDEX(110, 2), //
  29. kstate_motor2_vel = STATE_INDEX(110, 3), //
  30. kstate_motor2_pos = STATE_INDEX(110, 4), //
  31. kstate_motor2_temperature = STATE_INDEX(110, 5), //
  32. kstate_motor2_dpos = STATE_INDEX(110, 6), //
  33. kstate_xyrobot_move = STATE_INDEX(1000, 0), //
  34. kstate_xyrobot_enable = STATE_INDEX(1000, 1), //
  35. kstate_xyrobot_x_pos = STATE_INDEX(1000, 2), //
  36. kstate_xyrobot_y_pos = STATE_INDEX(1000, 3), //
  37. kstate_xyrobot_z_pos = STATE_INDEX(1000, 4), //
  38. kstate_xyrobot_x_dpos = STATE_INDEX(1000, 5), //
  39. kstate_xyrobot_y_dpos = STATE_INDEX(1000, 6), //
  40. kstate_xyrobot_z_dpos = STATE_INDEX(1000, 7), //
  41. } state_index_t;
  42. } // namespace iflytop