power_suppl...esist_simple(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– NAME ๐Ÿ’–

power_supply_temp2resist_simple โ€” bestie, this is the one that finds your battery's internal resistance percent from the temperature ๐ŸŒก๏ธโœจ

โœจ SYNOPSIS โœจ

int power_supply_temp2resist_simple (const struct
power_supply_resistance_temp_table *table , int table_len , int temp );

๐ŸŽ€ ARGUMENTS ๐ŸŽ€

  • table โ€” a pointer to the battery resistance temperature table, like literally the whole lookup vibe ๐Ÿ’…
  • table_len โ€” the table length, bestie. how many entries we're working with ๐Ÿซถ
  • temp โ€” the current temperature, that's the moment we're checking ๐ŸŒก๏ธ

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Ok so picture this: this helper function is what you call to look up the battery internal resistance percent based on the current temperature value, pulling it out of the resistance temperature table ๐Ÿ‘‘ And here's the thing โ€” the table must be ordered descending ๐Ÿ”ฅ no cap, that's a hard requirement, don't come at it with an ascending table ๐Ÿ˜ญ

Then the actual math goes like this, and it's genuinely iconic:

the actual battery internal resistance = the ideal battery internal resistance * percent / 100 ๐Ÿงฎโœจ

๐ŸŒธ RETURN ๐ŸŒธ

It gives you back the battery internal resistance percent. That's it. That's the whole gift ๐ŸŽ๐Ÿ’œ

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

The kernel file lives right here, go be nosy:

  • ./drivers/power/supply/power_supply_core.c

And the whole friend group of related pages, fr fr:


Okay that's the whole page, you ate that ๐Ÿ’…โœจ This lil gem lives over in ./drivers/power/supply and it's stamped October 2026 โ€” go forth and calculate those resistance percents, bestie, ily ๐Ÿซถ๐Ÿ’–๐ŸŽ€

๐Ÿ“ฆ where this page comes from