Luigi Santivetti | 69972f9 | 2019-11-12 22:55:40 +0000 | [diff] [blame^] | 1 | /* |
| 2 | probe.h - code pertaining to probing methods |
| 3 | Part of Grbl |
| 4 | |
| 5 | Copyright (c) 2014-2016 Sungeun K. Jeon for Gnea Research LLC |
| 6 | |
| 7 | Grbl is free software: you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation, either version 3 of the License, or |
| 10 | (at your option) any later version. |
| 11 | |
| 12 | Grbl is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with Grbl. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #ifndef probe_h |
| 22 | #define probe_h |
| 23 | |
| 24 | // Values that define the probing state machine. |
| 25 | #define PROBE_OFF 0 // Probing disabled or not in use. (Must be zero.) |
| 26 | #define PROBE_ACTIVE 1 // Actively watching the input pin. |
| 27 | |
| 28 | // Probe pin initialization routine. |
| 29 | void probe_init(); |
| 30 | |
| 31 | // Called by probe_init() and the mc_probe() routines. Sets up the probe pin invert mask to |
| 32 | // appropriately set the pin logic according to setting for normal-high/normal-low operation |
| 33 | // and the probing cycle modes for toward-workpiece/away-from-workpiece. |
| 34 | void probe_configure_invert_mask(uint8_t is_probe_away); |
| 35 | |
| 36 | // Returns probe pin state. Triggered = true. Called by gcode parser and probe state monitor. |
| 37 | uint8_t probe_get_state(); |
| 38 | |
| 39 | // Monitors probe pin state and records the system position when detected. Called by the |
| 40 | // stepper ISR per ISR tick. |
| 41 | void probe_state_monitor(); |
| 42 | |
| 43 | #endif |