grblHAL core  20241107
alarms.h
Go to the documentation of this file.
1 /*
2  alarms.h -
3 
4  Part of grblHAL
5 
6  Copyright (c) 2017-2023 Terje Io
7  Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
8  Copyright (c) 2009-2011 Simen Svale Skogsrud
9 
10  Grbl is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  Grbl is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with Grbl. If not, see <http://www.gnu.org/licenses/>.
22 */
23 
24 #ifndef _ALARMS_H_
25 #define _ALARMS_H_
26 
27 // Alarm executor codes. Valid values (1-255). Zero is reserved.
28 typedef enum {
29  Alarm_None = 0,
39  Alarm_EStop = 10,
50 
51 typedef struct {
53  const char *description;
55 
56 typedef struct alarm_details {
57  const uint16_t n_alarms;
61 
62 typedef alarm_details_t *(*on_get_alarms_ptr)(void);
63 
65 const char *alarms_get_description (alarm_code_t id);
66 void alarms_register (alarm_details_t *details);
67 
68 #endif
69 
struct alarm_details alarm_details_t
const char * alarms_get_description(alarm_code_t id)
Definition: alarms.c:70
void alarms_register(alarm_details_t *details)
Definition: alarms.c:59
alarm_code_t
Definition: alarms.h:28
@ Alarm_LimitsEngaged
12
Definition: alarms.h:41
@ Alarm_HardLimit
1
Definition: alarms.h:30
@ Alarm_ProbeFailContact
5
Definition: alarms.h:34
@ Alarm_SoftLimit
2
Definition: alarms.h:31
@ Alarm_SelftestFailed
16
Definition: alarms.h:45
@ Alarm_HomingFailDoor
7
Definition: alarms.h:36
@ Alarm_ProbeProtect
13
Definition: alarms.h:42
@ Alarm_AlarmMax
Definition: alarms.h:48
@ Alarm_None
0
Definition: alarms.h:29
@ Alarm_AbortCycle
3
Definition: alarms.h:32
@ Alarm_Spindle
14
Definition: alarms.h:43
@ Alarm_FailPulloff
8
Definition: alarms.h:37
@ Alarm_EStop
10
Definition: alarms.h:39
@ Alarm_HomingFailApproach
9
Definition: alarms.h:38
@ Alarm_ProbeFailInitial
4
Definition: alarms.h:33
@ Alarm_HomingRequired
11
Definition: alarms.h:40
@ Alarm_HomingFailAutoSquaringApproach
15
Definition: alarms.h:44
@ Alarm_HomingFail
18
Definition: alarms.h:47
@ Alarm_HomingFailReset
6
Definition: alarms.h:35
@ Alarm_MotorFault
17
Definition: alarms.h:46
alarm_details_t * alarms_get_details(void)
Definition: alarms.c:65
Definition: alarms.h:51
const char * description
Definition: alarms.h:53
alarm_code_t id
Definition: alarms.h:52
Definition: alarms.h:56
const uint16_t n_alarms
Definition: alarms.h:57
const alarm_detail_t * alarms
Definition: alarms.h:58
struct alarm_details * next
Definition: alarms.h:59