26 #if PROBE_ENABLE && !defined(PROBE_PIN)
27 #error "Probe input is not supported in this configuration!"
30 #if SAFETY_DOOR_ENABLE && !defined(SAFETY_DOOR_PIN)
31 #error "Safety door input is not supported in this configuration!"
34 #if MOTOR_FAULT_ENABLE && !defined(MOTOR_FAULT_PIN)
35 #error "Motor fault input is not supported in this configuration!"
38 #if MOTOR_WARNING_ENABLE && !defined(MOTOR_WARNING_PIN)
39 #error "Motor warning input is not supported in this configuration!"
42 #if I2C_STROBE_ENABLE && !defined(I2C_STROBE_PIN)
43 #error "I2C keypad/strobe is not supported in this configuration!"
46 #if MPG_ENABLE == 1 && !defined(MPG_MODE_PIN)
47 #error "MPG mode input is not supported in this configuration!"
50 #if QEI_SELECT_ENABLE && !defined(QEI_SELECT_PIN)
51 #error "Encoder select input is not supported in this configuration!"
60 #define RESET_PORT CONTROL_PORT
62 #ifndef FEED_HOLD_PORT
63 #define FEED_HOLD_PORT CONTROL_PORT
65 #ifndef CYCLE_START_PORT
66 #define CYCLE_START_PORT CONTROL_PORT
69 #define ESTOP_PORT CONTROL_PORT
71 #ifndef PROBE_DISCONNECT_PORT
72 #define PROBE_DISCONNECT_PORT CONTROL_PORT
74 #ifndef STOP_DISABLE_PORT
75 #define STOP_DISABLE_PORT CONTROL_PORT
77 #ifndef BLOCK_DELETE_PORT
78 #define BLOCK_DELETE_PORT CONTROL_PORT
80 #ifndef SINGLE_BLOCK_PORT
81 #define SINGLE_BLOCK_PORT CONTROL_PORT
83 #ifndef MOTOR_FAULT_PORT
84 #define MOTOR_FAULT_PORT CONTROL_PORT
86 #ifndef MOTOR_WARNING_PORT
87 #define MOTOR_WARNING_PORT CONTROL_PORT
89 #ifndef LIMITS_OVERRIDE_PORT
90 #define LIMITS_OVERRIDE_PORT CONTROL_PORT
92 #if SAFETY_DOOR_ENABLE && !defined(SAFETY_DOOR_PORT)
93 #define SAFETY_DOOR_PORT CONTROL_PORT
100 #define RESET_BIT (1<<RESET_PIN)
106 #ifndef FEED_HOLD_BIT
108 #define FEED_HOLD_BIT (1<<FEED_HOLD_PIN)
110 #define FEED_HOLD_BIT 0
114 #ifndef CYCLE_START_BIT
115 #ifdef CYCLE_START_PIN
116 #define CYCLE_START_BIT (1<<CYCLE_START_PIN)
118 #define CYCLE_START_BIT 0
124 #define ESTOP_BIT (1<<ESTOP_PIN)
130 #ifndef SD_DETECT_BIT
132 #define SD_DETECT_BIT (1<<SD_DETECT_PIN)
134 #define SD_DETECT_BIT 0
140 #ifndef SAFETY_DOOR_BIT
141 #if defined(SAFETY_DOOR_PIN) && !defined(AUX_DEVICES)
142 #define SAFETY_DOOR_BIT (1<<SAFETY_DOOR_PIN)
144 #define SAFETY_DOOR_BIT 0
150 #ifndef MOTOR_FAULT_BIT
151 #if defined(MOTOR_FAULT_PIN) && !MOTOR_FAULT_ENABLE
152 #define MOTOR_FAULT_BIT (1<<MOTOR_FAULT_PIN)
154 #define MOTOR_FAULT_BIT 0
158 #ifndef MOTOR_WARNING_BIT
159 #if defined(MOTOR_WARNING_PIN) && !MOTOR_WARNING_ENABLE
160 #define MOTOR_WARNING_BIT (1<<MOTOR_WARNING_PIN)
162 #define MOTOR_WARNING_BIT 0
166 #ifndef PROBE_DISCONNECT_BIT
167 #if defined(PROBE_DISCONNECT_PIN) && !PROBE_DISCONNECT_ENABLE
168 #define PROBE_DISCONNECT_BIT (1<<PROBE_DISCONNECT_PIN)
170 #define PROBE_DISCONNECT_BIT 0
174 #ifndef STOP_DISABLE_BIT
175 #if defined(STOP_DISABLE_PIN) && !STOP_DISABLE_ENABLE
176 #define STOP_DISABLE_BIT (1<<STOP_DISABLE_PIN)
178 #define STOP_DISABLE_BIT 0
182 #ifndef BLOCK_DELETE_BIT
183 #if defined(BLOCK_DELETE_PIN) && !BLOCK_DELETE_ENABLE
184 #define BLOCK_DELETE_BIT (1<<BLOCK_DELETE_PIN)
186 #define BLOCK_DELETE_BIT 0
190 #ifndef SINGLE_BLOCK_BIT
191 #if defined(SINGLE_BLOCK_PIN) && !SINGLE_BLOCK_ENABLE
192 #define SINGLE_BLOCK_BIT (1<<SINGLE_BLOCK_PIN)
194 #define SINGLE_BLOCK_BIT 0
198 #ifndef LIMITS_OVERRIDE_BIT
199 #if defined(LIMITS_OVERRIDE_PIN) && !LIMITS_OVERRIDE_ENABLE
200 #define LIMITS_OVERRIDE_BIT (1<<LIMITS_OVERRIDE_PIN)
202 #define LIMITS_OVERRIDE_BIT 0
206 #if SAFETY_DOOR_ENABLE || MOTOR_FAULT_ENABLE || MOTOR_WARNING_ENABLE || PROBE_DISCONNECT_ENABLE || \
207 STOP_DISABLE_ENABLE || BLOCK_DELETE_ENABLE || SINGLE_BLOCK_ENABLE || LIMITS_OVERRIDE_ENABLE || \
208 (defined(AUX_DEVICES) && (PROBE_ENABLE || I2C_STROBE_ENABLE || MPG_ENABLE == 1 || QEI_SELECT_ENABLE)) || defined __DOXYGEN__
210 #define AUX_CONTROLS_ENABLED 1
212 #if PROBE_DISCONNECT_ENABLE || STOP_DISABLE_ENABLE || BLOCK_DELETE_ENABLE || SINGLE_BLOCK_ENABLE || LIMITS_OVERRIDE_ENABLE
213 #define AUX_CONTROLS_SCAN 1
215 #define AUX_CONTROLS_SCAN 0
220 #if PROBE_ENABLE && defined(PROBE_PIN) && defined(AUX_DEVICES)
227 #if SAFETY_DOOR_ENABLE && defined(SAFETY_DOOR_PIN)
228 #ifdef SAFETY_DOOR_PORT
234 #if MOTOR_FAULT_ENABLE && defined(MOTOR_FAULT_PIN)
235 #ifdef MOTOR_FAULT_PORT
240 #if MOTOR_WARNING_ENABLE && defined(MOTOR_WARNING_PIN)
241 #ifdef MOTOR_WARNING_PORT
248 #if I2C_STROBE_ENABLE && defined(I2C_STROBE_PIN) && defined(AUX_DEVICES)
249 #ifdef I2C_STROBE_PORT
255 #if MPG_ENABLE == 1 && defined(MPG_MODE_PIN) && defined(AUX_DEVICES)
262 #if QEI_SELECT_ENABLE && defined(QEI_SELECT_PIN) && defined(AUX_DEVICES)
263 #ifdef QEI_SELECT_PORT
270 #if LIMITS_OVERRIDE_ENABLE
273 #if STOP_DISABLE_ENABLE
276 #if BLOCK_DELETE_ENABLE
279 #if SINGLE_BLOCK_ENABLE
282 #if PROBE_DISCONNECT_ENABLE
287 static inline aux_ctrl_t *aux_ctrl_remap_explicit (
void *port, uint8_t pin, uint8_t aux_port,
void *input)
291 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
295 if(aux_ctrl[idx].port == port && aux_ctrl[idx].pin == pin) {
296 ctrl_pin = &aux_ctrl[idx];
298 ctrl_pin->
input = input;
300 }
while(idx && ctrl_pin == NULL);
305 static inline aux_ctrl_t *aux_ctrl_get_pin (uint8_t aux_port)
309 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
312 if(aux_ctrl[--idx].aux_port == aux_port)
313 ctrl_pin = &aux_ctrl[idx];
314 }
while(idx && ctrl_pin == NULL);
321 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
324 if(aux_ctrl[--idx].aux_port != 0xFF) {
325 #if PROBE_ENABLE && defined(PROBE_PIN) && defined(AUX_DEVICES)
348 static bool aux_ctrl_claim_port (
xbar_t *properties, uint8_t port,
void *data)
353 return ((
aux_ctrl_t *)data)->aux_port != 0xFF;
360 if(aux_claim == NULL)
361 aux_claim = aux_ctrl_claim_port;
363 for(idx = 0; idx <
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t); idx++) {
364 if(aux_ctrl[idx].pin == 0xFF) {
367 }
else if(aux_ctrl[idx].aux_port != 0xFF)
368 aux_claim_explicit(&aux_ctrl[idx]);
372 #if AUX_CONTROLS_SCAN
376 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
379 if(aux_ctrl[--idx].pin != 0xFF)
381 if(aux_ctrl[idx].aux_port != 0xFF) {
385 signals.
mask |= aux_ctrl[idx].cap.mask;
388 signals.
mask |= aux_ctrl[idx].cap.mask;
399 #define AUX_CONTROLS_ENABLED 0
400 #define AUX_CONTROLS_SCAN 0
403 #if defined(AUX_CONTROLS_OUT) && !defined(AUX_CONTROLS)
404 #define AUX_CONTROLS AUX_CONTROL_SPINDLE
405 #elif !defined(AUX_CONTROLS)
406 #define AUX_CONTROLS 0
413 #if AUX_CONTROLS & AUX_CONTROL_SPINDLE
414 #ifdef SPINDLE_ENABLE_PIN
415 #ifndef SPINDLE_ENABLE_PORT
416 #define SPINDLE_ENABLE_PORT NULL
420 #ifdef SPINDLE_PWM_PIN
421 #ifndef SPINDLE_PWM_PORT
422 #define SPINDLE_PWM_PORT NULL
424 { .function =
Output_SpindlePWM, .aux_port = 0xFF, .pin = SPINDLE_PWM_PIN, .port = SPINDLE_PWM_PORT },
426 #ifdef SPINDLE_DIRECTION_PIN
427 #ifndef SPINDLE_DIRECTION_PORT
428 #define SPINDLE_DIRECTION_PORT NULL
430 { .function =
Output_SpindleDir, .aux_port = 0xFF, .pin = SPINDLE_DIRECTION_PIN, .port = SPINDLE_DIRECTION_PORT },
433 #ifdef SPINDLE1_ENABLE_PIN
434 #ifndef SPINDLE1_ENABLE_PORT
435 #define SPINDLE1_ENABLE_PORT NULL
437 { .function =
Output_Spindle1On, .aux_port = 0xFF, .pin = SPINDLE1_ENABLE_PIN, .port = SPINDLE1_ENABLE_PORT },
439 #ifdef SPINDLE1_PWM_PIN
440 #ifndef SPINDLE1_PWM_PORT
441 #define SPINDLE1_PWM_PORT NULL
443 { .function =
Output_Spindle1PWM, .aux_port = 0xFF, .pin = SPINDLE1_PWM_PIN, .port = SPINDLE1_PWM_PORT },
445 #ifdef SPINDLE1_DIRECTION_PIN
446 #ifndef SPINDLE1_DIRECTION_PORT
447 #define SPINDLE1_DIRECTION_PORT NULL
449 { .function =
Output_Spindle1Dir, .aux_port = 0xFF, .pin = SPINDLE1_DIRECTION_PIN, .port = SPINDLE1_DIRECTION_PORT },
453 #if AUX_CONTROLS & AUX_CONTROL_COOLANT
454 #ifdef COOLANT_FLOOD_PIN
455 #ifndef COOLANT_FLOOD_PORT
456 #define COOLANT_FLOOD_PORT NULL
458 { .function =
Output_CoolantFlood, .aux_port = 0xFF, .pin = COOLANT_FLOOD_PIN, .port = COOLANT_FLOOD_PORT },
460 #ifdef COOLANT_MIST_PIN
461 #ifndef COOLANT_MIST_PORT
462 #define COOLANT_MIST_PORT NULL
464 { .function =
Output_CoolantMist, .aux_port = 0xFF, .pin = COOLANT_MIST_PIN, .port = COOLANT_MIST_PORT },
468 #ifdef COPROC_RESET_PIN
469 #ifndef COPROC_RESET_PORT
470 #define COPROC_RESET_PORT NULL
472 { .function =
Output_CoProc_Reset, .aux_port = 0xFF, .pin = COPROC_RESET_PIN, .port = COPROC_RESET_PORT },
474 #ifdef COPROC_BOOT0_PIN
475 #ifndef COPROC_BOOT0_PORT
476 #define COPROC_BOOT0_PORT NULL
478 { .function =
Output_CoProc_Boot0, .aux_port = 0xFF, .pin = COPROC_BOOT0_PIN, .port = COPROC_BOOT0_PORT },
482 static inline aux_ctrl_out_t *aux_out_remap_explicit (
void *port, uint8_t pin, uint8_t aux_port,
void *output)
490 if(aux_ctrl_out[idx].port == port && aux_ctrl_out[idx].pin == pin) {
491 ctrl_pin = &aux_ctrl_out[idx];
493 ctrl_pin->
output = output;
495 }
while(idx && ctrl_pin == NULL);
500 typedef bool (*aux_claim_explicit_out_ptr)(
aux_ctrl_out_t *aux_ctrl);
502 static bool aux_ctrl_claim_out_port (
xbar_t *properties, uint8_t port,
void *data)
507 return ((
aux_ctrl_t *)data)->aux_port != 0xFF;
514 if(aux_claim == NULL)
515 aux_claim = aux_ctrl_claim_out_port;
517 for(idx = 0; idx <
sizeof(aux_ctrl_out) /
sizeof(
aux_ctrl_out_t); idx++) {
518 if(aux_ctrl_out[idx].pin == 0xFF)
520 else if(aux_ctrl_out[idx].aux_port != 0xFF)
521 aux_claim_explicit(&aux_ctrl_out[idx]);
530 #if SAFETY_DOOR_ENABLE
531 #define CONTROL_MASK (RESET_BIT|FEED_HOLD_BIT|CYCLE_START_BIT|ESTOP_BIT|PROBE_DISCONNECT_BIT|STOP_DISABLE_BIT|BLOCK_DELETE_BIT|SINGLE_BLOCK_BIT|MOTOR_FAULT_BIT|MOTOR_WARNING_BIT|LIMITS_OVERRIDE_BIT|SAFETY_DOOR_BIT)
532 #define CONTROL_MASK_SUM (RESET_BIT+FEED_HOLD_BIT+CYCLE_START_BIT+ESTOP_BIT+PROBE_DISCONNECT_BIT+STOP_DISABLE_BIT+BLOCK_DELETE_BIT+SINGLE_BLOCK_BIT+MOTOR_FAULT_BIT+MOTOR_WARNING_BIT+LIMITS_OVERRIDE_BIT+SAFETY_DOOR_BIT)
534 #define CONTROL_MASK (RESET_BIT|FEED_HOLD_BIT|CYCLE_START_BIT|ESTOP_BIT|PROBE_DISCONNECT_BIT|STOP_DISABLE_BIT|BLOCK_DELETE_BIT|SINGLE_BLOCK_BIT|MOTOR_FAULT_BIT|MOTOR_WARNING_BIT|LIMITS_OVERRIDE_BIT)
535 #define CONTROL_MASK_SUM (RESET_BIT+FEED_HOLD_BIT+CYCLE_START_BIT+ESTOP_BIT+PROBE_DISCONNECT_BIT+STOP_DISABLE_BIT+BLOCK_DELETE_BIT+SINGLE_BLOCK_BIT+MOTOR_FAULT_BIT+MOTOR_WARNING_BIT+LIMITS_OVERRIDE_BIT)
541 #if defined(SPINDLE_ENABLE_PIN) && !defined(SPINDLE_ENABLE_BIT)
542 #define SPINDLE_ENABLE_BIT (1<<SPINDLE_ENABLE_PIN)
544 #if defined(SPINDLE_DIRECTION_PIN) && !defined(SPINDLE_DIRECTION_BIT)
545 #define SPINDLE_DIRECTION_BIT (1<<SPINDLE_DIRECTION_PIN)
548 #if defined(SPINDLE1_ENABLE_PIN) && !defined(SPINDLE1_ENABLE_BIT)
549 #define SPINDLE1_ENABLE_BIT (1<<SPINDLE1_ENABLE_PIN)
551 #if defined(SPINDLE1_DIRECTION_PIN) && !defined(SPINDLE1_DIRECTION_BIT)
552 #define SPINDLE1_DIRECTION_BIT (1<<SPINDLE1_DIRECTION_PIN)
555 #if defined(COOLANT_FLOOD_PIN) && !defined(COOLANT_FLOOD_BIT)
556 #define COOLANT_FLOOD_BIT (1<<COOLANT_FLOOD_PIN)
558 #if defined(COOLANT_MIST_PIN) && !defined(COOLANT_MIST_BIT)
559 #define COOLANT_MIST_BIT (1<<COOLANT_MIST_PIN)
562 #if defined(RTS_PIN) && !defined(RTS_BIT)
563 #define RTS_BIT (1<<RTS_PIN)
571 #if defined(PROBE_PIN) && !defined(PROBE_BIT)
572 #define PROBE_BIT (1<<PROBE_PIN)
575 #if defined(MPG_MODE_PIN) && !defined(MPG_MODE_BIT)
576 #define MPG_MODE_BIT (1<<MPG_MODE_PIN)
579 #if defined(I2C_STROBE_PIN) && !defined(I2C_STROBE_BIT)
580 #define I2C_STROBE_BIT (1<<I2C_STROBE_PIN)
583 #if defined(QEI_SELECT_PIN) && !defined(QEI_SELECT_BIT)
584 #define QEI_SELECT_BIT (1<<QEI_SELECT_PIN)
591 #define QEI_A_BIT (1<<QEI_A_PIN)
594 #define QEI_B_BIT (1<<QEI_B_PIN)
601 #ifndef QEI_SELECT_BIT
602 #define QEI_SELECT_BIT 0
605 #define MPG_MODE_BIT 0
607 #ifndef I2C_STROBE_BIT
608 #define I2C_STROBE_BIT 0
613 #if SPINDLE_ENCODER_ENABLE
614 #ifndef SPINDLE_PULSE_PIN
615 #error "Spindle encoder requires at least SPINDLE_PULSE_PIN defined in the board map!"
617 #if !defined(SPINDLE_PULSE_BIT) && defined(SPINDLE_PULSE_PIN)
618 #define SPINDLE_PULSE_BIT (1<<SPINDLE_PULSE_PIN)
620 #if !defined(SPINDLE_INDEX_BIT) && defined(SPINDLE_INDEX_PIN)
621 #define SPINDLE_INDEX_BIT (1<<SPINDLE_INDEX_PIN)
625 #ifndef SPINDLE_INDEX_BIT
626 #define SPINDLE_INDEX_BIT 0
628 #ifndef SPINDLE_PULSE_BIT
629 #define SPINDLE_PULSE_BIT 0
632 #if SPINDLE_SYNC_ENABLE && (SPINDLE_INDEX_BIT + SPINDLE_PULSE_BIT) == 0
633 #error "Spindle sync requires SPINDLE_PULSE_PIN and SPINDLE_INDEX_PIN defined in the board map!"
637 #define SPI_IRQ_BIT 0
638 #elif !defined(SPI_IRQ_BIT)
639 #define SPI_IRQ_BIT (1<<SPI_IRQ_PIN)
642 #ifndef DEVICES_IRQ_MASK
644 #define DEVICES_IRQ_MASK (SPI_IRQ_BIT|SPINDLE_INDEX_BIT|QEI_A_BIT|QEI_B_BIT|SD_DETECT_BIT)
645 #define DEVICES_IRQ_MASK_SUM (SPI_IRQ_BIT+SPINDLE_INDEX_BIT+QEI_A_BIT+QEI_B_BIT+SD_DETECT_BIT)
647 #define DEVICES_IRQ_MASK (MPG_MODE_BIT|I2C_STROBE_BIT|QEI_SELECT_BIT|SPI_IRQ_BIT|SPINDLE_INDEX_BIT|QEI_A_BIT|QEI_B_BIT|SD_DETECT_BIT)
648 #define DEVICES_IRQ_MASK_SUM (MPG_MODE_BIT+I2C_STROBE_BIT+QEI_SELECT_BIT+SPI_IRQ_BIT+SPINDLE_INDEX_BIT+QEI_A_BIT+QEI_B_BIT+SD_DETECT_BIT)
655 #define AUXINPUT0_BIT (1<<AUXINPUT0_PIN)
657 #define AUXINPUT0_BIT 0
660 #define AUXINPUT1_BIT (1<<AUXINPUT1_PIN)
662 #define AUXINPUT1_BIT 0
665 #define AUXINPUT2_BIT (1<<AUXINPUT2_PIN)
667 #define AUXINPUT2_BIT 0
670 #define AUXINPUT3_BIT (1<<AUXINPUT3_PIN)
672 #define AUXINPUT3_BIT 0
675 #define AUXINPUT4_BIT (1<<AUXINPUT4_PIN)
677 #define AUXINPUT4_BIT 0
680 #define AUXINPUT5_BIT (1<<AUXINPUT5_PIN)
682 #define AUXINPUT5_BIT 0
685 #define AUXINPUT6_BIT (1<<AUXINPUT6_PIN)
687 #define AUXINPUT6_BIT 0
690 #define AUXINPUT7_BIT (1<<AUXINPUT7_PIN)
692 #define AUXINPUT7_BIT 0
695 #define AUXINPUT8_BIT (1<<AUXINPUT8_PIN)
697 #define AUXINPUT8_BIT 0
700 #define AUXINPUT9_BIT (1<<AUXINPUT9_PIN)
702 #define AUXINPUT9_BIT 0
704 #ifdef AUXINPUT10_PIN
705 #define AUXINPUT10_BIT (1<<AUXINPUT10_PIN)
707 #define AUXINPUT10_BIT 0
709 #ifdef AUXINPUT11_PIN
710 #define AUXINPUT11_BIT (1<<AUXINPUT11_PIN)
712 #define AUXINPUT11_BIT 0
714 #ifdef AUXINPUT12_PIN
715 #define AUXINPUT12_BIT (1<<AUXINPUT12_PIN)
717 #define AUXINPUT12_BIT 0
719 #ifdef AUXINPUT13_PIN
720 #define AUXINPUT13_BIT (1<<AUXINPUT13_PIN)
722 #define AUXINPUT13_BIT 0
724 #ifdef AUXINPUT14_PIN
725 #define AUXINPUT14_BIT (1<<AUXINPUT14_PIN)
727 #define AUXINPUT14_BIT 0
729 #ifdef AUXINPUT15_PIN
730 #define AUXINPUT15_BIT (1<<AUXINPUT15_PIN)
732 #define AUXINPUT15_BIT 0
735 #ifndef AUXINPUT_MASK
736 #define AUXINPUT_MASK (AUXINPUT0_BIT|AUXINPUT1_BIT|AUXINPUT2_BIT|AUXINPUT3_BIT|AUXINPUT4_BIT|AUXINPUT5_BIT|AUXINPUT6_BIT|AUXINPUT7_BIT|\
737 AUXINPUT8_BIT|AUXINPUT9_BIT|AUXINPUT10_BIT|AUXINPUT11_BIT|AUXINPUT12_BIT|AUXINPUT13_BIT|AUXINPUT4_BIT|AUXINPUT15_BIT)
738 #define AUXINPUT_MASK_SUM (AUXINPUT0_BIT+AUXINPUT1_BIT+AUXINPUT2_BIT+AUXINPUT3_BIT+AUXINPUT4_BIT+AUXINPUT5_BIT+AUXINPUT6_BIT+AUXINPUT7_BIT+\
739 AUXINPUT8_BIT+AUXINPUT9_BIT+AUXINPUT10_BIT+AUXINPUT11_BIT+AUXINPUT12_BIT+AUXINPUT13_BIT+AUXINPUT4_BIT+AUXINPUT15_BIT)
const char * xbar_fn_to_pinname(pin_function_t fn)
Definition: crossbar.c:131
@ PullMode_None
0b00 (0x00)
Definition: crossbar.h:505
@ PullMode_Up
0b01 (0x01)
Definition: crossbar.h:506
@ Output_CoProc_Boot0
Definition: crossbar.h:191
@ Input_Probe
Definition: crossbar.h:43
@ Input_MotorFault
Definition: crossbar.h:37
@ Input_MotorWarning
Definition: crossbar.h:38
@ Input_ProbeDisconnect
Definition: crossbar.h:36
@ Input_StopDisable
Definition: crossbar.h:34
@ Input_LimitsOverride
Definition: crossbar.h:39
@ Output_CoProc_Reset
Definition: crossbar.h:190
@ Input_QEI_Select
Definition: crossbar.h:214
@ Input_BlockDelete
Definition: crossbar.h:33
@ Output_SpindleDir
Definition: crossbar.h:149
@ Input_SingleBlock
Definition: crossbar.h:40
@ Output_SpindleOn
Definition: crossbar.h:148
@ Input_I2CStrobe
Definition: crossbar.h:208
@ Output_Spindle1Dir
Definition: crossbar.h:152
@ Output_SpindlePWM
Definition: crossbar.h:150
@ Output_CoolantMist
Definition: crossbar.h:154
@ Input_MPGSelect
Definition: crossbar.h:47
@ Output_Spindle1On
Definition: crossbar.h:151
@ Input_SafetyDoor
Definition: crossbar.h:32
@ Output_CoolantFlood
Definition: crossbar.h:155
@ Output_Spindle1PWM
Definition: crossbar.h:153
pin_irq_mode_t
Pin interrupt modes, may be or'ed when reporting pin capability.
Definition: crossbar.h:478
@ IRQ_Mode_Rising
0b00001 (0x01)
Definition: crossbar.h:480
@ IRQ_Mode_None
0b00000 (0x00)
Definition: crossbar.h:479
@ IRQ_Mode_Change
0b00100 (0x04)
Definition: crossbar.h:483
@ IRQ_Mode_Falling
0b00010 (0x02)
Definition: crossbar.h:481
@ WaitMode_Immediate
0 - This is the only mode allowed for analog inputs
Definition: gcode.h:285
grbl_hal_t hal
Global HAL struct.
Definition: grbllib.c:91
bool ioport_claim(io_port_type_t type, io_port_direction_t dir, uint8_t *port, const char *description)
Claim a digital or analog port for exclusive use.
Definition: ioports.c:141
bool ioports_enumerate(io_port_type_t type, io_port_direction_t dir, pin_cap_t filter, ioports_enumerate_callback_ptr callback, void *data)
Definition: ioports.c:216
@ Port_Input
0
Definition: ioports.h:30
@ Port_Output
1
Definition: ioports.h:31
bool(* ioports_enumerate_callback_ptr)(xbar_t *properties, uint8_t port, void *data)
Definition: ioports.h:108
@ Port_Digital
1
Definition: ioports.h:26
void(* ioport_interrupt_callback_ptr)(uint8_t port, bool state)
Pointer to callback function for input port interrupt events.
Definition: ioports.h:98
#define On
Definition: nuts_bolts.h:36
bool(* aux_claim_explicit_ptr)(aux_ctrl_t *aux_ctrl)
Definition: pin_bits_masks.h:346
settings_t settings
Definition: settings.c:43
Definition: crossbar.h:636
uint8_t aux_port
Definition: crossbar.h:638
void * output
Definition: crossbar.h:641
pin_function_t function
Definition: crossbar.h:637
Definition: crossbar.h:626
uint8_t aux_port
Definition: crossbar.h:628
control_signals_t cap
Definition: crossbar.h:630
pin_irq_mode_t irq_mode
Definition: crossbar.h:629
void * input
Definition: crossbar.h:633
pin_function_t function
Definition: crossbar.h:627
/a cfg_data argument to /a xbar_config_ptr for gpio input pins
Definition: crossbar.h:587
bool debounce
Definition: crossbar.h:589
bool inverted
Definition: crossbar.h:588
pull_mode_t pull_mode
Definition: crossbar.h:590
io_port_t port
Optional handlers for axuillary I/O (adds support for M62-M66).
Definition: hal.h:625
control_signals_t signals_cap
Control input signals supported by the driver.
Definition: hal.h:660
wait_on_input_ptr wait_on_input
Optional handler for reading a digital or analog input.
Definition: ioports.h:118
ioport_register_interrupt_handler_ptr register_interrupt_handler
Definition: ioports.h:123
get_pin_info_ptr get_pin_info
Optional handler for getting information about an auxiliary pin.
Definition: ioports.h:120
Definition: settings.h:821
control_signals_t control_invert
Definition: settings.h:833
probeflags_t probe
Definition: settings.h:844
Definition: crossbar.h:644
pin_mode_t mode
Current pin configuration.
Definition: crossbar.h:652
xbar_config_ptr config
Optional pointer to function for configuring the port.
Definition: crossbar.h:653
uint16_t mask
Definition: system.h:139
Definition: crossbar.h:522
uint16_t debounce
Definition: crossbar.h:552
uint16_t invert_probe_pin
Definition: settings.h:589
uint16_t disable_probe_pullup
Definition: settings.h:590