Yes, special function pins revert to GPIO if the special function is disabled in HAL
For example on a 7I96S, if you only need 4 step/dir pairs you set num_stepgens=4 in the hal file
and then the GPIO pins that would have been STEP4 and DIR4 become GPIO 25 and 26
To use these GPIO pins as outputs, you must set them into output mode:
setp hm2_7i96s.0.gpio.025.is_output true
setp hm2_7i96s.0.gpio.026.is_output true
and then link the output to the desired signal
net some_output hm2_7i96s.0.gpio.025.out
You may need to invert the output and choose the proper + or - pin
to insure that the output is low at power up or when you exit from LinuxCNC:
setp hm2_7i96s.0.gpio.025.invert_output true
To determine the terminal block to GPIO pin mapping, look at the appropriate .pin file
or run:
mesaflash --device [cardname] --addr [card_address] --readhmid