My PCB can be supplied by internal LiPo, USB or via an external supply through a data connector that also carries power. Right now, I have the power inputs or-ed with LM66100's.
I'd like to prioritise the supply options as follows: USB > EXT > Battery. The LM66100s always switch to the highest voltage, so that makes USB highest priority. However, the external supply can come from a battery in the other device as well, and so it can be lower than the internal battery's voltage. Since the battery there is larger than the internal one, it should always be prioritised above the internal battery.
I have never designed such a priority switch, so I'd like to ask for pointers as to how to achieve this prioritization.
Some data as requested: The battery voltage (and external supply) is from standard LiPo 1S batteries, so let's say between 3.5V and 4.2V. Current is 500mA max.