Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
veml6031.h File Reference

Go to the source code of this file.

Macros

#define VEML6031_IT_COUNT   8
 ALS integration time settings in veml6031_it.
 
#define VEML6031_DIV4_COUNT   2
 Effective photodiode size in enum veml6031_size.
 
#define VEML6031_GAIN_COUNT   4
 Gain selections in enum veml6031_gain.
 

Enumerations

enum  veml6031_it {
  VEML6031_IT_3_125 , VEML6031_IT_6_25 , VEML6031_IT_12_5 , VEML6031_IT_25 ,
  VEML6031_IT_50 , VEML6031_IT_100 , VEML6031_IT_200 , VEML6031_IT_400
}
 VEML6031 integration time options for ambient light measurements. More...
 
enum  veml6031_div4 { VEML6031_SIZE_4_4 = 0x00 , VEML6031_SIZE_1_4 = 0x01 }
 VEML6031 size options for ambient light measurements. More...
 
enum  veml6031_gain { VEML6031_GAIN_1 = 0x00 , VEML6031_GAIN_2 = 0x01 , VEML6031_GAIN_0_66 = 0x02 , VEML6031_GAIN_0_5 = 0x03 }
 VEML6031 gain options for ambient light measurements. More...
 
enum  veml6031_pers { VEML6031_PERS_1 = 0x00 , VEML6031_PERS_2 = 0x01 , VEML6031_PERS_4 = 0x02 , VEML6031_PERS_8 = 0x03 }
 VEML6031 ALS interrupt persistence protect number options. More...
 
enum  sensor_attribute_veml6031 { SENSOR_ATTR_VEML6031_IT = SENSOR_ATTR_PRIV_START , SENSOR_ATTR_VEML6031_DIV4 , SENSOR_ATTR_VEML6031_GAIN , SENSOR_ATTR_VEML6031_PERS }
 VEML6031 specific sensor attributes. More...
 
enum  sensor_channel_veml6031 { SENSOR_CHAN_VEML6031_ALS_RAW_COUNTS = SENSOR_CHAN_PRIV_START , SENSOR_CHAN_VEML6031_IR_RAW_COUNTS }
 VEML6031 specific sensor channels. More...
 

Macro Definition Documentation

◆ VEML6031_DIV4_COUNT

#define VEML6031_DIV4_COUNT   2

Effective photodiode size in enum veml6031_size.

◆ VEML6031_GAIN_COUNT

#define VEML6031_GAIN_COUNT   4

Gain selections in enum veml6031_gain.

◆ VEML6031_IT_COUNT

#define VEML6031_IT_COUNT   8

ALS integration time settings in veml6031_it.

Enumeration Type Documentation

◆ sensor_attribute_veml6031

VEML6031 specific sensor attributes.

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: SENSOR_ATTR_VEML6031_GAIN (gain) SENSOR_ATTR_VEML6031_IT (integration time) SENSOR_ATTR_VEML6031_DIV4 (effective photodiode size)

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.

◆ sensor_channel_veml6031

VEML6031 specific sensor channels.

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_channel_fetch_chan() with this enumerator as an argument will result in a -ENOTSUP.

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.

◆ veml6031_div4

VEML6031 size options for ambient light measurements.

Enumerator
VEML6031_SIZE_4_4 
VEML6031_SIZE_1_4 

◆ veml6031_gain

VEML6031 gain options for ambient light measurements.

Enumerator
VEML6031_GAIN_1 
VEML6031_GAIN_2 
VEML6031_GAIN_0_66 
VEML6031_GAIN_0_5 

◆ veml6031_it

VEML6031 integration time options for ambient light measurements.

Enumerator
VEML6031_IT_3_125 
VEML6031_IT_6_25 
VEML6031_IT_12_5 
VEML6031_IT_25 
VEML6031_IT_50 
VEML6031_IT_100 
VEML6031_IT_200 
VEML6031_IT_400 

◆ veml6031_pers

VEML6031 ALS interrupt persistence protect number options.

Enumerator
VEML6031_PERS_1 
VEML6031_PERS_2 
VEML6031_PERS_4 
VEML6031_PERS_8