grblHAL core  20250320
hal.h
Go to the documentation of this file.
1 /*
2  hal.h - HAL (Hardware Abstraction Layer) entry points structures and capabilities type
3 
4  Part of grblHAL
5 
6  Copyright (c) 2016-2025 Terje Io
7 
8  grblHAL is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  grblHAL is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with grblHAL. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
26 #ifndef _HAL_H_
27 #define _HAL_H_
28 
29 #include <time.h>
30 
31 #include "grbl.h"
32 #include "core_handlers.h"
33 #include "gcode.h"
34 #include "coolant_control.h"
35 #include "spindle_control.h"
36 #include "crossbar.h"
37 #include "stepper.h"
38 #include "nvs.h"
39 #include "probe.h"
40 #include "ioports.h"
41 #include "rgb.h"
42 #include "plugins.h"
43 
44 #define HAL_VERSION 10
45 
46 // Bitmap flags for driver capabilities, to be set by driver in driver_init() or plugins,
47 // flags may be cleared by plugins or the core to switch off capabilities.
48 typedef union {
49  uint32_t value;
50  struct {
51  uint32_t software_debounce :1,
56  amass_level :2, // 0...3 Deprecated?
59  sd_card :1,
63  wifi :1,
67  atc :1,
73  rtc :1,
74  rtc_set :1,
76  };
77 } driver_cap_t;
78 
79 
82 
84 typedef void (*driver_reset_ptr)(void);
85 
87 typedef uint32_t (*get_free_mem_ptr)(void);
88 
92 typedef void (*register_periph_pin_ptr)(const periph_pin_t *pin);
93 
99 typedef void (*set_periph_pin_description_ptr)(const pin_function_t function, const pin_group_t group, const char *description);
100 
101 typedef struct {
104 } periph_port_t;
105 
110 typedef void (*pin_info_ptr)(xbar_t *pin, void *data);
111 
118 typedef void (*enumerate_pins_ptr)(bool low_level, pin_info_ptr callback, void *data);
119 
120 
121 /*************
122  * Coolant *
123  *************/
124 
128 typedef void (*coolant_set_state_ptr)(coolant_state_t state);
129 
134 
136 typedef struct {
140 
141 
142 /********************
143  * Limit switches *
144  ********************/
145 
150 typedef void (*limits_enable_ptr)(bool on, axes_signals_t homing_cycle);
151 
156 
161 
163 typedef struct {
167 } limits_ptrs_t;
168 
169 
170 /************
171  * Homing *
172  ************/
173 
179 
181 typedef struct {
184 } homing_ptrs_t;
185 
186 /*****************************
187  * Control signal switches *
188  *****************************/
189 
194 
199 
201 typedef struct {
205 
206 
207 /**************
208  * Steppers *
209  **************/
210 
214 typedef union {
215  uint32_t value;
216  struct {
217  uint32_t id : 8,
218  axis : 8;
219  };
220 } motor_map_t;
221 
226 
227 
233 
234 
239 typedef void (*stepper_wake_up_ptr)(void);
240 
241 
248 typedef void (*stepper_go_idle_ptr)(bool clear_signals);
249 
257 typedef void (*stepper_enable_ptr)(axes_signals_t enable, bool hold);
258 
267 
276 typedef void (*stepper_cycles_per_tick_ptr)(uint32_t cycles_per_tick);
277 
292 
302 typedef void (*stepper_output_step_ptr)(axes_signals_t step_outbits, axes_signals_t dir_outbits);
303 
308 typedef axes_signals_t (*stepper_get_ganged_ptr)(bool auto_squared);
309 
315 typedef void (*stepper_claim_motor_ptr)(uint_fast8_t axis_id, bool claim);
316 
322 typedef stepper_status_t (*stepper_status_ptr)(bool reset);
323 
328 typedef void (*stepper_interrupt_callback_ptr)(void);
329 
331 typedef struct {
345 
346 
347 /**************
348  * ms delay *
349  **************/
350 
352 typedef void (*delay_callback_ptr)(void);
353 
355 typedef struct {
356  volatile uint32_t ms;
358 } delay_t;
359 
360 
361 /***********
362  * Probe *
363  ***********/
364 
371 
376 typedef void (*probe_configure_ptr)(bool is_probe_away, bool probing);
377 
383 typedef void (*probe_connected_toggle_ptr)(void);
384 
386 typedef struct {
390 } probe_ptrs_t;
391 
392 
393 /*******************************
394  * Tool selection and change *
395  *******************************/
396 
401 typedef void (*tool_select_ptr)(tool_data_t *tool, bool next);
402 
407 
414 typedef struct {
417 } tool_ptrs_t;
418 
419 
420 /*******************
421  * Encoder input *
422  *******************/
423 
427 typedef uint8_t (*encoder_get_n_encoders_ptr)(void);
428 
433 typedef void (*encoder_on_event_ptr)(encoder_t *encoder, int32_t position);
434 
438 typedef void (*encoder_reset_ptr)(uint_fast8_t id);
439 
440 typedef struct {
445 
451 typedef bool (*irq_claim_ptr)(irq_type_t irq, uint_fast8_t id, irq_callback_ptr callback);
452 
453 /************
454  * Timers *
455  ************/
456 
457 typedef void *hal_timer_t;
458 
459 typedef enum {
464 
465 typedef union {
466  uint8_t value;
467  struct {
468  uint8_t periodic :1,
469  up :1,
470  comp1 :1,
471  comp2 :1;
472  };
473 } timer_cap_t;
474 
475 typedef void (*timer_irq_handler_ptr)(void *context);
476 
477 typedef struct {
478  void *context;
479  bool single_shot;
481  uint32_t irq0;
483  uint32_t irq1;
485 } timer_cfg_t;
486 
492 typedef hal_timer_t (*timer_claim_ptr)(timer_cap_t cap, uint32_t timebase);
493 
499 typedef bool (*timer_cfg_ptr)(hal_timer_t timer, timer_cfg_t *cfg);
500 
506 typedef bool (*timer_start_ptr)(hal_timer_t timer, uint32_t period);
507 
512 typedef bool (*timer_stop_ptr)(hal_timer_t timer);
513 
514 typedef struct {
519 } timer_ptrs_t;
520 
521 /**************************
522  * RTC (Real Time Clock *
523  **************************/
524 
529 typedef bool (*rtc_get_datetime_ptr)(struct tm *datetime);
530 
535 typedef bool (*rtc_set_datetime_ptr)(struct tm *datetime);
536 
537 typedef struct {
540 } rtc_ptrs_t;
541 
542 
543 
546 typedef void (*pallet_shuttle_ptr)(void);
547 
557 typedef struct {
558  uint32_t version;
559  char *info;
562  char *driver_url;
563  char *board;
564  char *board_url;
565  uint32_t f_step_timer;
566  uint32_t f_mcu;
567  uint32_t rx_buffer_size;
568  uint32_t max_step_rate;
570 
573 
580 
590  void (*delay_ms)(uint32_t ms, delay_callback_ptr callback);
591 
596  void (*set_bits_atomic)(volatile uint_fast16_t *value, uint_fast16_t bits);
597 
603  uint_fast16_t (*clear_bits_atomic)(volatile uint_fast16_t *value, uint_fast16_t v);
604 
610  uint_fast16_t (*set_value_atomic)(volatile uint_fast16_t *value, uint_fast16_t bits);
611 
613  void (*irq_enable)(void);
614 
616  void (*irq_disable)(void);
617 
620 
640  bool (*driver_release)(void);
641  uint32_t (*get_elapsed_ticks)(void);
642  uint64_t (*get_micros)(void);
644  void (*reboot)(void);
645 
647 
651  bool (*get_position)(int32_t (*position)[N_AXIS]);
652 
653 #ifdef DEBUGOUT
654  void (*debug_out)(bool on);
655  io_stream_t debug;
656 #endif
657 
665  bool (*stream_blocking_callback)(void);
666 
675 } grbl_hal_t;
676 
677 extern grbl_hal_t hal;
678 
689 extern bool driver_init (void);
690 
691 #endif
#define N_AXIS
Defines number of axes supported - minimum 3, maximum 8. If more than 3 axes are configured a complia...
Definition: config.h:42
core function pointers and data structures definitions.
bool(* irq_callback_ptr)(uint_fast8_t id, bool level)
Definition: crossbar.h:528
pin_function_t
Definition: crossbar.h:27
pin_group_t
Definition: crossbar.h:467
irq_type_t
Definition: crossbar.h:523
status_code_t
Definition: errors.h:30
parser_state_t gc_state
Definition: gcode.c:122
void(* stepper_enable_ptr)(axes_signals_t enable, bool hold)
Pointer to function for enabling/disabling stepper motors.
Definition: hal.h:257
status_code_t(* tool_change_ptr)(parser_state_t *gc_state)
Pointer to function for executing a tool change.
Definition: hal.h:406
void * hal_timer_t
Timer handle, actual type defined by driver implementation.
Definition: hal.h:457
void(* delay_callback_ptr)(void)
Signature of delay callback functions.
Definition: hal.h:352
home_signals_t(* home_get_state_ptr)(void)
Pointer to function for getting home switches state.
Definition: hal.h:177
void(* stepper_disable_motors_ptr)(axes_signals_t axes, squaring_mode_t mode)
Pointer to function for enabling/disabling step signals for individual motors.
Definition: hal.h:266
coolant_state_t(* coolant_get_state_ptr)(void)
Pointer to function for getting the coolant state.
Definition: hal.h:133
void(* probe_connected_toggle_ptr)(void)
Pointer to function for toggling probe connected status.
Definition: hal.h:383
hal_timer_t(* timer_claim_ptr)(timer_cap_t cap, uint32_t timebase)
Pointer to function for claiming a timer.
Definition: hal.h:492
void(* motor_iterator_ptr)(motor_iterator_callback_ptr callback)
Pointer to function for iterating over stepper motor vs. axis mappings.
Definition: hal.h:232
void(* motor_iterator_callback_ptr)(motor_map_t motor)
Signature of the callback function to receive motor vs. axis mappings.
Definition: hal.h:225
void(* pin_info_ptr)(xbar_t *pin, void *data)
Pointer to callback function for pin enumerations.
Definition: hal.h:110
void(* driver_reset_ptr)(void)
Pointer to function to be called when a soft reset occurs.
Definition: hal.h:84
void(* encoder_on_event_ptr)(encoder_t *encoder, int32_t position)
Pointer to callback function to receive encoder events.
Definition: hal.h:433
void(* coolant_set_state_ptr)(coolant_state_t state)
Pointer to function for setting the coolant state.
Definition: hal.h:128
void(* limits_enable_ptr)(bool on, axes_signals_t homing_cycle)
Pointer to function for enabling/disabling limit switches functionality.
Definition: hal.h:150
bool(* timer_cfg_ptr)(hal_timer_t timer, timer_cfg_t *cfg)
Pointer to function for configuring a timer.
Definition: hal.h:499
limit_signals_t(* limits_get_state_ptr)(void)
Pointer to function for getting limit switches state.
Definition: hal.h:155
uint32_t(* get_free_mem_ptr)(void)
Pointer to function for getting free memory (as sum of all free blocks in the heap).
Definition: hal.h:87
bool(* driver_setup_ptr)(settings_t *settings)
Pointer to function called to set up driver peripherals after settings are loaded.
Definition: hal.h:81
void(* timer_irq_handler_ptr)(void *context)
Definition: hal.h:475
void(* stepper_cycles_per_tick_ptr)(uint32_t cycles_per_tick)
Pointer to function for setting the step pulse interrupt rate for the next motion segment.
Definition: hal.h:276
float(* homing_get_feedrate_ptr)(axes_signals_t axes, homing_mode_t mode)
Definition: hal.h:178
void(* stepper_claim_motor_ptr)(uint_fast8_t axis_id, bool claim)
Pointer to function for claiming/releasing motor(s) from/to normal step/dir signalling.
Definition: hal.h:315
void(* stepper_output_step_ptr)(axes_signals_t step_outbits, axes_signals_t dir_outbits)
Pointer to function for outputting a single step pulse and direction signal.
Definition: hal.h:302
void(* pallet_shuttle_ptr)(void)
Pointer to function for performing a pallet shuttle.
Definition: hal.h:546
void(* stepper_interrupt_callback_ptr)(void)
Pointer to callback function for outputting the next direction and step pulse signals....
Definition: hal.h:328
bool(* rtc_get_datetime_ptr)(struct tm *datetime)
Pointer to function for setting the current datetime.
Definition: hal.h:529
void(* tool_select_ptr)(tool_data_t *tool, bool next)
Pointer to function for selecting a tool.
Definition: hal.h:401
control_signals_t(* control_signals_get_state_ptr)(void)
Pointer to function for getting control switches state.
Definition: hal.h:193
void(* stepper_go_idle_ptr)(bool clear_signals)
Pointer to function for disabling the main stepper interrupt.
Definition: hal.h:248
bool(* irq_claim_ptr)(irq_type_t irq, uint_fast8_t id, irq_callback_ptr callback)
Pointer to function for claiming higher level interrupt requests (irq).
Definition: hal.h:451
void(* control_signals_callback_ptr)(control_signals_t signals)
Pointer to callback function for reporting control switches events (interrupts). Set by the core on s...
Definition: hal.h:198
void(* enumerate_pins_ptr)(bool low_level, pin_info_ptr callback, void *data)
Pointer to function for enumerate pin information.
Definition: hal.h:118
void(* limit_interrupt_callback_ptr)(limit_signals_t state)
Pointer to callback function for reporting limit switches events (interrupts). Set by the core on sta...
Definition: hal.h:160
uint8_t(* encoder_get_n_encoders_ptr)(void)
Pointer to function for getting number of encoders supported.
Definition: hal.h:427
void(* stepper_pulse_start_ptr)(stepper_t *stepper)
Pointer to function for setting up steppers for the next step pulse.
Definition: hal.h:291
void(* set_periph_pin_description_ptr)(const pin_function_t function, const pin_group_t group, const char *description)
Pointer to function for setting pin description for a peripheral pin.
Definition: hal.h:99
void(* probe_configure_ptr)(bool is_probe_away, bool probing)
Pointer to function for setting probe operation mode.
Definition: hal.h:376
stepper_status_t(* stepper_status_ptr)(bool reset)
Pointer to function for querying or resetting stepper driver status.
Definition: hal.h:322
grbl_hal_t hal
Global HAL struct.
Definition: grbllib.c:91
timer_resolution_t
Definition: hal.h:459
@ Timer_16bit
Definition: hal.h:460
@ Timer_64bit
Definition: hal.h:462
@ Timer_32bit
Definition: hal.h:461
probe_state_t(* probe_get_state_ptr)(void)
Pointer to function for getting probe status.
Definition: hal.h:370
void(* register_periph_pin_ptr)(const periph_pin_t *pin)
Pointer to function for registering information about a peripheral pin.
Definition: hal.h:92
bool(* rtc_set_datetime_ptr)(struct tm *datetime)
Pointer to function for setting the current datetime.
Definition: hal.h:535
void(* stepper_wake_up_ptr)(void)
Pointer to function for enabling all stepper motors and the main stepper interrupt.
Definition: hal.h:239
bool(* timer_stop_ptr)(hal_timer_t timer)
Pointer to function for stopping a running timer.
Definition: hal.h:512
bool driver_init(void)
Driver main entry point. This will be called once by the core after the HAL structure has been nulled...
void(* encoder_reset_ptr)(uint_fast8_t id)
Pointer to function for resetting encoder data.
Definition: hal.h:438
bool(* timer_start_ptr)(hal_timer_t timer, uint32_t period)
Pointer to function for starting a timer.
Definition: hal.h:506
axes_signals_t(* stepper_get_ganged_ptr)(bool auto_squared)
Pointer to function for getting which axes are configured for auto squaring.
Definition: hal.h:308
homing_mode_t
Definition: machine_limits.h:30
settings_t settings
Definition: settings.c:43
void(* settings_changed_ptr)(settings_t *settings, settings_changed_flags_t changed)
Pointer to callback function to be called when settings are loaded or changed.
Definition: settings.h:1046
squaring_mode_t
Definition: stepper.h:29
Control switches handlers.
Definition: hal.h:201
control_signals_get_state_ptr get_state
Handler for getting limit switches status.
Definition: hal.h:202
control_signals_callback_ptr interrupt_callback
Callback for informing about control switches events. _Set by the core at startup.
Definition: hal.h:203
Handlers for coolant support.
Definition: hal.h:136
coolant_get_state_ptr get_state
Handler for getting coolant state.
Definition: hal.h:138
coolant_set_state_ptr set_state
Handler for setting coolant state.
Definition: hal.h:137
Delay struct, currently not used by core - may be used by drivers.
Definition: hal.h:355
volatile uint32_t ms
Definition: hal.h:356
delay_callback_ptr callback
Definition: hal.h:357
Definition: hal.h:440
encoder_reset_ptr reset
Optional handler for resetting data for an encoder.
Definition: hal.h:443
encoder_get_n_encoders_ptr get_n_encoders
Optional handler for getting number of encoders supported.
Definition: hal.h:441
encoder_on_event_ptr on_event
Optional callback handler for receiving encoder events.
Definition: hal.h:442
Definition: plugins.h:214
HAL structure used for the driver interface.
Definition: hal.h:557
home_signals_t home_cap
Home input signals supported by the driver.
Definition: hal.h:671
uint32_t rx_buffer_size
Input stream buffer size in bytes.
Definition: hal.h:567
char * driver_version
Pointer to driver version date string in YYMMDD format.
Definition: hal.h:560
control_signals_ptrs_t control
Handlers for control switches.
Definition: hal.h:623
encoder_ptrs_t encoder
Optional handlers for encoder support.
Definition: hal.h:646
homing_ptrs_t homing
Handlers for homing switches, used by homing cycle.
Definition: hal.h:622
nvs_io_t nvs
Optional handlers for storing/retrieving settings and data to/from non-volatile storage (NVS).
Definition: hal.h:638
io_stream_t stream
Handlers for stream I/O.
Definition: hal.h:627
uint32_t max_step_rate
Currently unused.
Definition: hal.h:568
spindle_data_ptrs_t spindle_data
Handlers for getting/resetting spindle data (RPM, angular position, ...).
Definition: hal.h:625
char * board
Pointer to optional board name string.
Definition: hal.h:563
uint8_t driver_axis_settings
Currently unused.
Definition: hal.h:569
char * info
Pointer to driver info string, typically name of processor/platform.
Definition: hal.h:559
coolant_ptrs_t coolant
Handlers for coolant.
Definition: hal.h:624
enumerate_pins_ptr enumerate_pins
Optional handler for enumerating pins used by the driver.
Definition: hal.h:639
get_free_mem_ptr get_free_mem
Optional pointer to function for getting free memory (as sum of all free blocks in the heap).
Definition: hal.h:572
periph_port_t periph_port
Optional handlers for peripheral pin registration.
Definition: hal.h:636
limit_signals_t limits_cap
Limit input signals supported by the driver.
Definition: hal.h:670
rtc_ptrs_t rtc
Optional handlers for real time clock (RTC).
Definition: hal.h:632
timer_ptrs_t timer
Optional handlers for claiming and controlling timers.
Definition: hal.h:631
char * board_url
Pointer to optional URL for the board.
Definition: hal.h:564
limits_ptrs_t limits
Handlers for limit switches.
Definition: hal.h:621
rgb_ptr_t rgb0
Optional handler for RGB output to LEDs (neopixels) or lamps.
Definition: hal.h:634
uint32_t f_step_timer
Frequency of main stepper timer in Hz.
Definition: hal.h:565
settings_changed_ptr settings_changed
Callback handler to be called on settings loaded or settings changed events.
Definition: hal.h:628
coolant_state_t coolant_cap
Coolant outputs supported by the driver.
Definition: hal.h:672
stepper_ptrs_t stepper
Handlers for stepper motors.
Definition: hal.h:626
uint32_t f_mcu
Frequency of MCU in MHz.
Definition: hal.h:566
driver_setup_ptr driver_setup
Driver setup handler. Called once by the core after settings has been loaded. The driver should enabl...
Definition: hal.h:579
irq_claim_ptr irq_claim
Optional handler for claiming higher level interrupts. Set to a dummy handler on startup.
Definition: hal.h:619
control_signals_t signals_pullup_disable_cap
Control input signals pullup disable supported by the driver.
Definition: hal.h:669
tool_ptrs_t tool
Optional handlers for tool changes.
Definition: hal.h:630
char * driver_url
Pointer to optional URL for the driver.
Definition: hal.h:562
driver_cap_t driver_cap
Basic driver capabilities flags.
Definition: hal.h:667
driver_reset_ptr driver_reset
Optional handler, called on soft resets. Set to a dummy handler by the core at startup.
Definition: hal.h:637
io_port_t port
Optional handlers for axuillary I/O (adds support for M62-M66).
Definition: hal.h:633
uint32_t version
HAL version, set by the core. Driver should check against this in the driver_init() function.
Definition: hal.h:558
home_signals_t motor_warning_cap
Motor warning input signals (per motor) supported by the driver.
Definition: hal.h:673
char * driver_options
Pointer to optional comma separated string with driver options.
Definition: hal.h:561
rgb_ptr_t rgb1
Optional handler for RGB output to LEDs (neopixels) or lamps.
Definition: hal.h:635
control_signals_t signals_cap
Control input signals supported by the driver.
Definition: hal.h:668
pallet_shuttle_ptr pallet_shuttle
Optional handler for performing a pallet shuttle on program end (M60).
Definition: hal.h:643
home_signals_t motor_fault_cap
Motor fault input signals (per motor) supported by the driver.
Definition: hal.h:674
probe_ptrs_t probe
Optional handlers for probe input(s).
Definition: hal.h:629
Home switches struct, consists of two packed axes_signals_t structs.
Definition: nuts_bolts.h:163
Limit switches handler for homing cycle.
Definition: hal.h:181
home_get_state_ptr get_state
Handler for getting homing switches status. Usually read from hal.limits.get_state.
Definition: hal.h:182
homing_get_feedrate_ptr get_feedrate
Definition: hal.h:183
Properties and handlers for auxiliary digital and analog I/O.
Definition: ioports.h:113
Properties and handlers for stream I/O.
Definition: stream.h:244
Limit switches handlers.
Definition: hal.h:163
limits_enable_ptr enable
Handler for enabling limits handling mode.
Definition: hal.h:164
limits_get_state_ptr get_state
Handler for getting limit switches status.
Definition: hal.h:165
limit_interrupt_callback_ptr interrupt_callback
Callback for informing about limit switches events. Set by the core at startup.
Definition: hal.h:166
Handler functions and variables for NVS storage of settings and data.
Definition: nvs.h:138
Parser state.
Definition: gcode.h:613
Definition: crossbar.h:692
Definition: hal.h:101
set_periph_pin_description_ptr set_pin_description
Optional handler for setting a description of a peripheral pin.
Definition: hal.h:103
register_periph_pin_ptr register_pin
Opional handler for registering information about a peripheral pin (with the driver).
Definition: hal.h:102
Handlers for probe input(s).
Definition: hal.h:386
probe_configure_ptr configure
Optional handler for setting probe operation mode.
Definition: hal.h:387
probe_connected_toggle_ptr connected_toggle
Optional handler for toggling probe connected status.
Definition: hal.h:389
probe_get_state_ptr get_state
Optional handler for getting probe status. Called from interrupt context.
Definition: hal.h:388
Definition: rgb.h:74
Definition: hal.h:537
rtc_set_datetime_ptr set_datetime
Optional handler setting the current datetime.
Definition: hal.h:539
rtc_get_datetime_ptr get_datetime
Optional handler getting the current datetime.
Definition: hal.h:538
Definition: settings.h:843
Definition: spindle_control.h:332
Stepper motor handlers.
Definition: hal.h:331
stepper_get_ganged_ptr get_ganged
Optional handler getting which axes are configured for ganging or auto squaring.
Definition: hal.h:339
stepper_enable_ptr enable
Handler for enabling/disabling stepper motor power for individual motors. Called from interrupt conte...
Definition: hal.h:334
stepper_cycles_per_tick_ptr cycles_per_tick
Handler for setting the step pulse rate for the next motion segment. Called from interrupt context.
Definition: hal.h:336
stepper_output_step_ptr output_step
Optional handler for outputting a single step pulse. Experimental. Called from interrupt context.
Definition: hal.h:341
stepper_interrupt_callback_ptr interrupt_callback
Callback for informing about the next step pulse to output. Set by the core at startup.
Definition: hal.h:338
stepper_pulse_start_ptr pulse_start
Handler for starting outputting direction signals and a step pulse. Called from interrupt context.
Definition: hal.h:337
stepper_wake_up_ptr wake_up
Handler for enabling stepper motor power and main stepper interrupt.
Definition: hal.h:332
motor_iterator_ptr motor_iterator
Optional handler iteration over motor vs. axis mappings. Required for the motors plugin (Trinamic dri...
Definition: hal.h:342
stepper_claim_motor_ptr claim_motor
Optional handler for claiming/releasing motor(s) from normal step/dir control.
Definition: hal.h:340
stepper_status_ptr status
Optional handler handler for querying steppper driver status or attempting to reset it.
Definition: hal.h:343
stepper_go_idle_ptr go_idle
Handler for disabling main stepper interrupt and optionally reset stepper signals....
Definition: hal.h:333
stepper_disable_motors_ptr disable_motors
Optional handler for enabling/disabling stepper motor step signals for individual motors.
Definition: hal.h:335
// Stepper driver warning and fault signal states, consists of two packed stepper_state_t structs in ...
Definition: nuts_bolts.h:175
Stepper ISR data struct. Contains the running data for the main stepper ISR.
Definition: stepper.h:84
Definition: hal.h:477
uint32_t irq1
Compare value for compare interrupt 10.
Definition: hal.h:483
timer_irq_handler_ptr irq1_callback
Pointer to compare interrupt 1 callback.
Definition: hal.h:484
timer_irq_handler_ptr irq0_callback
Pointer to compare interrupt 0 callback.
Definition: hal.h:482
timer_irq_handler_ptr timeout_callback
Pointer to main timeout callback.
Definition: hal.h:480
bool single_shot
Set to true if timer is single shot.
Definition: hal.h:479
void * context
Pointer to data to be passed on to the interrupt handlers.
Definition: hal.h:478
uint32_t irq0
Compare value for compare interrupt 0.
Definition: hal.h:481
Definition: hal.h:514
timer_stop_ptr stop
Definition: hal.h:518
timer_start_ptr start
Definition: hal.h:517
timer_claim_ptr claim
Definition: hal.h:515
timer_cfg_ptr configure
Definition: hal.h:516
Definition: vfs.h:47
Tool data.
Definition: gcode.h:603
Handlers for tool changes.
Definition: hal.h:414
tool_change_ptr change
Optional handler for executing a tool change (M6).
Definition: hal.h:416
tool_select_ptr select
Optional handler for selecting a tool.
Definition: hal.h:415
Definition: crossbar.h:677
Definition: nuts_bolts.h:125
Definition: system.h:162
Definition: coolant_control.h:27
Definition: hal.h:48
uint32_t odometers
Definition: hal.h:69
uint32_t limits_pull_up
Pullup resistors for limit inputs are are supported.
Definition: hal.h:53
uint32_t laser_ppi_mode
Laser PPI (Pulses Per Inch) mode is supported.
Definition: hal.h:66
uint32_t unassigned
Definition: hal.h:75
uint32_t probe_latch
Definition: hal.h:71
uint32_t atc
Automatic tool changer (ATC) is supported.
Definition: hal.h:67
uint32_t bluetooth
Definition: hal.h:61
uint32_t pwm_spindle
Definition: hal.h:70
uint32_t spindle_encoder
Spindle encoder is supported.
Definition: hal.h:57
uint32_t ethernet
Definition: hal.h:62
uint32_t spindle_sync
Spindle synced motion is supported.
Definition: hal.h:58
uint32_t mpg_mode
Definition: hal.h:65
uint32_t software_debounce
Software debounce of input switches signals is supported.
Definition: hal.h:51
uint32_t sd_card
Definition: hal.h:59
uint32_t step_pulse_delay
Stepper step pulse delay is supported.
Definition: hal.h:52
uint32_t wifi
Definition: hal.h:63
uint32_t rtc_set
Definition: hal.h:74
uint32_t amass_level
Definition: hal.h:56
uint32_t no_gcode_message_handling
Definition: hal.h:68
uint32_t spindle_pid
Definition: hal.h:64
uint32_t control_pull_up
Pullup resistors for control inputs are supported.
Definition: hal.h:54
uint32_t rtc
Definition: hal.h:73
uint32_t value
All bitmap flags.
Definition: hal.h:49
uint32_t littlefs
Definition: hal.h:60
uint32_t probe_pull_up
Pullup resistors for probe inputs are supported.
Definition: hal.h:55
uint32_t toolsetter
Toolsetter (2nd probe) input is supported.
Definition: hal.h:72
Limit switches struct, consists of four packed axes_signals_t structs in 32 bits.
Definition: nuts_bolts.h:152
Motor vs. axis mapping NOTE: id and axis values are equal for primary motors, unequal for secondary (...
Definition: hal.h:214
uint32_t axis
Definition: hal.h:218
uint32_t id
Definition: hal.h:217
uint32_t value
Definition: hal.h:215
Definition: probe.h:32
Definition: hal.h:465
uint8_t comp1
Timer supports compare interrupt 0.
Definition: hal.h:470
uint8_t value
All bitmap flags.
Definition: hal.h:466
uint8_t up
Timer supports upcounting.
Definition: hal.h:469
uint8_t periodic
Definition: hal.h:468
uint8_t comp2
Timer supports compare interrupt 1.
Definition: hal.h:471