Commit 3e87d89
committed
iio: adc: at91-sama5d2_adc: add support for temperature sensor
SAMA7G5 has a temperature sensor embedded that is connected to channel 31
of ADC. Temperature sensor provides 2 outputs: VTEMP and VBG. VTEMP is
proportional to the absolute temperature voltage, VBG is quasi-temperature
independent voltage. The calibration data for temperature sensor are
retrieved from OTP memory specific to SAMA7G5. The formula to calculate
the junction temperature is as follows:
OTP_T3 + (Vref * (Vtemp - OTP_VBG2 - OTP_Vtemp * Vbg)) /
(offset * OTP_Vbg2)
where OTP_* are calibration data retrieved from OTP memory.
For better resolution before reading the temperature certain settings
for oversampling ratio, sample frequency, EMR.TRACKX, MR.TRACKTIM are
applied. The initial settings are reverted at the end of temperature
reading. Current support is not integrated with trigger buffers.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>1 parent b55d081 commit 3e87d89
1 file changed
Lines changed: 249 additions & 5 deletions
0 commit comments