Integration of a custom power module

Hello,

  • I am attempting to integrate a custom-design power sensor, to provide battery voltage and current readings. This circuit measures battery voltage, current and temperature and communicates using I2C. I would like to know how/where the drivers specific for this device need to be added, and what procedure needs to be followed for it to work.
  • The second part of this question would be how/where to integrate MAVLink messages into this driver, so that I can view the sensor data from my GCS (QGC).
  • The final part of this question will be - I would like for the Pixhawk to use the values provided by the custom power sensor when it requires battery voltage and current. How would I go about achieving this?

Check out this pull request which also adds support for an I2C power module:

Lovely, thank you so much!