Merge pull request #390 from wolfmanjm/upstreamedge
[clinton/Smoothieware.git] / src / modules / tools / endstops / Endstops.h
CommitLineData
df27a6a3 1/*
201bcb94
AW
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.
df27a6a3 5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
201bcb94
AW
6*/
7
8#ifndef ENDSTOPS_MODULE_H
9#define ENDSTOPS_MODULE_H
10
11#include "libs/Module.h"
12#include "libs/Kernel.h"
13#include "modules/communication/utils/Gcode.h"
670fa10b 14#include "libs/StepperMotor.h"
750277f8 15#include "libs/Pin.h"
201bcb94 16
750277f8 17
201bcb94
AW
18class Endstops : public Module{
19 public:
20 Endstops();
21 void on_module_loaded();
22 void on_gcode_received(void* argument);
750277f8 23 void on_config_reload(void* argument);
64eaf21e 24 uint32_t acceleration_tick(uint32_t dummy);
201bcb94 25
47bbe224 26 private:
f29b0272
JM
27 void do_homing(char axes_to_move);
28 void do_homing_corexy(char axes_to_move);
47bbe224 29 void wait_for_homed(char axes_to_move);
3db88866 30 void wait_for_homed_corexy(int axis);
1ad23cd3 31 void corexy_home(int home_axis, bool dirx, bool diry, float fast_rate, float slow_rate, unsigned int retract_steps);
33e4cc02 32
1ad23cd3 33 float homing_position[3];
33e4cc02 34 float home_offset[3];
47bbe224
JM
35 bool home_direction[3];
36 unsigned int debounce_count;
56ce2b5a
JM
37 float retract_mm[3];
38 float trim_mm[3];
1ad23cd3
MM
39 float fast_rates[3];
40 float slow_rates[3];
64eaf21e 41 float feed_rate[3];
56ce2b5a 42 Pin pins[6];
47bbe224 43 StepperMotor* steppers[3];
750277f8 44 char status;
f29b0272 45 bool is_corexy;
959ab59c 46 bool is_delta;
201bcb94
AW
47};
48
201bcb94 49#endif