Skip to content

Commit

Permalink
Sensor: VCNL4040: Update to lux/step constants
Browse files Browse the repository at this point in the history
Right now, the driver uses the lux/step constants from the datasheet
https://www.vishay.com/docs/84307/designingvcnl4040.pdf
However, the newest datasheet from 2024
indicates that the lux/step have changed (page 12)
https://www.vishay.com/docs/84274/vcnl4040.pdf

Signed-off-by: Emilio Aguila Escalante <emilio.aguila@hotmail.com>
  • Loading branch information
Audifaz authored and kartben committed Jan 9, 2025
1 parent 1201c24 commit 4c9b6b6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/sensor/vishay/vcnl4040/vcnl4040.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,21 @@ static int vcnl4040_reg_setup(const struct device *dev)

/*
* scale the lux depending on the value of the integration time
* see page 8 of the VCNL4040 application note:
* https://www.vishay.com/docs/84307/designingvcnl4040.pdf
* see page 12 of the VCNL4040 application note:
* https://www.vishay.com/docs/84274/vcnl4040.pdf
*/
switch (config->als_it) {
case VCNL4040_AMBIENT_INTEGRATION_TIME_80MS:
data->sensitivity = 0.12;
data->sensitivity = 0.1;
break;
case VCNL4040_AMBIENT_INTEGRATION_TIME_160MS:
data->sensitivity = 0.06;
data->sensitivity = 0.05;
break;
case VCNL4040_AMBIENT_INTEGRATION_TIME_320MS:
data->sensitivity = 0.03;
data->sensitivity = 0.025;
break;
case VCNL4040_AMBIENT_INTEGRATION_TIME_640MS:
data->sensitivity = 0.015;
data->sensitivity = 0.0125;
break;
default:
data->sensitivity = 1.0;
Expand Down

0 comments on commit 4c9b6b6

Please sign in to comment.