ti_bandgap_adc_to_mcelsius(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ti_bandgap_adc_to_mcelsius β€” bestie, let's translate raw ADC numbers into actual temperatures ✨

okay so this is a page from the Kernel API Manual, and it's about ti_bandgap_adc_to_mcelsius, which honestly does exactly what it says on the tin β€” it takes a raw ADC value and turns it into milli-Celsius. no cap. let's get into it 🫢


🌸 NAME 🌸

ti_bandgap_adc_to_mcelsius β€” converts an ADC value to mCelsius scale πŸ’–

like, that's the whole job. glow-up for numbers.


✨ SYNOPSIS ✨

int ti_bandgap_adc_to_mcelsius (struct ti_bandgap *bgp , int adc_val ,
       int *t );

three things go in, one int comes out. the whole slay. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • bgp β€” a struct ti_bandgap pointer, i.e. the bandgap vibe itself. that's your main character. πŸ‘‘
  • adc_val β€” the value in ADC representation. raw, unedited, pre-transformation. πŸŒ€
  • t β€” the address where to write the resulting temperature in mCelsius. yes bestie, it writes through this pointer, so make sure it's a real place to put a number. πŸ“

πŸ’œ DESCRIPTION πŸ’œ

Simple conversion from ADC representation to mCelsius. literally it. no extra lore, no side quests.

In case the ADC value is out of the ADC conv table range, it returns -ERANGE, and 0 on success. the conversion table is indexed by the ADC values, so if adc_val goes off the end of the table, that's a hard no from the kernel. πŸ™ˆ

bestie. the range check is real. if your adc_val is out of the ADC conv table range you get -ERANGE back and no cute temperature for you. πŸ’€

πŸ”₯ RETURN πŸ”₯

  • 0 if conversion was successful πŸŽ‰
  • else -ERANGE in case the adc_val argument is out of the ADC conv table range 😭

that's it. two outcomes. binary. iconic.


🌈 SEE ALSO 🌈

Kernel file ./drivers/thermal/ti-soc-thermal/ti-bandgap.c β€” go read the source, iykyk πŸ“–

and the whole friend group of related functions, all present and accounted for:

like a whole group chat of thermal-bandgap functions, and this one's just the temperature translator πŸ’…


mwah πŸ’‹ this page lives in ./drivers/thermal/ti-soc-thermal, dated October 2026, and it's the ti_bandgap_adc_to_mcelsius(9) manual page β€” from the Kernel API Manual. go forth and convert, bestie. πŸ¦‹βœ¨

πŸ“¦ where this page comes from