PageRenderTime 17ms CodeModel.GetById 6ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 18#ifndef SHARED_COMMANDS_H_
 19#define SHARED_COMMANDS_H_
 20
 21/// @{
 22
 23/// \addtogroup Commands_hostQuery Host Query Commands
 24/// Host Query Commands
 25
 26/// @}
 27
 28
 29
 30/// \defgroup Commands
 31/// Communication protocol documentation
 32///
 33/// These values here are also used in the replicatorG driver.
 34/// If you modify anything here, please ensure that it is updated
 35/// in the Sanguino3GDriver.java file in ReplicatorG.
 36
 37
 38
 39// These are our query commands from the host
 40
 41/// Get the motherboard firmware version
 42/// \addtogroup Commands_hostQuery
 43#define HOST_CMD_VERSION         0
 44
 45/// Initialize the motherboard
 46/// \addtogroup Commands_hostQuery
 47#define HOST_CMD_INIT            1
 48
 49#define HOST_CMD_GET_BUFFER_SIZE 2
 50#define HOST_CMD_CLEAR_BUFFER    3
 51#define HOST_CMD_GET_POSITION    4
 52#define HOST_CMD_GET_RANGE       5
 53#define HOST_CMD_SET_RANGE       6
 54#define HOST_CMD_ABORT           7
 55#define HOST_CMD_PAUSE           8
 56#define HOST_CMD_PROBE           9
 57#define HOST_CMD_TOOL_QUERY     10
 58#define HOST_CMD_IS_FINISHED    11
 59#define HOST_CMD_READ_EEPROM    12
 60#define HOST_CMD_WRITE_EEPROM   13
 61
 62// Commands for capturing build to a file on an SD card
 63#define HOST_CMD_CAPTURE_TO_FILE   14
 64#define HOST_CMD_END_CAPTURE       15
 65#define HOST_CMD_PLAYBACK_CAPTURE  16
 66
 67// Software reset, to workaround the problem in the v1.1 and
 68// v1.2 motherboards that preclude hardware resets.
 69#define HOST_CMD_RESET             17
 70
 71// Retrieve the next filename from the SD card's root
 72// directory.
 73#define HOST_CMD_NEXT_FILENAME     18
 74
 75// Retrieve the value of a debugging register
 76#define HOST_CMD_GET_DBG_REG       19
 77// Retrieve the string representing this build
 78#define HOST_CMD_GET_BUILD_NAME    20
 79
 80#define HOST_CMD_GET_POSITION_EXT  21
 81#define HOST_CMD_EXTENDED_STOP     22
 82
 83//#define HOST_CMD_BUILD_START_NOTIFICATION 24
 84//#define HOST_CMD_BUILD_END_NOTIFICATION 25
 85
 86#define HOST_CMD_GET_COMMUNICATION_STATS 25
 87
 88// These are our bufferable commands from the host
 89// #define HOST_CMD_QUEUE_POINT_INC   128  // deprecated
 90#define HOST_CMD_QUEUE_POINT_ABS   129
 91#define HOST_CMD_SET_POSITION      130
 92#define HOST_CMD_FIND_AXES_MINIMUM 131
 93#define HOST_CMD_FIND_AXES_MAXIMUM 132
 94#define HOST_CMD_DELAY             133
 95#define HOST_CMD_CHANGE_TOOL       134
 96#define HOST_CMD_WAIT_FOR_TOOL     135
 97#define HOST_CMD_TOOL_COMMAND      136
 98#define HOST_CMD_ENABLE_AXES       137
 99#define HOST_CMD_WAIT_FOR_PLATFORM 141
100
101#define HOST_CMD_QUEUE_POINT_EXT   139
102#define HOST_CMD_SET_POSITION_EXT  140
103
104#define HOST_CMD_QUEUE_POINT_NEW   142
105#define HOST_CMD_STORE_HOME_POSITION  143
106#define HOST_CMD_RECALL_HOME_POSITION 144
107
108#define HOST_CMD_DEBUG_ECHO        0x70
109
110// These are our query commands from the host
111#define SLAVE_CMD_VERSION                0
112#define SLAVE_CMD_INIT                   1
113#define SLAVE_CMD_GET_TEMP               2
114#define SLAVE_CMD_SET_TEMP               3
115#define SLAVE_CMD_SET_MOTOR_1_PWM        4
116#define SLAVE_CMD_SET_MOTOR_2_PWM        5
117#define SLAVE_CMD_SET_MOTOR_1_RPM        6
118#define SLAVE_CMD_SET_MOTOR_2_RPM        7
119#define SLAVE_CMD_SET_MOTOR_1_DIR        8
120#define SLAVE_CMD_SET_MOTOR_2_DIR        9
121#define SLAVE_CMD_TOGGLE_MOTOR_1        10
122#define SLAVE_CMD_TOGGLE_MOTOR_2        11
123#define SLAVE_CMD_TOGGLE_FAN            12
124#define SLAVE_CMD_TOGGLE_VALVE          13
125#define SLAVE_CMD_SET_SERVO_1_POS       14
126#define SLAVE_CMD_SET_SERVO_2_POS       15
127#define SLAVE_CMD_FILAMENT_STATUS       16
128#define SLAVE_CMD_GET_MOTOR_1_RPM       17
129#define SLAVE_CMD_GET_MOTOR_2_RPM       18
130#define SLAVE_CMD_GET_MOTOR_1_PWM       19
131#define SLAVE_CMD_GET_MOTOR_2_PWM       20
132#define SLAVE_CMD_SELECT_TOOL           21
133#define SLAVE_CMD_IS_TOOL_READY         22
134#define SLAVE_CMD_PAUSE_UNPAUSE         23
135#define SLAVE_CMD_ABORT                 24
136#define SLAVE_CMD_READ_FROM_EEPROM      25
137#define SLAVE_CMD_WRITE_TO_EEPROM       26
138#define SLAVE_CMD_TOGGLE_ABP			27
139
140#define SLAVE_CMD_GET_PLATFORM_TEMP     30
141#define SLAVE_CMD_SET_PLATFORM_TEMP     31
142#define SLAVE_CMD_GET_SP                32
143#define SLAVE_CMD_GET_PLATFORM_SP       33
144// Retrieve the string representing this build
145#define SLAVE_CMD_GET_BUILD_NAME        34
146#define SLAVE_CMD_IS_PLATFORM_READY     35
147#define SLAVE_CMD_GET_TOOL_STATUS       36
148#define SLAVE_CMD_GET_PID_STATE         37
149#define SLAVE_CMD_LIGHT_INDICATOR_LED   40
150#endif // SHARED_COMMANDS_H_