Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
|
Vishay VEML6031 High Accuracy Ambient Light Sensor. More...
Files | |
file | veml6031.h |
Header file for extended sensor API of VEML6031 sensor. |
Vishay VEML6031 High Accuracy Ambient Light Sensor.
#include <zephyr/drivers/sensor/veml6031.h>
Custom sensor attributes for VEML6031 sensor.
For high and low threshold window settings (ALS_WH_L, ALS_WH_H, ALS_WL_L and ALS_WL_H) use the generic attributes SENSOR_ATTR_UPPER_THRESH and SENSOR_ATTR_LOWER_THRESH with 16-bit unsigned integer values. Both threshold settings are in lux and converted by the driver to a value compatible with the sensor. This conversion depends on the current gain, integration time and effective photodiode size settings. So a change in gain, integration time or effective photodiode size usually requires an update of threshold window settings. To get the correct threshold values into the sensor update the thresholds -after- a change of gain or integration time.
All attributes must be set for the SENSOR_CHAN_LIGHT channel.
When the sensor goes into saturation -E2BIG
is returned. This happens when the maximum value 0xFFFF is returned as raw ALS value. In this case it's up to the user to reduce one or more of the following attributes to come back into the optimal measurement range of the sensor:
Enumerator | |
---|---|
SENSOR_ATTR_VEML6031_IT | Integration time setting for ALS measurements (IT). Use enum veml6031_it for attribute values. |
SENSOR_ATTR_VEML6031_DIV4 | Effective photodiode size (DIV4) Use enum veml6031_div4 for attribute values. |
SENSOR_ATTR_VEML6031_GAIN | Gain setting for ALS measurements (GAIN). Use enum veml6031_gain for attribute values. |
SENSOR_ATTR_VEML6031_PERS | ALS persistence protect number setting (PERS). Use enum veml6031_pers for attribute values. |
#include <zephyr/drivers/sensor/veml6031.h>
Custom sensor channels for VEML6031 sensor.
Enumerator | |
---|---|
SENSOR_CHAN_VEML6031_ALS_RAW_COUNTS | Channel for raw ALS sensor values. This channel represents the raw measurement counts provided by the sensor ALS register. It is useful for estimating good values for integration time, effective photodiode size and gain attributes in fetch and get mode. For future implementations with triggers it can also be used to estimate the threshold window attributes for the sensor interrupt handling. It cannot be fetched directly. Instead, this channel's value is fetched implicitly using SENSOR_CHAN_LIGHT. Trying to call sensor_sample_fetch_chan with this enumerator as an argument will result in a |
SENSOR_CHAN_VEML6031_IR_RAW_COUNTS | Channel for IR sensor values. This channel is the raw IR Channel count output of the sensor. About fetching the same as for SENSOR_CHAN_VEML6031_ALS_RAW_COUNTS applies. |
enum veml6031_div4 |
#include <zephyr/drivers/sensor/veml6031.h>
VEML6031 size options for ambient light measurements.
Possible values for SENSOR_ATTR_VEML6031_DIV4 custom attribute.
Enumerator | |
---|---|
VEML6031_SIZE_4_4 | 4/4 photodiode size |
VEML6031_SIZE_1_4 | 1/4 photodiode size |
enum veml6031_gain |
#include <zephyr/drivers/sensor/veml6031.h>
VEML6031 gain options for ambient light measurements.
Enumerator | |
---|---|
VEML6031_GAIN_1 | 1x gain |
VEML6031_GAIN_2 | 2x gain |
VEML6031_GAIN_0_66 | 0.66x gain |
VEML6031_GAIN_0_5 | 0.5x gain |
enum veml6031_it |
#include <zephyr/drivers/sensor/veml6031.h>
VEML6031 integration time options for ambient light measurements.
Possible values for SENSOR_ATTR_VEML6031_IT custom attribute.
Enumerator | |
---|---|
VEML6031_IT_3_125 | 3.125 ms |
VEML6031_IT_6_25 | 6.25 ms |
VEML6031_IT_12_5 | 12.5 ms |
VEML6031_IT_25 | 25 ms |
VEML6031_IT_50 | 50 ms |
VEML6031_IT_100 | 100 ms |
VEML6031_IT_200 | 200 ms |
VEML6031_IT_400 | 400 ms |
enum veml6031_pers |
#include <zephyr/drivers/sensor/veml6031.h>
VEML6031 ALS interrupt persistence protect number options.
Possible values for SENSOR_ATTR_VEML6031_PERS custom attribute.
Enumerator | |
---|---|
VEML6031_PERS_1 | 1 measurement |
VEML6031_PERS_2 | 2 measurements |
VEML6031_PERS_4 | 4 measurements |
VEML6031_PERS_8 | 8 measurements |