
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_ErrCode_t STALS_GetChannelColor (void *pHandle, enum STALS_Channel_Id_t ChannelId, enum
STALS_Color_Id_t *pColor)
This function returns the color filter of the provided channel identifier.
• STALS_ErrCode_t STALS_SetExposureTime (void *pHandle, uint32_t ExpoTimeInUs, uint32_t *pApplied
ExpoTimeUs)
This function sets the exposure time into the device, after having tuned to the closest value that the device
can support.
• STALS_ErrCode_t STALS_GetExposureTime (void *pHandle, uint32_t *pAppliedExpoTimeUs)
This function returns the actual exposure time.
• STALS_ErrCode_t STALS_SetInterMeasurementTime (void *pHandle, uint32_t InterMeasurmentInUs,
uint32_t *pAppliedInterMeasurmentInUs)
This function sets an inter measurement time into the device, after having tuned to the closest value that the
device can support.
• STALS_ErrCode_t STALS_GetInterMeasurementTime (void *pHandle, uint32_t *pAppliedInter
MeasurmentInUs)
This function returns the actual inter measurement.
• STALS_ErrCode_t STALS_GetProductVersion (void *pHandle, uint8_t *pDeviceID, uint8_t *pRevisionID)
This function returns the version of the device.
• STALS_ErrCode_t STALS_SetGain (void *pHandle, enum STALS_Channel_Id_t ChannelId, uint16_t Gain,
uint16_t *pAppliedGain)
This function sets an analog gain on the provided channel id.
• 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.
• STALS_ErrCode_t STALS_SetFlickerOutputType (void *pHandle, enum STALS_FlickerOutputType_t
FlickerOutputType)
This function sets the GPIO settings for GPIO2 and GPIO1 according to FlickerOutputType.
• STALS_ErrCode_t STALS_Start (void *pHandle, enum STALS_Mode_t Mode, uint8_t Channels)
This function starts the device.
• STALS_ErrCode_t STALS_Stop (void *pHandle, enum STALS_Mode_t Mode)
This function stops the device.
• STALS_ErrCode_t STALS_GetAlsValues (void *pHandle, uint8_t Channels, struct STALS_Als_t *pAlsValue,
uint8_t *pMeasureValid)
This function provides the event counts values for the selected channels.
• STALS_ErrCode_t STALS_GetFlickerFrequency (void *pHandle, struct STALS_FlickerInfo_t *pFlickerInfo)
This function gets the flicker main harmonic frequency.
• 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.
• STALS_ErrCode_t STALS_GetControl (void *pHandle, enum STALS_Control_Id_t ControlId, uint32_t
*pControlValue)
This function gets a control from the STALS driver.
• STALS_ErrCode_t STALS_GetUid (void * pHandle, char *pUid)
This function returns the device unique id.
UM2878
STALS.h file reference
UM2878 - Rev 1 page 17/27