2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4 Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
8 #ifndef ENDSTOPS_MODULE_H
9 #define ENDSTOPS_MODULE_H
11 #include "libs/Module.h"
12 #include "libs/Kernel.h"
13 #include "modules/communication/utils/Gcode.h"
14 #include "libs/StepperMotor.h"
22 #define MOVING_TO_ORIGIN_FAST 1
24 #define MOVING_TO_ORIGIN_SLOW 3
26 #define endstops_module_enable_checksum CHECKSUM("endstops_enable")
28 #define alpha_min_endstop_checksum CHECKSUM("alpha_min_endstop")
29 #define beta_min_endstop_checksum CHECKSUM("beta_min_endstop")
30 #define gamma_min_endstop_checksum CHECKSUM("gamma_min_endstop")
32 #define alpha_max_endstop_checksum CHECKSUM("alpha_max_endstop")
33 #define beta_max_endstop_checksum CHECKSUM("beta_max_endstop")
34 #define gamma_max_endstop_checksum CHECKSUM("gamma_max_endstop")
36 #define alpha_fast_homing_rate_checksum CHECKSUM("alpha_fast_homing_rate")
37 #define beta_fast_homing_rate_checksum CHECKSUM("beta_fast_homing_rate")
38 #define gamma_fast_homing_rate_checksum CHECKSUM("gamma_fast_homing_rate")
40 #define alpha_slow_homing_rate_checksum CHECKSUM("alpha_slow_homing_rate")
41 #define beta_slow_homing_rate_checksum CHECKSUM("beta_slow_homing_rate")
42 #define gamma_slow_homing_rate_checksum CHECKSUM("gamma_slow_homing_rate")
44 #define alpha_homing_retract_checksum CHECKSUM("alpha_homing_retract")
45 #define beta_homing_retract_checksum CHECKSUM("beta_homing_retract")
46 #define gamma_homing_retract_checksum CHECKSUM("gamma_homing_retract")
47 #define endstop_debounce_count_checksum CHECKSUM("endstop_debounce_count")
49 #define alpha_homing_direction_checksum CHECKSUM("alpha_homing_direction")
50 #define beta_homing_direction_checksum CHECKSUM("beta_homing_direction")
51 #define gamma_homing_direction_checksum CHECKSUM("gamma_homing_direction")
53 #define alpha_min_checksum CHECKSUM("alpha_min")
54 #define beta_min_checksum CHECKSUM("beta_min")
55 #define gamma_min_checksum CHECKSUM("gamma_min")
57 #define alpha_max_checksum CHECKSUM("alpha_max")
58 #define beta_max_checksum CHECKSUM("beta_max")
59 #define gamma_max_checksum CHECKSUM("gamma_max")
62 class Endstops
: public Module
{
64 void wait_for_homed(char axes_to_move
);
68 void on_module_loaded();
69 void on_gcode_received(void* argument
);
70 void on_config_reload(void* argument
);
72 StepperMotor
* steppers
[3];
76 unsigned int retract_steps
[3];
77 unsigned int debounce_count
;
79 double homing_position
[3];