3.3 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.
3.3.2 Macros
• #define STALS_ALS_MAX_CHANNELS 6
3.3.3 Enumerations
• enum STALS_Channel_Id_t {
STALS_CHANNEL_1 = 0x01, STALS_CHANNEL_2 = 0x02, STALS_CHANNEL_3 = 0x04,
STALS_CHANNEL_4 = 0x08, STALS_CHANNEL_5 = 0x10, STALS_CHANNEL_6 = 0x20 }
Constants listing the channels of the device.
• enum STALS_Color_Id_t {
STALS_COLOR_IR = 0x01, STALS_COLOR_RED = 0x02, STALS_COLOR_GREEN = 0x03,
STALS_COLOR_BLUE = 0x04, STALS_COLOR_UV = 0x05, STALS_COLOR_CLEAR = 0x06,
STALS_COLOR_CLEAR_IR_CUT = 0x07, STALS_COLOR_DARK = 0x08, STALS_COLOR_INVALID =
0xFF }
Constants listing the color light.
• enum STALS_ErrCode_t {
STALS_NO_ERROR = 0, STALS_ERROR_INVALID_PARAMS, STALS_ERROR_INIT,
STALS_ERROR_TIME_OUT, STALS_ERROR_INVALID_DEVICE_ID, STALS_ERROR_WRITE,
STALS_ERROR_READ, STALS_ERROR_ALREADY_STARTED, STALS_ERROR_NOT_STARTED,
STALS_ERROR_NOT_SUPPORTED, STALS_ERROR_FNCT_DEPRECATED,
STALS_ERROR_LAST_ERROR_CODE }
This enumeration is aimed at defining the different errors that can be returned by the STALS driver.
• enum STALS_Control_t { STALS_CONTROL_DISABLE = 0, STALS_CONTROL_ENABLE = 1 }
This enumeration is aimed at defining the Enable and disable flags.
• enum STALS_Control_Id_t {
STALS_PEDESTAL_ENABLE = 0, STALS_PEDESTAL_VALUE = 1, STALS_OUTPUT_DARK_ENABLE = 3,
STALS_SDA_DRIVE_VALUE_MA = 4, STALS_SATURATION_VALUE = 5, STALS_ALS_AUTOGAIN_CTRL
= 6, STALS_OTP_USAGE_ENABLE = 128, STALS_WA_STATE = 129 }
This enumeration is aimed at defining the different parameters identifiers.
• enum STALS_Mode_t { STALS_MODE_ALS_SINGLE_SHOT = 0, STALS_MODE_ALS_SYNCHRONOUS=
1, STALS_MODE_FLICKER = 2 }
This enumeration is aimed at defining the different behavior modes of the STALS device.
• enum STALS_FlickerOutputType_t {
STALS_FLICKER_OUTPUT_ANALOG = 0, STALS_FLICKER_OUTPUT_ANALOG_CFG_1 = 0,
STALS_FLICKER_OUTPUT_DIGITAL_PDM = 1, STALS_FLICKER_OUTPUT_ANALOG_CFG_2 = 2,
STALS_FLICKER_OUTPUT_ZC_CFG_1 = 3, STALS_FLICKER_OUTPUT_ZC_CFG_2 = 4 }
UM2878
STALS.h file reference
UM2878 - Rev 1
page 16/27