Hi @mogilipuri_harish
The best recommendation is if you have an unused pin use one to be de input and the other one to be the output. But in the case of not having enough pins, it is possible to change the configuration of the pin as you said before, you just have to take care of setting up the pin properly. As I mentioned before you are going to need to deinitialize the pin and initialize again with the desired configuration.