Digital I/O Recall

I think your XY problem is mainly negative thinking in this case.

Can anyone point me in the direction of a project that does some simple port switching?