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