Battery Displays for Custom Hardware

I am having difficulty figuring out two indicators for a custom piece of battery hardware.

Firstly, on the home screen, scrolling all the way to the left in the widget screen, you can see the battery for connected wireless devices, electronic pencils, etc.

Additionally, when you use Apple battery packs, you can see the battery for it on the top right of your phone

I am wondering where I should look to see how I could integrate both of these. I have searched the documentation for a while, and I am having a hard time knowing where to start. If anyone can point me to something, it would be very appreciated. Thank you!

Battery Displays for Custom Hardware
 
 
Q