Understanding PX4 fmu v-4 I2C setup for general cases

Hi

I am currently researching the PX4 fmu-v4 flight controller by Holybro. I need to learn how to write a driver for any general device I want to connect to the controller as a slave via I2C. The main goal is to decide which of the three ports to use, what address the device has on the system and how to read/write with uOrb.

Any help will be much appreciated.