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!"
54 #define EXPANDER_PORT 1
62 #define RESET_PORT CONTROL_PORT
64 #ifndef FEED_HOLD_PORT
65 #define FEED_HOLD_PORT CONTROL_PORT
67 #ifndef CYCLE_START_PORT
68 #define CYCLE_START_PORT CONTROL_PORT
71 #define ESTOP_PORT CONTROL_PORT
73 #ifndef PROBE_DISCONNECT_PORT
74 #define PROBE_DISCONNECT_PORT CONTROL_PORT
76 #ifndef STOP_DISABLE_PORT
77 #define STOP_DISABLE_PORT CONTROL_PORT
79 #ifndef BLOCK_DELETE_PORT
80 #define BLOCK_DELETE_PORT CONTROL_PORT
82 #ifndef SINGLE_BLOCK_PORT
83 #define SINGLE_BLOCK_PORT CONTROL_PORT
85 #ifndef MOTOR_FAULT_PORT
86 #define MOTOR_FAULT_PORT CONTROL_PORT
88 #ifndef MOTOR_WARNING_PORT
89 #define MOTOR_WARNING_PORT CONTROL_PORT
91 #ifndef LIMITS_OVERRIDE_PORT
92 #define LIMITS_OVERRIDE_PORT CONTROL_PORT
94 #if SAFETY_DOOR_ENABLE && !defined(SAFETY_DOOR_PORT)
95 #define SAFETY_DOOR_PORT CONTROL_PORT
102 #define RESET_BIT (1<<RESET_PIN)
108 #ifndef FEED_HOLD_BIT
110 #define FEED_HOLD_BIT (1<<FEED_HOLD_PIN)
112 #define FEED_HOLD_BIT 0
116 #ifndef CYCLE_START_BIT
117 #ifdef CYCLE_START_PIN
118 #define CYCLE_START_BIT (1<<CYCLE_START_PIN)
120 #define CYCLE_START_BIT 0
126 #define ESTOP_BIT (1<<ESTOP_PIN)
132 #ifndef SD_DETECT_BIT
134 #define SD_DETECT_BIT (1<<SD_DETECT_PIN)
136 #define SD_DETECT_BIT 0
142 #ifndef SAFETY_DOOR_BIT
143 #if defined(SAFETY_DOOR_PIN) && !defined(AUX_DEVICES)
144 #define SAFETY_DOOR_BIT (1<<SAFETY_DOOR_PIN)
146 #define SAFETY_DOOR_BIT 0
152 #ifndef MOTOR_FAULT_BIT
153 #if defined(MOTOR_FAULT_PIN) && !MOTOR_FAULT_ENABLE
154 #define MOTOR_FAULT_BIT (1<<MOTOR_FAULT_PIN)
156 #define MOTOR_FAULT_BIT 0
160 #ifndef MOTOR_WARNING_BIT
161 #if defined(MOTOR_WARNING_PIN) && !MOTOR_WARNING_ENABLE
162 #define MOTOR_WARNING_BIT (1<<MOTOR_WARNING_PIN)
164 #define MOTOR_WARNING_BIT 0
168 #ifndef PROBE_DISCONNECT_BIT
169 #if defined(PROBE_DISCONNECT_PIN) && !PROBE_DISCONNECT_ENABLE
170 #define PROBE_DISCONNECT_BIT (1<<PROBE_DISCONNECT_PIN)
172 #define PROBE_DISCONNECT_BIT 0
176 #ifndef STOP_DISABLE_BIT
177 #if defined(STOP_DISABLE_PIN) && !STOP_DISABLE_ENABLE
178 #define STOP_DISABLE_BIT (1<<STOP_DISABLE_PIN)
180 #define STOP_DISABLE_BIT 0
184 #ifndef BLOCK_DELETE_BIT
185 #if defined(BLOCK_DELETE_PIN) && !BLOCK_DELETE_ENABLE
186 #define BLOCK_DELETE_BIT (1<<BLOCK_DELETE_PIN)
188 #define BLOCK_DELETE_BIT 0
192 #ifndef SINGLE_BLOCK_BIT
193 #if defined(SINGLE_BLOCK_PIN) && !SINGLE_BLOCK_ENABLE
194 #define SINGLE_BLOCK_BIT (1<<SINGLE_BLOCK_PIN)
196 #define SINGLE_BLOCK_BIT 0
200 #ifndef LIMITS_OVERRIDE_BIT
201 #if defined(LIMITS_OVERRIDE_PIN) && !LIMITS_OVERRIDE_ENABLE
202 #define LIMITS_OVERRIDE_BIT (1<<LIMITS_OVERRIDE_PIN)
204 #define LIMITS_OVERRIDE_BIT 0
208 #if SAFETY_DOOR_ENABLE || MOTOR_FAULT_ENABLE || MOTOR_WARNING_ENABLE || PROBE_DISCONNECT_ENABLE || \
209 STOP_DISABLE_ENABLE || BLOCK_DELETE_ENABLE || SINGLE_BLOCK_ENABLE || LIMITS_OVERRIDE_ENABLE || \
210 (defined(AUX_DEVICES) && (PROBE_ENABLE || I2C_STROBE_ENABLE || MPG_ENABLE == 1 || QEI_SELECT_ENABLE)) || defined __DOXYGEN__
212 #define AUX_CONTROLS_ENABLED 1
214 #if PROBE_DISCONNECT_ENABLE || STOP_DISABLE_ENABLE || BLOCK_DELETE_ENABLE || SINGLE_BLOCK_ENABLE || LIMITS_OVERRIDE_ENABLE
215 #define AUX_CONTROLS_SCAN 1
217 #define AUX_CONTROLS_SCAN 0
222 #if PROBE_ENABLE && defined(PROBE_PIN) && defined(AUX_DEVICES)
229 #if SAFETY_DOOR_ENABLE && defined(SAFETY_DOOR_PIN)
230 #ifdef SAFETY_DOOR_PORT
236 #if MOTOR_FAULT_ENABLE && defined(MOTOR_FAULT_PIN)
237 #ifdef MOTOR_FAULT_PORT
242 #if MOTOR_WARNING_ENABLE && defined(MOTOR_WARNING_PIN)
243 #ifdef MOTOR_WARNING_PORT
250 #if I2C_STROBE_ENABLE && defined(I2C_STROBE_PIN) && defined(AUX_DEVICES)
251 #ifdef I2C_STROBE_PORT
257 #if MPG_ENABLE == 1 && defined(MPG_MODE_PIN) && defined(AUX_DEVICES)
264 #if QEI_SELECT_ENABLE && defined(QEI_SELECT_PIN) && defined(AUX_DEVICES)
265 #ifdef QEI_SELECT_PORT
272 #if LIMITS_OVERRIDE_ENABLE
275 #if STOP_DISABLE_ENABLE
278 #if BLOCK_DELETE_ENABLE
281 #if SINGLE_BLOCK_ENABLE
284 #if PROBE_DISCONNECT_ENABLE
289 static inline aux_ctrl_t *aux_ctrl_remap_explicit (
void *port, uint8_t pin, uint8_t aux_port,
void *input)
293 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
297 if(aux_ctrl[idx].port == port && aux_ctrl[idx].pin == pin) {
298 ctrl_pin = &aux_ctrl[idx];
300 ctrl_pin->
input = input;
302 }
while(idx && ctrl_pin == NULL);
307 static inline aux_ctrl_t *aux_ctrl_get_pin (uint8_t aux_port)
311 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
314 if(aux_ctrl[--idx].aux_port == aux_port)
315 ctrl_pin = &aux_ctrl[idx];
316 }
while(idx && ctrl_pin == NULL);
323 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
326 if(aux_ctrl[--idx].aux_port != 0xFF) {
327 #if PROBE_ENABLE && defined(PROBE_PIN) && defined(AUX_DEVICES)
350 static bool aux_ctrl_claim_port (
xbar_t *properties, uint8_t port,
void *data)
355 return ((
aux_ctrl_t *)data)->aux_port != 0xFF;
362 if(aux_claim == NULL)
363 aux_claim = aux_ctrl_claim_port;
365 for(idx = 0; idx <
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t); idx++) {
366 if(aux_ctrl[idx].pin == 0xFF) {
369 }
else if(aux_ctrl[idx].aux_port != 0xFF)
370 aux_claim_explicit(&aux_ctrl[idx]);
374 #if AUX_CONTROLS_SCAN
378 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
381 if(aux_ctrl[--idx].pin != 0xFF)
383 if(aux_ctrl[idx].aux_port != 0xFF) {
387 signals.
mask |= aux_ctrl[idx].cap.mask;
390 signals.
mask |= aux_ctrl[idx].cap.mask;
401 #define AUX_CONTROLS_ENABLED 0
402 #define AUX_CONTROLS_SCAN 0
405 #if defined(AUX_CONTROLS_OUT) && !defined(AUX_CONTROLS)
406 #define AUX_CONTROLS AUX_CONTROL_SPINDLE
407 #elif !defined(AUX_CONTROLS)
408 #define AUX_CONTROLS 0
415 #if defined(ESP_PLATFORM) || defined(RP2040)
416 #if defined(STEPPERS_ENABLE_PIN) && STEPPERS_ENABLE_PORT == EXPANDER_PORT
419 #if defined(X_ENABLE_PIN) && X_ENABLE_PORT == EXPANDER_PORT
420 { .function =
Output_StepperEnableX, .aux_port = 0xFF, .pin = X_ENABLE_PIN, .port = (
void *)X_ENABLE_PORT },
422 #if defined(Y_ENABLE_PIN) && Y_ENABLE_PORT == EXPANDER_PORT
423 { .function =
Output_StepperEnableY, .aux_port = 0xFF, .pin = Y_ENABLE_PIN, .port = (
void *)Y_ENABLE_PORT },
425 #if defined(XY_ENABLE_PIN) && XY_ENABLE_PORT == EXPANDER_PORT
426 { .function =
Output_StepperEnableXY, .aux_port = 0xFF, .pin = XY_ENABLE_PIN, .port = (
void *)XY_ENABLE_PORT },
428 #if defined(Z_ENABLE_PIN) && Z_ENABLE_PORT == EXPANDER_PORT
429 { .function =
Output_StepperEnableZ, .aux_port = 0xFF, .pin = Z_ENABLE_PIN, .port = (
void *)Z_ENABLE_PORT },
432 #if AUX_CONTROLS & AUX_CONTROL_SPINDLE
433 #ifdef SPINDLE_ENABLE_PIN
434 #ifndef SPINDLE_ENABLE_PORT
435 #define SPINDLE_ENABLE_PORT 0
437 { .function =
Output_SpindleOn, .aux_port = 0xFF, .pin = SPINDLE_ENABLE_PIN, .port = (
void *)SPINDLE_ENABLE_PORT },
439 #ifdef SPINDLE_PWM_PIN
440 #ifndef SPINDLE_PWM_PORT
441 #define SPINDLE_PWM_PORT 0
443 { .function =
Output_SpindlePWM, .aux_port = 0xFF, .pin = SPINDLE_PWM_PIN, .port = (
void *)SPINDLE_PWM_PORT },
445 #ifdef SPINDLE_DIRECTION_PIN
446 #ifndef SPINDLE_DIRECTION_PORT
447 #define SPINDLE_DIRECTION_PORT 0
449 { .function =
Output_SpindleDir, .aux_port = 0xFF, .pin = SPINDLE_DIRECTION_PIN, .port = (
void *)SPINDLE_DIRECTION_PORT },
452 #ifdef SPINDLE1_ENABLE_PIN
453 #ifndef SPINDLE1_ENABLE_PORT
454 #define SPINDLE1_ENABLE_PORT 0
456 { .function =
Output_Spindle1On, .aux_port = 0xFF, .pin = SPINDLE1_ENABLE_PIN, .port = (
void *)SPINDLE1_ENABLE_PORT },
458 #ifdef SPINDLE1_PWM_PIN
459 #ifndef SPINDLE1_PWM_PORT
460 #define SPINDLE1_PWM_PORT 0
462 { .function =
Output_Spindle1PWM, .aux_port = 0xFF, .pin = SPINDLE1_PWM_PIN, .port = (
void *)SPINDLE1_PWM_PORT },
464 #ifdef SPINDLE1_DIRECTION_PIN
465 #ifndef SPINDLE1_DIRECTION_PORT
466 #define SPINDLE1_DIRECTION_PORT 0
468 { .function =
Output_Spindle1Dir, .aux_port = 0xFF, .pin = SPINDLE1_DIRECTION_PIN, .port = (
void *)SPINDLE1_DIRECTION_PORT },
472 #if AUX_CONTROLS & AUX_CONTROL_COOLANT
473 #ifdef COOLANT_FLOOD_PIN
474 #ifndef COOLANT_FLOOD_PORT
475 #define COOLANT_FLOOD_PORT 0
477 { .function =
Output_CoolantFlood, .aux_port = 0xFF, .pin = COOLANT_FLOOD_PIN, .port = (
void *)COOLANT_FLOOD_PORT },
479 #ifdef COOLANT_MIST_PIN
480 #ifndef COOLANT_MIST_PORT
481 #define COOLANT_MIST_PORT 0
483 { .function =
Output_CoolantMist, .aux_port = 0xFF, .pin = COOLANT_MIST_PIN, .port = (
void *)COOLANT_MIST_PORT },
487 #ifdef COPROC_RESET_PIN
488 #ifndef COPROC_RESET_PORT
489 #define COPROC_RESET_PORT 0
491 { .function =
Output_CoProc_Reset, .aux_port = 0xFF, .pin = COPROC_RESET_PIN, .port = (
void *)COPROC_RESET_PORT },
493 #ifdef COPROC_BOOT0_PIN
494 #ifndef COPROC_BOOT0_PORT
495 #define COPROC_BOOT0_PORT 0
497 { .function =
Output_CoProc_Boot0, .aux_port = 0xFF, .pin = COPROC_BOOT0_PIN, .port = (
void *)COPROC_BOOT0_PORT },
499 #if defined(SPI_RST_PIN) && SPI_RST_PORT == EXPANDER_PORT && defined(RP2040)
500 { .function =
Output_SPIRST, .aux_port = 0xFF, .pin = SPI_RST_PIN, .port = (
void *)SPI_RST_PORT },
504 static inline aux_ctrl_out_t *aux_out_remap_explicit (
void *port, uint8_t pin, uint8_t aux_port,
void *output)
512 if(aux_ctrl_out[idx].port == port && aux_ctrl_out[idx].pin == pin) {
513 ctrl_pin = &aux_ctrl_out[idx];
515 ctrl_pin->
output = output;
517 }
while(idx && ctrl_pin == NULL);
522 typedef bool (*aux_claim_explicit_out_ptr)(
aux_ctrl_out_t *aux_ctrl);
524 static bool aux_ctrl_claim_out_port (
xbar_t *properties, uint8_t port,
void *data)
539 if(aux_claim == NULL)
540 aux_claim = aux_ctrl_claim_out_port;
542 for(idx = 0; idx <
sizeof(aux_ctrl_out) /
sizeof(
aux_ctrl_out_t); idx++) {
548 aux_claim_explicit(&aux_ctrl_out[idx]);
551 }
else if(aux_ctrl_out[idx].pin == 0xFF) {
553 aux_claim_explicit(&aux_ctrl_out[idx]);
554 }
else if(aux_ctrl_out[idx].aux_port != 0xFF)
555 aux_claim_explicit(&aux_ctrl_out[idx]);
564 #if SAFETY_DOOR_ENABLE
565 #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)
566 #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)
568 #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)
569 #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)
575 #if defined(SPINDLE_ENABLE_PIN) && !defined(SPINDLE_ENABLE_BIT)
576 #define SPINDLE_ENABLE_BIT (1<<SPINDLE_ENABLE_PIN)
578 #if defined(SPINDLE_DIRECTION_PIN) && !defined(SPINDLE_DIRECTION_BIT)
579 #define SPINDLE_DIRECTION_BIT (1<<SPINDLE_DIRECTION_PIN)
582 #if defined(SPINDLE1_ENABLE_PIN) && !defined(SPINDLE1_ENABLE_BIT)
583 #define SPINDLE1_ENABLE_BIT (1<<SPINDLE1_ENABLE_PIN)
585 #if defined(SPINDLE1_DIRECTION_PIN) && !defined(SPINDLE1_DIRECTION_BIT)
586 #define SPINDLE1_DIRECTION_BIT (1<<SPINDLE1_DIRECTION_PIN)
589 #if defined(COOLANT_FLOOD_PIN) && !defined(COOLANT_FLOOD_BIT)
590 #define COOLANT_FLOOD_BIT (1<<COOLANT_FLOOD_PIN)
592 #if defined(COOLANT_MIST_PIN) && !defined(COOLANT_MIST_BIT)
593 #define COOLANT_MIST_BIT (1<<COOLANT_MIST_PIN)
596 #if defined(RTS_PIN) && !defined(RTS_BIT)
597 #define RTS_BIT (1<<RTS_PIN)
605 #if defined(PROBE_PIN) && !defined(PROBE_BIT)
606 #define PROBE_BIT (1<<PROBE_PIN)
609 #if defined(MPG_MODE_PIN) && !defined(MPG_MODE_BIT)
610 #define MPG_MODE_BIT (1<<MPG_MODE_PIN)
613 #if defined(I2C_STROBE_PIN) && !defined(I2C_STROBE_BIT)
614 #define I2C_STROBE_BIT (1<<I2C_STROBE_PIN)
617 #if defined(QEI_SELECT_PIN) && !defined(QEI_SELECT_BIT)
618 #define QEI_SELECT_BIT (1<<QEI_SELECT_PIN)
625 #define QEI_A_BIT (1<<QEI_A_PIN)
628 #define QEI_B_BIT (1<<QEI_B_PIN)
635 #ifndef QEI_SELECT_BIT
636 #define QEI_SELECT_BIT 0
639 #define MPG_MODE_BIT 0
641 #ifndef I2C_STROBE_BIT
642 #define I2C_STROBE_BIT 0
647 #if SPINDLE_ENCODER_ENABLE
648 #ifndef SPINDLE_PULSE_PIN
649 #error "Spindle encoder requires at least SPINDLE_PULSE_PIN defined in the board map!"
651 #if !defined(SPINDLE_PULSE_BIT) && defined(SPINDLE_PULSE_PIN)
652 #define SPINDLE_PULSE_BIT (1<<SPINDLE_PULSE_PIN)
654 #if !defined(SPINDLE_INDEX_BIT) && defined(SPINDLE_INDEX_PIN)
655 #define SPINDLE_INDEX_BIT (1<<SPINDLE_INDEX_PIN)
659 #ifndef SPINDLE_INDEX_BIT
660 #define SPINDLE_INDEX_BIT 0
662 #ifndef SPINDLE_PULSE_BIT
663 #define SPINDLE_PULSE_BIT 0
666 #if SPINDLE_SYNC_ENABLE && (SPINDLE_INDEX_BIT + SPINDLE_PULSE_BIT) == 0
667 #error "Spindle sync requires SPINDLE_PULSE_PIN and SPINDLE_INDEX_PIN defined in the board map!"
671 #define SPI_IRQ_BIT 0
672 #elif !defined(SPI_IRQ_BIT)
673 #define SPI_IRQ_BIT (1<<SPI_IRQ_PIN)
676 #ifndef DEVICES_IRQ_MASK
678 #define DEVICES_IRQ_MASK (SPI_IRQ_BIT|SPINDLE_INDEX_BIT|QEI_A_BIT|QEI_B_BIT|SD_DETECT_BIT)
679 #define DEVICES_IRQ_MASK_SUM (SPI_IRQ_BIT+SPINDLE_INDEX_BIT+QEI_A_BIT+QEI_B_BIT+SD_DETECT_BIT)
681 #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)
682 #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)
689 #define AUXINPUT0_BIT (1<<AUXINPUT0_PIN)
691 #define AUXINPUT0_BIT 0
694 #define AUXINPUT1_BIT (1<<AUXINPUT1_PIN)
696 #define AUXINPUT1_BIT 0
699 #define AUXINPUT2_BIT (1<<AUXINPUT2_PIN)
701 #define AUXINPUT2_BIT 0
704 #define AUXINPUT3_BIT (1<<AUXINPUT3_PIN)
706 #define AUXINPUT3_BIT 0
709 #define AUXINPUT4_BIT (1<<AUXINPUT4_PIN)
711 #define AUXINPUT4_BIT 0
714 #define AUXINPUT5_BIT (1<<AUXINPUT5_PIN)
716 #define AUXINPUT5_BIT 0
719 #define AUXINPUT6_BIT (1<<AUXINPUT6_PIN)
721 #define AUXINPUT6_BIT 0
724 #define AUXINPUT7_BIT (1<<AUXINPUT7_PIN)
726 #define AUXINPUT7_BIT 0
729 #define AUXINPUT8_BIT (1<<AUXINPUT8_PIN)
731 #define AUXINPUT8_BIT 0
734 #define AUXINPUT9_BIT (1<<AUXINPUT9_PIN)
736 #define AUXINPUT9_BIT 0
738 #ifdef AUXINPUT10_PIN
739 #define AUXINPUT10_BIT (1<<AUXINPUT10_PIN)
741 #define AUXINPUT10_BIT 0
743 #ifdef AUXINPUT11_PIN
744 #define AUXINPUT11_BIT (1<<AUXINPUT11_PIN)
746 #define AUXINPUT11_BIT 0
748 #ifdef AUXINPUT12_PIN
749 #define AUXINPUT12_BIT (1<<AUXINPUT12_PIN)
751 #define AUXINPUT12_BIT 0
753 #ifdef AUXINPUT13_PIN
754 #define AUXINPUT13_BIT (1<<AUXINPUT13_PIN)
756 #define AUXINPUT13_BIT 0
758 #ifdef AUXINPUT14_PIN
759 #define AUXINPUT14_BIT (1<<AUXINPUT14_PIN)
761 #define AUXINPUT14_BIT 0
763 #ifdef AUXINPUT15_PIN
764 #define AUXINPUT15_BIT (1<<AUXINPUT15_PIN)
766 #define AUXINPUT15_BIT 0
769 #ifndef AUXINPUT_MASK
770 #define AUXINPUT_MASK (AUXINPUT0_BIT|AUXINPUT1_BIT|AUXINPUT2_BIT|AUXINPUT3_BIT|AUXINPUT4_BIT|AUXINPUT5_BIT|AUXINPUT6_BIT|AUXINPUT7_BIT|\
771 AUXINPUT8_BIT|AUXINPUT9_BIT|AUXINPUT10_BIT|AUXINPUT11_BIT|AUXINPUT12_BIT|AUXINPUT13_BIT|AUXINPUT4_BIT|AUXINPUT15_BIT)
772 #define AUXINPUT_MASK_SUM (AUXINPUT0_BIT+AUXINPUT1_BIT+AUXINPUT2_BIT+AUXINPUT3_BIT+AUXINPUT4_BIT+AUXINPUT5_BIT+AUXINPUT6_BIT+AUXINPUT7_BIT+\
773 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:142
@ PullMode_None
0b00 (0x00)
Definition: crossbar.h:583
@ PullMode_Up
0b01 (0x01)
Definition: crossbar.h:584
@ Output_CoProc_Boot0
Definition: crossbar.h:235
@ Input_Probe
Definition: crossbar.h:43
@ Output_StepperEnableX
Definition: crossbar.h:171
@ Input_MotorFault
Definition: crossbar.h:37
@ Input_MotorWarning
Definition: crossbar.h:38
@ Input_ProbeDisconnect
Definition: crossbar.h:36
@ Input_StopDisable
Definition: crossbar.h:34
@ Output_StepperEnableXY
Definition: crossbar.h:182
@ Input_LimitsOverride
Definition: crossbar.h:39
@ Output_CoProc_Reset
Definition: crossbar.h:234
@ Output_StepperEnableZ
Definition: crossbar.h:175
@ Input_QEI_Select
Definition: crossbar.h:258
@ Input_BlockDelete
Definition: crossbar.h:33
@ Output_StepperEnable
Definition: crossbar.h:169
@ Output_SpindleDir
Definition: crossbar.h:185
@ Output_StepperEnableY
Definition: crossbar.h:173
@ Input_SingleBlock
Definition: crossbar.h:40
@ Output_SPIRST
Definition: crossbar.h:245
@ Output_SpindleOn
Definition: crossbar.h:184
@ Input_I2CStrobe
Definition: crossbar.h:252
@ Output_Spindle1Dir
Definition: crossbar.h:188
@ Output_SpindlePWM
Definition: crossbar.h:186
@ Output_CoolantMist
Definition: crossbar.h:190
@ Input_MPGSelect
Definition: crossbar.h:58
@ Output_Spindle1On
Definition: crossbar.h:187
@ Input_SafetyDoor
Definition: crossbar.h:32
@ Output_CoolantFlood
Definition: crossbar.h:191
@ Output_Spindle1PWM
Definition: crossbar.h:189
pin_irq_mode_t
Pin interrupt modes, may be or'ed when reporting pin capability.
Definition: crossbar.h:556
@ IRQ_Mode_Rising
0b00001 (0x01)
Definition: crossbar.h:558
@ IRQ_Mode_None
0b00000 (0x00)
Definition: crossbar.h:557
@ IRQ_Mode_Change
0b00100 (0x04)
Definition: crossbar.h:561
@ IRQ_Mode_Falling
0b00010 (0x02)
Definition: crossbar.h:559
@ WaitMode_Immediate
0 - This is the only mode allowed for analog inputs
Definition: gcode.h:288
DCRAM grbl_hal_t hal
Global HAL struct.
Definition: grbllib.c:91
xbar_t * 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:284
bool ioport_set_function(xbar_t *pin, pin_function_t function, driver_caps_t caps)
Set pin function.
Definition: ioports.c:345
bool ioports_enumerate(io_port_type_t type, io_port_direction_t dir, pin_cap_t filter, ioports_enumerate_callback_ptr callback, void *data)
Enumerate ports.
Definition: ioports.c:415
@ Port_Input
0
Definition: ioports.h:34
@ Port_Output
1
Definition: ioports.h:35
bool(* ioports_enumerate_callback_ptr)(xbar_t *properties, uint8_t port, void *data)
Definition: ioports.h:161
@ Port_Digital
1
Definition: ioports.h:30
void(* ioport_interrupt_callback_ptr)(uint8_t port, bool state)
Pointer to callback function for input port interrupt events.
Definition: ioports.h:142
#define On
Definition: nuts_bolts.h:36
bool(* aux_claim_explicit_ptr)(aux_ctrl_t *aux_ctrl)
Definition: pin_bits_masks.h:348
#define EXPANDER_PORT
Definition: pin_bits_masks.h:54
settings_t settings
Definition: settings.c:43
Definition: crossbar.h:733
uint8_t aux_port
Definition: crossbar.h:735
void * output
Definition: crossbar.h:738
pin_function_t function
Definition: crossbar.h:734
Definition: crossbar.h:723
uint8_t aux_port
Definition: crossbar.h:725
control_signals_t cap
Definition: crossbar.h:727
pin_irq_mode_t irq_mode
Definition: crossbar.h:726
void * input
Definition: crossbar.h:730
pin_function_t function
Definition: crossbar.h:724
/a cfg_data argument to /a xbar_config_ptr for gpio input pins
Definition: crossbar.h:683
bool debounce
Definition: crossbar.h:685
bool inverted
Definition: crossbar.h:684
pull_mode_t pull_mode
Definition: crossbar.h:686
io_port_t port
Optional handlers for axuillary I/O (adds support for M62-M66).
Definition: hal.h:634
control_signals_t signals_cap
Control input signals supported by the driver.
Definition: hal.h:669
wait_on_input_ptr wait_on_input
Optional handler for reading a digital or analog input.
Definition: ioports.h:171
ioport_register_interrupt_handler_ptr register_interrupt_handler
Definition: ioports.h:176
get_pin_info_ptr get_pin_info
Optional handler for getting information about an auxiliary pin.
Definition: ioports.h:173
Definition: settings.h:853
control_signals_t control_invert
Definition: settings.h:865
probeflags_t probe
Definition: settings.h:876
Definition: crossbar.h:741
pin_mode_t mode
Current pin configuration.
Definition: crossbar.h:750
xbar_config_ptr config
Optional pointer to function for configuring the port.
Definition: crossbar.h:751
xbar_set_value_ptr set_value
Optional pointer to function to set port value.
Definition: crossbar.h:753
uint_fast8_t pin
Pin number.
Definition: crossbar.h:748
uint16_t mask
Definition: system.h:164
Definition: crossbar.h:614
uint16_t debounce
Definition: crossbar.h:648
uint16_t invert_probe_pin
Definition: settings.h:602
uint16_t disable_probe_pullup
Definition: settings.h:603