ti_bandgap_adc_to_mcelsius(9)
π 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β astruct ti_bandgappointer, 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 youradc_valis out of the ADC conv table range you get-ERANGEback and no cute temperature for you. π
π₯ RETURN π₯
0if conversion was successful π- else
-ERANGEin case theadc_valargument 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:
ti_bandgap_readl(9)ti_bandgap_writel(9)macro to update bits.(9)ti_bandgap_power(9)ti_errata814_bandgap_read_temp(9)ti_bandgap_read_temp(9)ti_bandgap_talert_irq_handler(9)ti_bandgap_tshut_irq_handler(9)ti_bandgap_validate(9)ti_bandgap_read_counter(9)ti_bandgap_read_counter_delay(9)ti_bandgap_read_update_interval(9)ti_bandgap_write_counter_delay(9)ti_bandgap_write_counter(9)ti_bandgap_write_update_interval(9)ti_bandgap_read_temperature(9)ti_bandgap_set_sensor_data(9)ti_bandgap_get_sensor_data(9)ti_bandgap_force_single_read(9)ti_bandgap_set_continuous_mode(9)ti_bandgap_get_trend(9)ti_bandgap_tshut_init(9)ti_bandgap_talert_init(9)ti_bandgap_build(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms