Luigi Santivetti | 69972f9 | 2019-11-12 22:55:40 +0000 | [diff] [blame^] | 1 | /* |
| 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 |
| 30 | void stepper_init(); |
| 31 | |
| 32 | // Enable steppers, but cycle does not start unless called by motion control or realtime command. |
| 33 | void st_wake_up(); |
| 34 | |
| 35 | // Immediately disables steppers |
| 36 | void st_go_idle(); |
| 37 | |
| 38 | // Generate the step and direction port invert masks. |
| 39 | void st_generate_step_dir_invert_masks(); |
| 40 | |
| 41 | // Reset the stepper subsystem variables |
| 42 | void st_reset(); |
| 43 | |
| 44 | // Changes the run state of the step segment buffer to execute the special parking motion. |
| 45 | void st_parking_setup_buffer(); |
| 46 | |
| 47 | // Restores the step segment buffer to the normal run state after a parking motion. |
| 48 | void st_parking_restore_buffer(); |
| 49 | |
| 50 | // Reloads step segment buffer. Called continuously by realtime execution system. |
| 51 | void st_prep_buffer(); |
| 52 | |
| 53 | // Called by planner_recalculate() when the executing block is updated by the new plan. |
| 54 | void st_update_plan_block_parameters(); |
| 55 | |
| 56 | // Called by realtime status reporting if realtime rate reporting is enabled in config.h. |
| 57 | float st_get_realtime_rate(); |
| 58 | |
| 59 | #endif |