I would like to build up a 'smart' battery for my RaspberryPi 3 and integrate it trough the OS. The electronics part is the easy task in this game. The complicate task (for me) is to find out how to share data coming from the 'smart' part of the battery package with the OS. There are many layers of software involved in handling such data but I think that most of them are already running in Raspbian (or any other distro running on Raspberry). I figured out (probably in a too semplicistic way) that I just needed to write up a 'driver' that:
- Read data from SPI or I2C bus (coming from the battery logic)
- packing them in a proper way
- share them with OS
Am I wrong? What's the correct way to approach it?