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
Mode shall be STALS_MODE_ALS_SINGLE_SHOT,
STALS_MODE_ALS_SYNCHRONOUS or STALS_MODE_FLICKER. See
Section 3.5.6 enum STALS_Mode_t
Channels
For the ALS modes, this is an OR value of the STALS_Channel_Id_t channels. For
the flicker mode, this is one of the STALS_Channel_Id_t channels.
Note: As the ALS and FLICKER modes can run independently, two consecutive calls to this START function with
STALS_MODE_ALS_SYNCHRONOUS and STALS_MODE_FLICKER modes are permitted.
Example to activate RGB channel:
void *hdl;
...
STALS_Start (hdl, STALS_MODE_ALS_SINGLE_SHOT, STALS_CHANNEL_1 | STALS_CHANNEL_3 |
STALS_CHANNEL_4)
3.2.15 STALS_ErrCode_t STALS_Stop
STALS_ErrCode_t STALS_Stop (void *pHandle, enum STALS_Mode_t Mode )
This function stops the device.
Table 28. Parameters
Parameter Description
pHandle Opaque pointer used as the id of the instance of the driver
Mode
Mode shall be STALS_MODE_ALS_SINGLE_SHOT,
STALS_MODE_ALS_SYNCHRONOUS or STALS_MODE_FLICKER. See
Section 3.5.6 enum STALS_Mode_t
Table 29. Return values
Return value Description
STALS_NO_ERROR Success
STALS_ERROR_INVALID_PARAMS At least one of the provided parameters to the function is invalid
STALS_ALREADY_NOT_STARTED The device is not running the provided mode
STALS_ERROR_WRITE Could not write any data in the device through I2C
UM2878
STALS API definition
UM2878 - Rev 1
page 13/27