LPC SPI Firmware and Driver Prototype

from what i’ve seen, waybar and kde (and maybe also gnome) all use a different method for calculating remaining percentage.

The LPC firmware looks at current draw per sample period and does a linear calculation of current usage against min/max for creating the percentage. This is reported as the “capacity” property in the driver.

Waybar ignores the capacity percentage property in favor of the amperage properties and calculates its own percentage out of the hardcoded ideal capacity. You can manually add an entry to waybar that reads the capacity property instead, it will always match the oled value then.

I believe KDE and Gnome try more complicated algorithms to create non-linear charge and discharge profiles, but I haven’t delved into their algorithms. They also have slower battery status update loops.

3 Likes