Skip to content

Commit d35099d

Browse files
it-klingerjic23
authored andcommitted
iio: sgp40: retain documentation in driver
Retain documentation on how the voc index is actually calculated in driver code as it'll be removed in Documentation. This is a follow up on patch "[PATCH] iio: ABI: remove duplicate in_resistance_calibbias" from David. Signed-off-by: Andreas Klinger <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 6bcffdd commit d35099d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/iio/chemical/sgp40.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
* 1) read raw logarithmic resistance value from sensor
1515
* --> useful to pass it to the algorithm of the sensor vendor for
1616
* measuring deteriorations and improvements of air quality.
17+
* It can be read from the attribute in_resistance_raw.
1718
*
18-
* 2) calculate an estimated absolute voc index (0 - 500 index points) for
19-
* measuring the air quality.
19+
* 2) calculate an estimated absolute voc index (in_concentration_input)
20+
* with 0 - 500 index points) for measuring the air quality.
2021
* For this purpose the value of the resistance for which the voc index
21-
* will be 250 can be set up using calibbias.
22+
* will be 250 can be set up using in_resistance_calibbias (default 30000).
23+
*
24+
* The voc index is calculated as:
25+
* x = (in_resistance_raw - in_resistance_calibbias) * 0.65
26+
* in_concentration_input = 500 / (1 + e^x)
2227
*
2328
* Compensation values of relative humidity and temperature can be set up
2429
* by writing to the out values of temp and humidityrelative.

0 commit comments

Comments
 (0)