I'm looking for a method to share one GPIO device/HAT/pHAT between two Raspberry Pis. For example, I'd like to connect one HyperPixel 4.0, which attaches via the 40 GPIO pins, to two different Raspberry Pis.
I found products that offer the opposite of what I am looking for, connection of multiple devices/HATs/pHATs to one Raspberry Pi (e.g. pHAT Stack by Pimoroni).
Ideally I could switch the active Raspberry Pi programmatically. A last resort would be to connect all 40 pins to a custom switching mechanism using relays or mosfets, which is controlled by a third Raspberry Pi or a microcontroller.
The goal would be to share a screen and programmatically switch the Raspberry Pi using the screen.