vcnl36825t: allow "force"-mode only if low-power mode is inactive

Behavior of "force"-mode as described in datasheet cannot be achieved if
low-power mode is enabled. After triggering a sampling, the sensor will
not sample again for the period specified in measurement-time.

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
This commit is contained in:
Juliane Schulze 2024-05-27 16:17:26 +02:00 committed by Carles Cufí
commit 90d8941b54
2 changed files with 5 additions and 0 deletions

View file

@ -454,6 +454,9 @@ static const struct sensor_driver_api vcnl36825t_driver_api = {
DT_INST_PROP(inst, low_power) || (DT_INST_PROP(inst, measurement_period) <= \ DT_INST_PROP(inst, low_power) || (DT_INST_PROP(inst, measurement_period) <= \
VCNL36825T_PS_PERIOD_VALUE_MAX_MS), \ VCNL36825T_PS_PERIOD_VALUE_MAX_MS), \
"measurement-period must be less/equal 80 ms with deactivated low-power mode"); \ "measurement-period must be less/equal 80 ms with deactivated low-power mode"); \
BUILD_ASSERT(!DT_INST_PROP(inst, low_power) || (DT_INST_ENUM_IDX(inst, operation_mode) == \
VCNL36825T_OPERATION_MODE_AUTO), \
"operation-mode \"force\" only available if low-power mode deactivated"); \
static struct vcnl36825t_data vcnl36825t_data_##inst; \ static struct vcnl36825t_data vcnl36825t_data_##inst; \
static const struct vcnl36825t_config vcnl36825t_config_##inst = { \ static const struct vcnl36825t_config vcnl36825t_config_##inst = { \
.i2c = I2C_DT_SPEC_INST_GET(inst), \ .i2c = I2C_DT_SPEC_INST_GET(inst), \

View file

@ -21,6 +21,8 @@ properties:
Defaults to sensor reset value. Defaults to sensor reset value.
Note: "force"-mode only available if low-power mode inactive.
measurement-period: measurement-period:
type: int type: int
default: 40 default: 40