Commit 4c9b6b6f authored by Emilio Aguila Escalante's avatar Emilio Aguila Escalante Committed by Benjamin Cabé
Browse files

Sensor: VCNL4040: Update to lux/step constants

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: default avatarEmilio Aguila Escalante <emilio.aguila@hotmail.com>
parent 1201c240
Loading
Loading
Loading
Loading
+6 −6
Changes for drivers/sensor/vishay/vcnl4040/vcnl4040.c: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -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;