mirror of
https://github.com/grblHAL/core.git
synced 2026-02-06 00:52:35 +08:00
Added ADC/DAC resolution to $pinstate command, changed reported values to integer for ADC/DAC devices and float formatted for PWM devices. Numeric settings can now be set via G65P1Q<n>S<value>, <n> is the setting number, <value> is the new value. Changed alarm code for Modbus exceptions (communication errors) from 14 to 19. Refactored MPG stream code to allow plugins to hook into MPG streams (via event handler). Added _free memory system parameter, returns value in KBytes or -1 if not available from driver. Changed basic stream data type from char to uint8_t, added HAL function and core API for releasing/closing UART streams.
72 lines
2.5 KiB
C
72 lines
2.5 KiB
C
/*
|
|
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_ModbusException = 19, //!< 19
|
|
Alarm_ExpanderException = 20, //!< 20
|
|
Alarm_AlarmMax = Alarm_ExpanderException
|
|
} 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
|
|
|