28 #if PROBE_ENABLE && !defined(PROBE_PIN)
29 #error "Probe input is not supported in this configuration!"
32 #if SAFETY_DOOR_ENABLE && !defined(SAFETY_DOOR_PIN)
33 #error "Safety door input is not supported in this configuration!"
36 #if MOTOR_FAULT_ENABLE && !defined(MOTOR_FAULT_PIN)
37 #error "Motor fault input is not supported in this configuration!"
40 #if MOTOR_WARNING_ENABLE && !defined(MOTOR_WARNING_PIN)
41 #error "Motor warning input is not supported in this configuration!"
44 #if I2C_STROBE_ENABLE && !defined(I2C_STROBE_PIN)
45 #error "I2C keypad/strobe is not supported in this configuration!"
48 #if MPG_ENABLE == 1 && !defined(MPG_MODE_PIN)
49 #error "MPG mode input is not supported in this configuration!"
52 #if (ENCODER_ENABLE & 1) && !defined(QEI_SELECT_PIN)
53 #error "Encoder select input is not supported in this configuration!"
56 #define EXPANDER_PORT 1
64 #define RESET_PORT CONTROL_PORT
66 #ifndef FEED_HOLD_PORT
67 #define FEED_HOLD_PORT CONTROL_PORT
69 #ifndef CYCLE_START_PORT
70 #define CYCLE_START_PORT CONTROL_PORT
73 #define ESTOP_PORT CONTROL_PORT
75 #ifndef PROBE_DISCONNECT_PORT
76 #define PROBE_DISCONNECT_PORT CONTROL_PORT
78 #ifndef STOP_DISABLE_PORT
79 #define STOP_DISABLE_PORT CONTROL_PORT
81 #ifndef BLOCK_DELETE_PORT
82 #define BLOCK_DELETE_PORT CONTROL_PORT
84 #ifndef SINGLE_BLOCK_PORT
85 #define SINGLE_BLOCK_PORT CONTROL_PORT
87 #ifndef MOTOR_FAULT_PORT
88 #define MOTOR_FAULT_PORT CONTROL_PORT
90 #ifndef MOTOR_WARNING_PORT
91 #define MOTOR_WARNING_PORT CONTROL_PORT
93 #ifndef LIMITS_OVERRIDE_PORT
94 #define LIMITS_OVERRIDE_PORT CONTROL_PORT
96 #if SAFETY_DOOR_ENABLE && !defined(SAFETY_DOOR_PORT)
97 #define SAFETY_DOOR_PORT CONTROL_PORT
102 #ifndef SD_DETECT_BIT
104 #define SD_DETECT_BIT (1<<SD_DETECT_PIN)
106 #define SD_DETECT_BIT 0
110 #ifndef CONTROL_ENABLE
111 #define CONTROL_ENABLE 0
114 #define a_cap(pin) .cap.pin
116 #if defined(ESP_PLATFORM) || defined(RP2040) || defined(__IMXRT1062__)
117 #define add_aux_input(fn, aux, irq, signal_bit) { .function = fn, .irq_mode = irq, .signal.value = signal_bit, .port = IOPORT_UNASSIGNED, .gpio.pin = aux##_PIN },
119 #define add_aux_input(fn, aux, irq, signal_bit) { .function = fn, .irq_mode = irq, .signal.value = signal_bit, .port = IOPORT_UNASSIGNED, .gpio.port = (void *)aux##_PORT, .gpio.pin = aux##_PIN },
121 #if defined(__IMXRT1062__) || defined(ESP_PLATFORM)
122 #define add_aux_output(fn, aux) { .function = fn, .port = IOPORT_UNASSIGNED, .gpio.pin = aux##_PIN },
124 #define add_aux_output(fn, aux) { .function = fn, .port = IOPORT_UNASSIGNED, .gpio.port = (void *)aux##_PORT, .gpio.pin = aux##_PIN },
126 #define add_aux_input_scan(fn, irq, signal_bit) { .function = fn, .irq_mode = irq, .signal.value = signal_bit, .port = IOPORT_UNASSIGNED, .gpio.pin = 0xFF, .scan = On },
127 #define add_aux_motor_input(fn, motor, aux, irq) { .function = fn##motor, .irq_mode = irq, .port = IOPORT_UNASSIGNED, .gpio.port = (void *)motor##_##aux##_PORT, .gpio.pin = motor##_##aux##_PIN },
128 #define add_aux_input_no_signal(fn, irq) { .function = fn, .irq_mode = irq, .port = IOPORT_UNASSIGNED, .gpio.pin = 0xFE },
129 #define add_aux_output_exp(fn, aux) { .function = fn, .port = IOPORT_UNASSIGNED, .gpio.port = (void *)aux##_PORT, .gpio.pin = aux##_PIN },
134 #if (CONTROL_ENABLE & CONTROL_ESTOP)
136 #elif (CONTROL_ENABLE & CONTROL_RESET)
140 #if (CONTROL_ENABLE & CONTROL_FEED_HOLD) && defined(FEED_HOLD_PIN)
143 #if (CONTROL_ENABLE & CONTROL_CYCLE_START) && defined(CYCLE_START_PIN)
146 #if SAFETY_DOOR_ENABLE && defined(SAFETY_DOOR_PIN)
149 #if MOTOR_FAULT_ENABLE && defined(MOTOR_FAULT_PIN)
152 #if defined(X_MOTOR_FAULT_PIN)
155 #if defined(Y_MOTOR_FAULT_PIN)
158 #if defined(Z_MOTOR_FAULT_PIN)
161 #if defined(A_MOTOR_FAULT_PIN)
164 #if defined(B_MOTOR_FAULT_PIN)
167 #if defined(C_MOTOR_FAULT_PIN)
170 #if defined(U_MOTOR_FAULT_PIN)
173 #if defined(V_MOTOR_FAULT_PIN)
176 #if defined(W_MOTOR_FAULT_PIN)
179 #if defined(X2_MOTOR_FAULT_PIN)
182 #if defined(Y2_MOTOR_FAULT_PIN)
185 #if defined(Z2_MOTOR_FAULT_PIN)
189 #if MOTOR_WARNING_ENABLE && defined(MOTOR_WARNING_PIN)
192 #if I2C_STROBE_ENABLE && defined(I2C_STROBE_PIN)
195 #if MPG_ENABLE == 1 && defined(MPG_MODE_PIN)
198 #if QEI_ENABLE && defined(QEI_A_PIN) && defined(QEI_B_PIN)
202 #if (ENCODER_ENABLE & 1) && defined(QEI_SELECT_PIN)
206 #if PROBE_ENABLE && defined(PROBE_PIN)
209 #if PROBE2_ENABLE && defined(PROBE2_PIN)
212 #if TOOLSETTER_ENABLE && defined(TOOLSETTER_PIN)
217 #if TOOLSETTER_ENABLE && !defined(TOOLSETTER_PIN)
220 #if PROBE2_ENABLE && !defined(PROBE2_PIN)
223 #if TLS_OVERTRAVEL_ENABLE
226 #if LIMITS_OVERRIDE_ENABLE
229 #if STOP_DISABLE_ENABLE
232 #if BLOCK_DELETE_ENABLE
235 #if SINGLE_BLOCK_ENABLE
238 #if PROBE_DISCONNECT_ENABLE
246 #ifdef STM32_PLATFORM
254 for(idx = 0; ctrl_pin == NULL && aux_ctrl[idx].
gpio.
pin != 0xFF && idx <
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t); idx++) {
255 if(aux_ctrl[idx].gpio.
pin == gpio.
pin && aux_ctrl[idx].gpio.port == gpio.
port)
256 ctrl_pin = &aux_ctrl[idx];
288 for(idx = 0; ctrl_pin == NULL && idx <
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t) && aux_ctrl[idx].
gpio.
pin != 0xFF; idx++) {
289 if(aux_ctrl[idx].gpio.
pin == gpio.
pin && aux_ctrl[idx].gpio.port == gpio.
port) {
290 ctrl_pin = &aux_ctrl[idx];
291 ctrl_pin->
port = port;
292 ctrl_pin->
input = input;
301 static inline aux_ctrl_t *aux_ctrl_in_get (uint8_t port)
305 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
308 if(aux_ctrl[--idx].port == port)
309 ctrl_pin = &aux_ctrl[idx];
310 }
while(idx && ctrl_pin == NULL);
317 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
320 if(aux_ctrl[--idx].port != 0xFF && aux_ctrl[idx].irq_mode !=
IRQ_Mode_None) {
321 if(!(xbar_is_probe_in(aux_ctrl[idx].
function) || xbar_is_encoder_in(aux_ctrl[idx].
function))) {
335 static bool __claim_in_port (
xbar_t *properties, uint8_t port,
void *data)
347 static bool __find_in_ext (
xbar_t *properties, uint8_t port,
void *data)
357 static bool __find_in_port (
xbar_t *properties, uint8_t port,
void *data)
370 if(aux_claim == NULL)
371 aux_claim = __claim_in_port;
373 if(
sizeof(aux_ctrl))
for(idx = 0; idx <
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t); idx++) {
377 aux_claim_explicit(&aux_ctrl[idx]);
379 aux_claim_explicit(&aux_ctrl[idx]);
386 aux_claim_explicit(&aux_ctrl[idx]);
388 #ifdef STM32_PLATFORM
392 if(aux_ctrl[idx].gpio.
pin == 0xFF) {
402 #if PROBE_DISCONNECT_ENABLE || STOP_DISABLE_ENABLE || BLOCK_DELETE_ENABLE || SINGLE_BLOCK_ENABLE || LIMITS_OVERRIDE_ENABLE
404 uint_fast8_t idx =
sizeof(aux_ctrl) /
sizeof(
aux_ctrl_t);
407 if(!aux_ctrl[--idx].scan)
413 signals.
mask |= aux_ctrl[idx].signal.mask;
416 signals.
mask |= aux_ctrl[idx].signal.mask;
428 #if defined(ESP_PLATFORM) || defined(RP2040)
429 #if defined(STEPPERS_ENABLE_PIN) && STEPPERS_ENABLE_PORT == EXPANDER_PORT
432 #if defined(X_ENABLE_PIN) && X_ENABLE_PORT == EXPANDER_PORT
435 #if defined(X2_ENABLE_PIN) && X2_ENABLE_PORT == EXPANDER_PORT
438 #if defined(Y_ENABLE_PIN) && Y_ENABLE_PORT == EXPANDER_PORT
441 #if defined(Y2_ENABLE_PIN) && Y2_ENABLE_PORT == EXPANDER_PORT
444 #if defined(XY_ENABLE_PIN) && XY_ENABLE_PORT == EXPANDER_PORT
447 #if defined(Z_ENABLE_PIN) && Z_ENABLE_PORT == EXPANDER_PORT
450 #if defined(Z2_ENABLE_PIN) && Z2_ENABLE_PORT == EXPANDER_PORT
453 #if defined(A_ENABLE_PIN) && A_ENABLE_PORT == EXPANDER_PORT
456 #if defined(B_ENABLE_PIN) && B_ENABLE_PORT == EXPANDER_PORT
459 #if defined(C_ENABLE_PIN) && C_ENABLE_PORT == EXPANDER_PORT
462 #if defined(U_ENABLE_PIN) && U_ENABLE_PORT == EXPANDER_PORT
465 #if defined(V_ENABLE_PIN) && V_ENABLE_PORT == EXPANDER_PORT
470 #ifdef SPINDLE_ENABLE_PIN
473 #ifdef SPINDLE_PWM_PIN
476 #ifdef SPINDLE_DIRECTION_PIN
479 #ifdef SPINDLE1_ENABLE_PIN
482 #ifdef SPINDLE1_DIRECTION_PIN
485 #ifdef SPINDLE1_PWM_PIN
488 #ifdef COOLANT_FLOOD_PIN
491 #ifdef COOLANT_MIST_PIN
494 #ifdef COPROC_RESET_PIN
497 #ifdef COPROC_BOOT0_PIN
500 #if defined(SPI_RST_PIN) && defined(RP2040)
502 #define SPI_RST_PORT 0
516 if(aux_ctrl_out[idx].gpio.
port == gpio.
port && aux_ctrl_out[idx].gpio.pin == gpio.
pin) {
517 ctrl_pin = &aux_ctrl_out[idx];
518 ctrl_pin->
port = port;
519 ctrl_pin->
output = output;
521 }
while(idx && ctrl_pin == NULL);
530 static bool __claim_out_port (
xbar_t *properties, uint8_t port,
void *data)
559 if(aux_claim == NULL)
560 aux_claim = __claim_out_port;
562 if(aux_claim_explicit == NULL)
563 aux_claim_explicit = ___claim_out_port_explicit;
565 if(
sizeof(aux_ctrl_out))
for(idx = 0; idx <
sizeof(aux_ctrl_out) /
sizeof(
aux_ctrl_out_t); idx++) {
571 aux_claim_explicit(&aux_ctrl_out[idx]);
574 }
else if(aux_ctrl_out[idx].gpio.
pin == 0xFF) {
576 aux_claim_explicit(&aux_ctrl_out[idx]);
578 aux_claim_explicit(&aux_ctrl_out[idx]);
584 #if defined(SPINDLE_ENABLE_PIN) && !defined(SPINDLE_ENABLE_BIT)
585 #define SPINDLE_ENABLE_BIT (1<<SPINDLE_ENABLE_PIN)
587 #if defined(SPINDLE_DIRECTION_PIN) && !defined(SPINDLE_DIRECTION_BIT)
588 #define SPINDLE_DIRECTION_BIT (1<<SPINDLE_DIRECTION_PIN)
591 #if defined(SPINDLE1_ENABLE_PIN) && !defined(SPINDLE1_ENABLE_BIT)
592 #define SPINDLE1_ENABLE_BIT (1<<SPINDLE1_ENABLE_PIN)
594 #if defined(SPINDLE1_DIRECTION_PIN) && !defined(SPINDLE1_DIRECTION_BIT)
595 #define SPINDLE1_DIRECTION_BIT (1<<SPINDLE1_DIRECTION_PIN)
598 #if defined(COOLANT_FLOOD_PIN) && !defined(COOLANT_FLOOD_BIT)
599 #define COOLANT_FLOOD_BIT (1<<COOLANT_FLOOD_PIN)
601 #if defined(COOLANT_MIST_PIN) && !defined(COOLANT_MIST_BIT)
602 #define COOLANT_MIST_BIT (1<<COOLANT_MIST_PIN)
605 #if defined(RTS_PIN) && !defined(RTS_BIT)
606 #define RTS_BIT (1<<RTS_PIN)
609 #if defined(RS485_DIR_PIN) && !defined(RS485_DIR_BIT)
610 #define RS485_DIR_BIT (1<<RS485_DIR_PIN)
627 #ifndef QEI_SELECT_BIT
628 #define QEI_SELECT_BIT 0
631 #define MPG_MODE_BIT 0
633 #ifndef I2C_STROBE_BIT
634 #define I2C_STROBE_BIT 0
639 #if SPINDLE_ENCODER_ENABLE
640 #ifndef SPINDLE_PULSE_PIN
643 #if !defined(SPINDLE_PULSE_BIT) && defined(SPINDLE_PULSE_PIN)
644 #define SPINDLE_PULSE_BIT (1<<SPINDLE_PULSE_PIN)
646 #if !defined(SPINDLE_INDEX_BIT) && defined(SPINDLE_INDEX_PIN)
647 #define SPINDLE_INDEX_BIT (1<<SPINDLE_INDEX_PIN)
651 #ifndef SPINDLE_INDEX_BIT
652 #define SPINDLE_INDEX_BIT 0
654 #ifndef SPINDLE_PULSE_BIT
655 #define SPINDLE_PULSE_BIT 0
658 #if SPINDLE_ENCODER_ENABLE && (SPINDLE_INDEX_BIT + SPINDLE_PULSE_BIT) == 0
659 #error "Spindle encoder requires SPINDLE_PULSE_PIN and SPINDLE_INDEX_PIN defined in the board map!"
663 #define SPI_IRQ_BIT 0
664 #elif !defined(SPI_IRQ_BIT)
665 #define SPI_IRQ_BIT (1<<SPI_IRQ_PIN)
668 #ifndef DEVICES_IRQ_MASK
669 #define DEVICES_IRQ_MASK (SPI_IRQ_BIT|SPINDLE_INDEX_BIT|QEI_A_BIT|QEI_B_BIT|SD_DETECT_BIT)
670 #define DEVICES_IRQ_MASK_SUM (SPI_IRQ_BIT+SPINDLE_INDEX_BIT+QEI_A_BIT+QEI_B_BIT+SD_DETECT_BIT)
673 #ifdef STM32_PLATFORM
678 #define RESET_BIT (1<<RESET_PIN)
684 #define FEED_HOLD_BIT (1<<FEED_HOLD_PIN)
686 #define FEED_HOLD_BIT 0
689 #ifdef CYCLE_START_PIN
690 #define CYCLE_START_BIT (1<<CYCLE_START_PIN)
692 #define CYCLE_START_BIT 0
695 #ifdef PROBE_DISCONNECT_PIN
696 #define PROBE_DISCONNECT_BIT (1<<PROBE_DISCONNECT_PIN)
698 #define PROBE_DISCONNECT_BIT 0
701 #ifdef STOP_DISABLE_PIN
702 #define STOP_DISABLE_BIT (1<<STOP_DISABLE_PIN)
704 #define STOP_DISABLE_BIT 0
707 #ifdef BLOCK_DELETE_PIN
708 #define BLOCK_DELETE_BIT (1<<BLOCK_DELETE_PIN)
710 #define BLOCK_DELETE_BIT 0
713 #ifdef SINGLE_BLOCK_PIN
714 #define SINGLE_BLOCK_BIT (1<<SINGLE_BLOCK_PIN)
716 #define SINGLE_BLOCK_BIT 0
719 #ifdef MOTOR_FAULT_PIN
720 #define MOTOR_FAULT_BIT (1<<MOTOR_FAULT_PIN)
722 #define MOTOR_FAULT_BIT 0
725 #ifdef MOTOR_WARNING_PIN
726 #define MOTOR_WARNING_BIT (1<<MOTOR_WARNING_PIN)
728 #define MOTOR_WARNING_BIT 0
732 #define CONTROL_MASK (RESET_BIT|FEED_HOLD_BIT|CYCLE_START_BIT|PROBE_DISCONNECT_BIT|STOP_DISABLE_BIT|BLOCK_DELETE_BIT|SINGLE_BLOCK_BIT|MOTOR_FAULT_BIT|MOTOR_WARNING_BIT)
733 #define CONTROL_MASK_SUM (RESET_BIT+FEED_HOLD_BIT+CYCLE_START_BIT+PROBE_DISCONNECT_BIT+STOP_DISABLE_BIT+BLOCK_DELETE_BIT+SINGLE_BLOCK_BIT+MOTOR_FAULT_BIT+MOTOR_WARNING_BIT)
741 #define AUXINPUT0_BIT (1<<AUXINPUT0_PIN)
743 #define AUXINPUT0_BIT 0
746 #define AUXINPUT1_BIT (1<<AUXINPUT1_PIN)
748 #define AUXINPUT1_BIT 0
751 #define AUXINPUT2_BIT (1<<AUXINPUT2_PIN)
753 #define AUXINPUT2_BIT 0
756 #define AUXINPUT3_BIT (1<<AUXINPUT3_PIN)
758 #define AUXINPUT3_BIT 0
761 #define AUXINPUT4_BIT (1<<AUXINPUT4_PIN)
763 #define AUXINPUT4_BIT 0
766 #define AUXINPUT5_BIT (1<<AUXINPUT5_PIN)
768 #define AUXINPUT5_BIT 0
771 #define AUXINPUT6_BIT (1<<AUXINPUT6_PIN)
773 #define AUXINPUT6_BIT 0
776 #define AUXINPUT7_BIT (1<<AUXINPUT7_PIN)
778 #define AUXINPUT7_BIT 0
781 #define AUXINPUT8_BIT (1<<AUXINPUT8_PIN)
783 #define AUXINPUT8_BIT 0
786 #define AUXINPUT9_BIT (1<<AUXINPUT9_PIN)
788 #define AUXINPUT9_BIT 0
790 #ifdef AUXINPUT10_PIN
791 #define AUXINPUT10_BIT (1<<AUXINPUT10_PIN)
793 #define AUXINPUT10_BIT 0
795 #ifdef AUXINPUT11_PIN
796 #define AUXINPUT11_BIT (1<<AUXINPUT11_PIN)
798 #define AUXINPUT11_BIT 0
800 #ifdef AUXINPUT12_PIN
801 #define AUXINPUT12_BIT (1<<AUXINPUT12_PIN)
803 #define AUXINPUT12_BIT 0
805 #ifdef AUXINPUT13_PIN
806 #define AUXINPUT13_BIT (1<<AUXINPUT13_PIN)
808 #define AUXINPUT13_BIT 0
810 #ifdef AUXINPUT14_PIN
811 #define AUXINPUT14_BIT (1<<AUXINPUT14_PIN)
813 #define AUXINPUT14_BIT 0
815 #ifdef AUXINPUT15_PIN
816 #define AUXINPUT15_BIT (1<<AUXINPUT15_PIN)
818 #define AUXINPUT15_BIT 0
821 #ifndef AUXINPUT_MASK
822 #define AUXINPUT_MASK (AUXINPUT0_BIT|AUXINPUT1_BIT|AUXINPUT2_BIT|AUXINPUT3_BIT|AUXINPUT4_BIT|AUXINPUT5_BIT|AUXINPUT6_BIT|AUXINPUT7_BIT|\
823 AUXINPUT8_BIT|AUXINPUT9_BIT|AUXINPUT10_BIT|AUXINPUT11_BIT|AUXINPUT12_BIT|AUXINPUT13_BIT|AUXINPUT14_BIT|AUXINPUT15_BIT)
824 #define AUXINPUT_MASK_SUM (AUXINPUT0_BIT+AUXINPUT1_BIT+AUXINPUT2_BIT+AUXINPUT3_BIT+AUXINPUT4_BIT+AUXINPUT5_BIT+AUXINPUT6_BIT+AUXINPUT7_BIT+\
825 AUXINPUT8_BIT+AUXINPUT9_BIT+AUXINPUT10_BIT+AUXINPUT11_BIT+AUXINPUT12_BIT+AUXINPUT13_BIT+AUXINPUT14_BIT+AUXINPUT15_BIT)
const char * xbar_fn_to_pinname(pin_function_t fn)
Definition: crossbar.c:177
@ Input_QEI_A
Definition: crossbar.h:337
@ Input_FeedHold
Definition: crossbar.h:46
@ Input_Toolsetter
Definition: crossbar.h:75
@ Output_StepperEnableV
Definition: crossbar.h:232
@ Input_Reset
Definition: crossbar.h:45
@ Output_CoProc_Boot0
Definition: crossbar.h:315
@ Input_Probe
Definition: crossbar.h:59
@ Output_StepperEnableX
Definition: crossbar.h:222
@ Input_MotorFault
Definition: crossbar.h:53
@ Input_Probe2
Definition: crossbar.h:73
@ Input_MotorWarning
Definition: crossbar.h:54
@ Input_ToolsetterOvertravel
Definition: crossbar.h:57
@ Input_ProbeDisconnect
Definition: crossbar.h:52
@ Input_EStop
Definition: crossbar.h:51
@ Input_StopDisable
Definition: crossbar.h:50
@ Output_StepperEnableXY
Definition: crossbar.h:234
@ Input_LimitsOverride
Definition: crossbar.h:55
@ Output_CoProc_Reset
Definition: crossbar.h:314
@ Output_StepperEnableZ
Definition: crossbar.h:226
@ Input_QEI_Select
Definition: crossbar.h:339
@ Output_StepperEnableU
Definition: crossbar.h:231
@ Output_StepperEnableA
Definition: crossbar.h:228
@ Output_StepperEnableY2
Definition: crossbar.h:225
@ Input_BlockDelete
Definition: crossbar.h:49
@ Output_StepperEnable
Definition: crossbar.h:220
@ Output_SpindleDir
Definition: crossbar.h:237
@ Output_StepperEnableY
Definition: crossbar.h:224
@ Output_StepperEnableC
Definition: crossbar.h:230
@ Input_SingleBlock
Definition: crossbar.h:56
@ Output_SPIRST
Definition: crossbar.h:325
@ Output_SpindleOn
Definition: crossbar.h:236
@ Input_I2CStrobe
Definition: crossbar.h:332
@ Output_Spindle1Dir
Definition: crossbar.h:240
@ Output_SpindlePWM
Definition: crossbar.h:238
@ Output_CoolantMist
Definition: crossbar.h:242
@ Input_MPGSelect
Definition: crossbar.h:76
@ Output_Spindle1On
Definition: crossbar.h:239
@ Input_QEI_B
Definition: crossbar.h:338
@ Output_StepperEnableB
Definition: crossbar.h:229
@ Input_CycleStart
Definition: crossbar.h:47
@ Input_SafetyDoor
Definition: crossbar.h:48
@ Output_CoolantFlood
Definition: crossbar.h:243
@ Output_StepperEnableX2
Definition: crossbar.h:223
@ Output_StepperEnableZ2
Definition: crossbar.h:227
@ Output_Spindle1PWM
Definition: crossbar.h:241
pin_irq_mode_t
Pin interrupt modes, may be or'ed when reporting pin capability.
Definition: crossbar.h:689
@ IRQ_Mode_Rising
0b00001 (0x01)
Definition: crossbar.h:691
@ IRQ_Mode_RisingFalling
0b00011 (0x03) - only used to report port capability.
Definition: crossbar.h:693
@ IRQ_Mode_None
0b00000 (0x00)
Definition: crossbar.h:690
@ IRQ_Mode_Change
0b00100 (0x04)
Definition: crossbar.h:694
@ IRQ_Mode_Falling
0b00010 (0x02)
Definition: crossbar.h:692
#define SPINDLE_ENABLE
Definition: driver_opts.h:345
#define SPINDLE1_ENABLE
Definition: driver_opts.h:317
#define COOLANT_FLOOD
Definition: driver_opts.h:300
#define COOLANT_MIST
Definition: driver_opts.h:301
#define SPINDLE_PWM
Definition: driver_opts.h:309
@ WaitMode_Immediate
0 - This is the only mode allowed for analog inputs
Definition: gcode.h:311
DCRAM grbl_hal_t hal
Global HAL struct.
Definition: grbllib.c:91
FLASHMEM 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:321
FLASHMEM bool ioport_set_function(xbar_t *pin, pin_function_t function, driver_caps_t caps)
Set pin function.
Definition: ioports.c:397
FLASHMEM 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:562
@ 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
#define IOPORT_UNASSIGNED
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:142
#define On
Definition: nuts_bolts.h:36
#define add_aux_input_scan(fn, irq, signal_bit)
Definition: pin_bits_masks.h:126
#define add_aux_input(fn, aux, irq, signal_bit)
Definition: pin_bits_masks.h:119
bool(* aux_claim_explicit_ptr)(aux_ctrl_t *aux_ctrl)
Definition: pin_bits_masks.h:331
#define add_aux_output(fn, aux)
Definition: pin_bits_masks.h:124
bool(* aux_claim_explicit_out_ptr)(aux_ctrl_out_t *aux_ctrl)
Definition: pin_bits_masks.h:526
#define add_aux_input_no_signal(fn, irq)
Definition: pin_bits_masks.h:128
#define add_aux_output_exp(fn, aux)
Definition: pin_bits_masks.h:129
#define add_aux_motor_input(fn, motor, aux, irq)
Definition: pin_bits_masks.h:127
#define EXPANDER_PORT
Definition: pin_bits_masks.h:56
settings_t settings
Definition: settings.c:48
Definition: crossbar.h:872
uint8_t port
Auxiliary port number, post claimed.
Definition: crossbar.h:874
void * output
Pointer to the driver input array entry for the pin.
Definition: crossbar.h:876
Definition: crossbar.h:862
pin_irq_mode_t irq_mode
Required IRQ mode for the input.
Definition: crossbar.h:865
control_signals_t signal
Set to the pin the input maps to, 0 if none.
Definition: crossbar.h:866
uint8_t port
Auxiliary port number, post claimed.
Definition: crossbar.h:864
void * input
Pointer to the driver input array entry for the pin.
Definition: crossbar.h:868
aux_gpio_t gpio
MCU port base address (may be NULL) and pin number.
Definition: crossbar.h:867
pin_function_t function
Pin function.
Definition: crossbar.h:863
Definition: crossbar.h:857
uint8_t pin
MCU pin number.
Definition: crossbar.h:859
void * port
MCU port address (may be NULL).
Definition: crossbar.h:858
io_port_t port
Optional handlers for axuillary I/O (adds support for M62-M66).
Definition: hal.h:659
control_signals_t signals_cap
Control input signals supported by the driver.
Definition: hal.h:694
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
Definition: settings.h:881
control_signals_t control_invert
Definition: settings.h:893
Definition: crossbar.h:879
xbar_set_value_ptr set_value
Optional pointer to function to set port value.
Definition: crossbar.h:891
uint_fast8_t pin
Pin number.
Definition: crossbar.h:886
pin_function_t function
Pin function.
Definition: crossbar.h:882
void * port
Optional pointer to the underlying peripheral or pin specific data.
Definition: crossbar.h:884
Definition: nuts_bolts.h:416
uint16_t mask
Definition: nuts_bolts.h:418
Definition: crossbar.h:747
uint32_t irq_mode
pin_irq_mode_t - IRQ modes
Definition: crossbar.h:754