Fork of Smoothie to port to mbed non-LPC targets.

Dependencies:   mbed

Fork of Smoothie by Stéphane Cachat

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Endstops.h Source File

Endstops.h

00001 /*
00002       This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
00003       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.
00004       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.
00005       You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
00006 */
00007 
00008 #ifndef ENDSTOPS_MODULE_H
00009 #define ENDSTOPS_MODULE_H
00010 
00011 #include "libs/Module.h"
00012 #include "libs/Kernel.h"
00013 #include "modules/communication/utils/Gcode.h"
00014 #include "libs/StepperMotor.h"
00015 #include "libs/Pin.h"
00016 
00017 
00018 class Endstops : public Module{
00019     public:
00020         Endstops();
00021         void on_module_loaded();
00022         void on_gcode_received(void* argument);
00023         void on_config_reload(void* argument);
00024 
00025     private:
00026         void do_homing(char axes_to_move);
00027         void do_homing_corexy(char axes_to_move);
00028         void wait_for_homed(char axes_to_move);
00029         void wait_for_homed_corexy(int axis);
00030         void corexy_home(int home_axis, bool dirx, bool diry, float fast_rate, float slow_rate, unsigned int retract_steps);
00031         void trim2mm(float * mm);
00032 
00033         float steps_per_mm[3];
00034         float homing_position[3];
00035         float home_offset[3];
00036         bool home_direction[3];
00037         unsigned int  debounce_count;
00038         unsigned int  retract_steps[3];
00039         int  trim[3];
00040         float  fast_rates[3];
00041         float  slow_rates[3];
00042         Pin           pins[6];
00043         StepperMotor* steppers[3];
00044         char status;
00045         bool is_corexy;
00046         bool is_delta;
00047 };
00048 
00049 #endif