grblHAL core  20250104
coolant_control.h
Go to the documentation of this file.
1 /*
2  coolant_control.h - coolant control methods
3 
4  Part of grblHAL
5 
6  Copyright (c) 2017-2025 Terje Io
7  Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
8 
9  grblHAL is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  grblHAL is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with grblHAL. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef _COOLANT_CONTROL_H_
24 #define _COOLANT_CONTROL_H_
25 
26 // if changed to > 8 bits planner_cond_t needs to be changed too
27 typedef union {
28  uint8_t bits;
29  uint8_t mask;
30  uint8_t value;
31  struct {
32  uint8_t flood :1,
33  mist :1,
34  shower :1,
36  unused :4;
37  };
39 
40 typedef struct {
42  uint16_t on_delay;
44 
45 // Sets the coolant pins according to state specified.
47 
48 // G-code parser entry-point for setting coolant states. Checks for and executes additional conditions.
50 
51 void coolant_restore (coolant_state_t mode, uint16_t on_delay_ms);
52 
53 #endif
bool coolant_set_state_synced(coolant_state_t mode)
Definition: coolant_control.c:56
void coolant_restore(coolant_state_t mode, uint16_t on_delay_ms)
Definition: coolant_control.c:31
void coolant_set_state(coolant_state_t mode)
Definition: coolant_control.c:45
Definition: coolant_control.h:40
coolant_state_t invert
Definition: coolant_control.h:41
uint16_t on_delay
Definition: coolant_control.h:42
Definition: coolant_control.h:27
uint8_t trough_spindle
Through spindle coolant, currently unused.
Definition: coolant_control.h:35
uint8_t bits
Bitmask bits.
Definition: coolant_control.h:28
uint8_t value
Bitmask value.
Definition: coolant_control.h:30
uint8_t mask
Bitmask.
Definition: coolant_control.h:29
uint8_t shower
Shower coolant, currently unused.
Definition: coolant_control.h:34
uint8_t mist
Mist coolant, optional.
Definition: coolant_control.h:33
uint8_t flood
Flood coolant.
Definition: coolant_control.h:32
uint8_t unused
Definition: coolant_control.h:36