TI_ADC(4)
๐ฆ ti_adc โ the TI AM3XXX analog to digital converter driver ๐ฆ
okay so bestie, this page is from the arm Kernel Interfaces Manual, and it's literally all about ti_adc, the driver that lets you peek at the analog inputs. iykyk ๐
โจ SYNOPSIS โจ
device ti_adc
that's it. that's the whole vibe check. one line. iconic. ๐
๐ DESCRIPTION ๐
so the ti_adc driver gives you access to the AIN (analog inputs) on am3xxx SoCs โ like, the actual analog pins on the chip. no cap.
it hands you raw readings of the converted values for each analog input. raw. unfiltered. just numbers straight from the silicon. โจ
the way you actually get at this ti_adc data is through the sysctl(8) interface, and here's exactly what that looks like, literally verbatim, every single line:
dev.ti_adc.0.%desc: TI ADC controller
dev.ti_adc.0.%driver: ti_adc
dev.ti_adc.0.%pnpinfo: name=adc@44E0D000 compat=ti,adc
dev.ti_adc.0.%parent: simplebus0
dev.ti_adc.0.clockdiv: 2400
dev.ti_adc.0.ain.0.enable: 0
dev.ti_adc.0.ain.0.open_delay: 0
dev.ti_adc.0.ain.0.samples_avg: 0
dev.ti_adc.0.ain.0.input: 0
dev.ti_adc.0.ain.1.enable: 0
dev.ti_adc.0.ain.1.open_delay: 0
dev.ti_adc.0.ain.1.samples_avg: 0
dev.ti_adc.0.ain.1.input: 0
dev.ti_adc.0.ain.2.enable: 0
dev.ti_adc.0.ain.2.open_delay: 0
dev.ti_adc.0.ain.2.samples_avg: 0
dev.ti_adc.0.ain.2.input: 0
dev.ti_adc.0.ain.3.enable: 0
dev.ti_adc.0.ain.3.open_delay: 0
dev.ti_adc.0.ain.3.samples_avg: 0
dev.ti_adc.0.ain.3.input: 0
dev.ti_adc.0.ain.4.enable: 0
dev.ti_adc.0.ain.4.open_delay: 0
dev.ti_adc.0.ain.4.samples_avg: 0
dev.ti_adc.0.ain.4.input: 0
dev.ti_adc.0.ain.5.enable: 0
dev.ti_adc.0.ain.5.open_delay: 0
dev.ti_adc.0.ain.5.samples_avg: 0
dev.ti_adc.0.ain.5.input: 0
dev.ti_adc.0.ain.6.enable: 1
dev.ti_adc.0.ain.6.open_delay: 0
dev.ti_adc.0.ain.6.samples_avg: 4
dev.ti_adc.0.ain.6.input: 2308
dev.ti_adc.0.ain.7.enable: 1
dev.ti_adc.0.ain.7.open_delay: 0
dev.ti_adc.0.ain.7.samples_avg: 0
dev.ti_adc.0.ain.7.input: 3812
see how ain.6 and ain.7 are enabled with actual numbers in them? yeah. that's the good stuff. ๐
๐ธ the beaglebone-black tea ๐ธ
on Beaglebone-black, analog input 7 is connected to the 3V3B rail through a voltage divisor (2:1). the 3V3B voltage rail comes from the TL5209 LDO regulator, which is limited to 500mA maximum. so like, don't go wild pulling power out of that rail, bestie. it's giving "small but mighty" and we respect it. ๐
๐ global settings ๐
dev.ti_adc.0.clockdivโ sets the ADC clock prescaler. minimum is 10, maximum is 65535. the ADC clock isCLK_M_OSC (24Mhz) / clockdiv. so that gives you a maximum of ~2.4Mhz for the ADC clock, and ~10Khz for the default setting (clockdiv = 2400). math! slay. ๐งฎโจ
๐ settings per input ๐
dev.ti_adc.0.ain.%d.enableโ enables the conversion for the input. every single input has to be enabled individually before you can use it โ no shortcut, sorry. and when all the inputs are disabled, the whole ADC gets turned off. energy-saving king. ๐คdev.ti_adc.0.ain.%d.open_delayโ sets the number of ADC clock cycles to wait after applying the input configuration and before starting the ADC conversion. it's the little "gimme a sec to get ready" pause. ๐ซถdev.ti_adc.0.ain.%d.samples_avgโ sets the number of samples average used on each input. it can be set to0(no samples average),2,4,8, or16. average it out, bestie. ๐dev.ti_adc.0.ain.%d.inputโ is the converted raw value of the voltage applied on the analog input. it's made of a 12 bit value (0~4095). so like, 0 to 4095. that's the range. periodt. ๐ฅ
๐ SEE ALSO ๐
go read that one too, it's the whole reason any of this works. ๐ญ
๐ HISTORY ๐
the ti_adc driver first appeared in FreeBSD 10.1. a little vintage moment. we love a classic. โญ
๐ง AUTHORS ๐ง
the driver and this manual page was written by Luiz Otavio O Souza <loos@FreeBSD.org>. thank you king, we appreciate you. ๐๐
okay that's the whole thing!! this page is from Debian, dated June 1, 2014 โ shoutout to the arm Kernel Interfaces Manual for hosting. go read your sensors, bestie, and remember: enable your inputs individually or the ADC simply will not talk to you. ๐
โจ๐ฆ
๐ฆ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2014 Luiz Otavio O Souza <loos@freebsd.org>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms