blob: 41871a66e12bc25637ad9492aa5efd6a8028a902 [file] [log] [blame]
Luigi Santivetti69972f92019-11-12 22:55:40 +00001/*
2 stepper.h - stepper motor driver: executes motion plans of planner.c using the stepper motors
3 Part of Grbl
4
5 Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
6 Copyright (c) 2009-2011 Simen Svale Skogsrud
7
8 Grbl is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 Grbl is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Grbl. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#ifndef stepper_h
23#define stepper_h
24
25#ifndef SEGMENT_BUFFER_SIZE
26 #define SEGMENT_BUFFER_SIZE 6
27#endif
28
29// Initialize and setup the stepper motor subsystem
30void stepper_init();
31
32// Enable steppers, but cycle does not start unless called by motion control or realtime command.
33void st_wake_up();
34
35// Immediately disables steppers
36void st_go_idle();
37
38// Generate the step and direction port invert masks.
39void st_generate_step_dir_invert_masks();
40
41// Reset the stepper subsystem variables
42void st_reset();
43
44// Changes the run state of the step segment buffer to execute the special parking motion.
45void st_parking_setup_buffer();
46
47// Restores the step segment buffer to the normal run state after a parking motion.
48void st_parking_restore_buffer();
49
50// Reloads step segment buffer. Called continuously by realtime execution system.
51void st_prep_buffer();
52
53// Called by planner_recalculate() when the executing block is updated by the new plan.
54void st_update_plan_block_parameters();
55
56// Called by realtime status reporting if realtime rate reporting is enabled in config.h.
57float st_get_realtime_rate();
58
59#endif