/firmware/src/shared/Commands.hh

http://github.com/makerbot/G3Firmware · C++ Header · 150 lines · 80 code · 26 blank · 44 comment · 0 complexity · 3ec1c9f4c93de9054865d225e98e551d MD5 · raw file

  1. /*
  2. * Copyright 2010 by Adam Mayer <adam@makerbot.com>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>
  16. */
  17. #ifndef SHARED_COMMANDS_H_
  18. #define SHARED_COMMANDS_H_
  19. /// @{
  20. /// \addtogroup Commands_hostQuery Host Query Commands
  21. /// Host Query Commands
  22. /// @}
  23. /// \defgroup Commands
  24. /// Communication protocol documentation
  25. ///
  26. /// These values here are also used in the replicatorG driver.
  27. /// If you modify anything here, please ensure that it is updated
  28. /// in the Sanguino3GDriver.java file in ReplicatorG.
  29. // These are our query commands from the host
  30. /// Get the motherboard firmware version
  31. /// \addtogroup Commands_hostQuery
  32. #define HOST_CMD_VERSION 0
  33. /// Initialize the motherboard
  34. /// \addtogroup Commands_hostQuery
  35. #define HOST_CMD_INIT 1
  36. #define HOST_CMD_GET_BUFFER_SIZE 2
  37. #define HOST_CMD_CLEAR_BUFFER 3
  38. #define HOST_CMD_GET_POSITION 4
  39. #define HOST_CMD_GET_RANGE 5
  40. #define HOST_CMD_SET_RANGE 6
  41. #define HOST_CMD_ABORT 7
  42. #define HOST_CMD_PAUSE 8
  43. #define HOST_CMD_PROBE 9
  44. #define HOST_CMD_TOOL_QUERY 10
  45. #define HOST_CMD_IS_FINISHED 11
  46. #define HOST_CMD_READ_EEPROM 12
  47. #define HOST_CMD_WRITE_EEPROM 13
  48. // Commands for capturing build to a file on an SD card
  49. #define HOST_CMD_CAPTURE_TO_FILE 14
  50. #define HOST_CMD_END_CAPTURE 15
  51. #define HOST_CMD_PLAYBACK_CAPTURE 16
  52. // Software reset, to workaround the problem in the v1.1 and
  53. // v1.2 motherboards that preclude hardware resets.
  54. #define HOST_CMD_RESET 17
  55. // Retrieve the next filename from the SD card's root
  56. // directory.
  57. #define HOST_CMD_NEXT_FILENAME 18
  58. // Retrieve the value of a debugging register
  59. #define HOST_CMD_GET_DBG_REG 19
  60. // Retrieve the string representing this build
  61. #define HOST_CMD_GET_BUILD_NAME 20
  62. #define HOST_CMD_GET_POSITION_EXT 21
  63. #define HOST_CMD_EXTENDED_STOP 22
  64. //#define HOST_CMD_BUILD_START_NOTIFICATION 24
  65. //#define HOST_CMD_BUILD_END_NOTIFICATION 25
  66. #define HOST_CMD_GET_COMMUNICATION_STATS 25
  67. // These are our bufferable commands from the host
  68. // #define HOST_CMD_QUEUE_POINT_INC 128 // deprecated
  69. #define HOST_CMD_QUEUE_POINT_ABS 129
  70. #define HOST_CMD_SET_POSITION 130
  71. #define HOST_CMD_FIND_AXES_MINIMUM 131
  72. #define HOST_CMD_FIND_AXES_MAXIMUM 132
  73. #define HOST_CMD_DELAY 133
  74. #define HOST_CMD_CHANGE_TOOL 134
  75. #define HOST_CMD_WAIT_FOR_TOOL 135
  76. #define HOST_CMD_TOOL_COMMAND 136
  77. #define HOST_CMD_ENABLE_AXES 137
  78. #define HOST_CMD_WAIT_FOR_PLATFORM 141
  79. #define HOST_CMD_QUEUE_POINT_EXT 139
  80. #define HOST_CMD_SET_POSITION_EXT 140
  81. #define HOST_CMD_QUEUE_POINT_NEW 142
  82. #define HOST_CMD_STORE_HOME_POSITION 143
  83. #define HOST_CMD_RECALL_HOME_POSITION 144
  84. #define HOST_CMD_DEBUG_ECHO 0x70
  85. // These are our query commands from the host
  86. #define SLAVE_CMD_VERSION 0
  87. #define SLAVE_CMD_INIT 1
  88. #define SLAVE_CMD_GET_TEMP 2
  89. #define SLAVE_CMD_SET_TEMP 3
  90. #define SLAVE_CMD_SET_MOTOR_1_PWM 4
  91. #define SLAVE_CMD_SET_MOTOR_2_PWM 5
  92. #define SLAVE_CMD_SET_MOTOR_1_RPM 6
  93. #define SLAVE_CMD_SET_MOTOR_2_RPM 7
  94. #define SLAVE_CMD_SET_MOTOR_1_DIR 8
  95. #define SLAVE_CMD_SET_MOTOR_2_DIR 9
  96. #define SLAVE_CMD_TOGGLE_MOTOR_1 10
  97. #define SLAVE_CMD_TOGGLE_MOTOR_2 11
  98. #define SLAVE_CMD_TOGGLE_FAN 12
  99. #define SLAVE_CMD_TOGGLE_VALVE 13
  100. #define SLAVE_CMD_SET_SERVO_1_POS 14
  101. #define SLAVE_CMD_SET_SERVO_2_POS 15
  102. #define SLAVE_CMD_FILAMENT_STATUS 16
  103. #define SLAVE_CMD_GET_MOTOR_1_RPM 17
  104. #define SLAVE_CMD_GET_MOTOR_2_RPM 18
  105. #define SLAVE_CMD_GET_MOTOR_1_PWM 19
  106. #define SLAVE_CMD_GET_MOTOR_2_PWM 20
  107. #define SLAVE_CMD_SELECT_TOOL 21
  108. #define SLAVE_CMD_IS_TOOL_READY 22
  109. #define SLAVE_CMD_PAUSE_UNPAUSE 23
  110. #define SLAVE_CMD_ABORT 24
  111. #define SLAVE_CMD_READ_FROM_EEPROM 25
  112. #define SLAVE_CMD_WRITE_TO_EEPROM 26
  113. #define SLAVE_CMD_TOGGLE_ABP 27
  114. #define SLAVE_CMD_GET_PLATFORM_TEMP 30
  115. #define SLAVE_CMD_SET_PLATFORM_TEMP 31
  116. #define SLAVE_CMD_GET_SP 32
  117. #define SLAVE_CMD_GET_PLATFORM_SP 33
  118. // Retrieve the string representing this build
  119. #define SLAVE_CMD_GET_BUILD_NAME 34
  120. #define SLAVE_CMD_IS_PLATFORM_READY 35
  121. #define SLAVE_CMD_GET_TOOL_STATUS 36
  122. #define SLAVE_CMD_GET_PID_STATE 37
  123. #define SLAVE_CMD_LIGHT_INDICATOR_LED 40
  124. #endif // SHARED_COMMANDS_H_