Page 1
Introduction VD6283 is an ambient light sensor with a flicker extraction engine. The purpose of this user manual is to describe the integration model and the set of functions to use the VD6283 bare driver. References • UM2867 - Getting started with the STMicroelectronics X-CUBE-ALS software package for STM32CubeMX •...
This driver is OS agnostic, meaning that it can be integrated in a SW stack of any customer platform without any modification. The bare driver is an implementation of a set of functions required to use the VD6283 device. It makes minimal assumptions on the OS integration and services. As such, sequencing of actions, execution/threading model, platform adaptation, and device structure allocation are not part of the bare driver implementation but left open to the integrator.
UM2878 Description of modes Description of modes The VD6383 device supports several modes that are described in the following diagrams. The diagrams in the following sections show two channels, blue and red, enabled as an example to describe the device behavior. Synchronous mode without intermeasurement period The following diagram shows how to use the bare driver to collect light count values in synchronous mode without any intermeasurement.
UM2878 Synchronous gated mode with intermeasurement period Synchronous gated mode with intermeasurement period The following diagram shows how to use the bare driver to collect light count values in synchronous mode with an intermeasurment period. Figure 3. Bare driver signals with intermeasurement period UM2878 - Rev 1 page 4/27...
UM2878 Single shot Single shot The following diagram shows how to use the bare driver to collect light count values in a single shot mode. Figure 4. Bare driver signals in single shot UM2878 - Rev 1 page 5/27...
Figure 5. Power modes STALS API definition 3.2.1 STALS_ErrCode_t STALS_GetVersion STALS_ErrCode_t STALS_GetVersion (uint32_t *pVersion, uint32_t *pRevision) This function provides the driver version of the VD6283. Table 1. Parameters Parameter Description pVersion Pointer on a value that contains the version of the driver once this function is called...
I2C address shall be performed with this I2C slave address. A call to the STALS_Init function shall be done to set the VD6283 device in IDLE mode. The VD6283 device needs a delay between powering it and calling STALS_Init. Please refer to the device user manual for more details.
Note that a fixed readout period of ~6 ms takes place just after exposure time. This is needed by the device to set the event count values in the registers. It also returns the actual applied value in the device. For VD6283 possible values are multiples of 1.6 ms with a range of 1.6 ms to 1.6 s. Note: Exposure time is irrelevant for flicker detection.
UM2878 STALS API definition 3.2.6 STALS_ErrCode_t STALS_GetExposureTime STALS_ErrCode_t STALS_GetExposureTime (void *pHandle, uint32_t *pAppliedExpoTimeUs) This function returns the actual exposure time. Table 11. Parameters Parameters Description pHandle Opaque pointer used as the id of the instance of the driver pAppliedExpoTimeUs Pointer in which the value of the actual exposure time is returned Table 12.
UM2878 STALS API definition 3.2.8 STALS_ErrCode_t STALS_GetInterMeasurementTime STALS_ErrCode_t STALS_GetInterMeasurementTime (void *pHandle, uint32_t *pAppliedInterMeasurmentInUs) This function returns the actual intermeasurement. Table 15. Parameters Parameter Description pHandle Opaque pointer used as the id of the instance of the driver pAppliedInterMeasurmentInUs Pointer in which the value of the actual intermeasurement time is returned Table 16.
UM2878 STALS API definition 3.2.10 STALS_ErrCode_t STALS_GetUid STALS_ErrCode_t STALS_GetUid (void *pHandle, char **pUid) This function returns the device unique id. Unique id is a null terminated string. Table 19. Parameters Parameter Description pHandle Opaque pointer used as the id of the instance of the driver pUid Pointer on a char pointer in which address of uid string will be set Table 20.
UM2878 STALS API definition 3.2.12 STALS_ErrCode_t STALS_GetGain STALS_ErrCode_t STALS_GetGain (void *pHandle, enum STALS_Channel_Id_t ChannelId, uint16_t *pAppliedGain) This function gets the actual gain applied in the device. Table 23. Parameters Parameter Description pHandle Opaque pointer used as the id of the instance of the driver ChannelId This id identifies the channel number.
UM2878 STALS API definition 3.2.14 STALS_ErrCode_t STALS_Start STALS_ErrCode_t STALS_Start (void *pHandle, enum STALS_Mode_t Mode, uint8_t Channels) This function starts the device. Table 27. Parameters Parameter Description pHandle Opaque pointer used as the id of the instance of the driver Mode shall be STALS_MODE_ALS_SINGLE_SHOT, Mode STALS_MODE_ALS_SYNCHRONOUS or STALS_MODE_FLICKER.
UM2878 STALS API definition 3.2.16 STALS_ErrCode_t STALS_GetAlsValues STALS_ErrCode_t STALS_GetAlsValues (void *pHandle, uint8_t Channels, struct STALS_Als_t *pAlsValue, uint8_t *pMeasureValid) This function provides the event count values for the selected channels. Table 30. Parameters Parameter Description pHandle Opaque pointer used as the id of the instance of the driver An OR value of the STALS_Channel_Id_t that sets the channels from which the Channels event count values are to be retrieved.
UM2878 STALS API definition 3.2.18 STALS_ErrCode_t STALS_SetControl STALS_ErrCode_t STALS_SetControl (void *pHandle, enum STALS_Control_Id_t ControlId, uint32_t ControlValue ) This function sets a control to the STALS driver. Table 34. Parameters Parameter Description pHandle Opaque pointer used as the id of the instance of the driver ControlId Identifier of the params.
UM2878 STALS.h file reference STALS.h file reference 3.3.1 Data structures • struct STALS_FlickerInfo_t This structure contains the fields filled by the driver and which contain the discovered information related to the flicker. • struct STALS_Als_t This structure defines the parameters which provide the event counts values of the last light integration, for the selected channels.
UM2878 STALS.h file reference 3.3.4 Functions • STALS_ErrCode_t STALS_Init (char *pDeviceName, void *pClient, void **pHandle) This function initializes the STALS driver. • STALS_ErrCode_t STALS_Term (void *pHandle) This function terminates the provided STALS driver instance. • STALS_ErrCode_t STALS_GetVersion (uint32_t *pVersion, uint32_t *pRevision) This function returns the bare driver version •...
STALS_COLOR_RED indicates color RED is set STALS_COLOR_GREEN indicates color GREEN is set STALS_COLOR_BLUE indicates color BLUE is set STALS_COLOR_UV indicates UV filter - not available on VD6283 STALS_COLOR_CLEAR indicates clear filter is set STALS_COLOR_CLEAR_IR_CUT indicates clear filter with ir cut is set...
STALS_PEDESTAL_VALUE Control to set the value of the pedestal For example : STALS_SetControl(pHandle, STALS_PEDESTAL_VALUE, 6); STALS_OUTPUT_DARK_ENABLE Control to set if dark is output. For VD6283 dark count will be output on channel 2. STALS_SDA_DRIVE_VALUE_MA Control to set drive current in sda pad in mA when device is driving sda line.
UM2878 Enumeration type documentation • use STALS_GetControl() to get wa status. pControlValue is then an in/out parameter. You call it with the wa for which you want to know state. On exit you read msb bit to know wa status. 3.5.6 enum STALS_Mode_t This enumeration is aimed at defining the different behavior modes of the STALS device.
Page 27
ST’s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers’...
Need help?
Do you have a question about the VD6283 and is the answer not in the manual?
Questions and answers