Sens'it SDK  v2.0.0
Functions
LTR329 APIs

Light sensor sample code functions. More...

Functions

error_t LTR329_init (void)
 Configure sensor with measurement rate of 2s & integration time of 50ms.
Sensor is in stand-by mode. More...
 
error_t LTR329_set_standby_mode (void)
 Put sensor in stand-by mode. More...
 
error_t LTR329_set_active_mode (ltr329_gain_e gain)
 Put sensor in active mode & configure sensor gain. More...
 
error_t LTR329_measure (u16 *light_ch0, u16 *light_ch1)
 Get a light measurement.
Values must be divided by the configured gain to convert it in lux. More...
 

Detailed Description

Light sensor sample code functions.


Function Documentation

◆ LTR329_init()

error_t LTR329_init ( void  )

Configure sensor with measurement rate of 2s & integration time of 50ms.
Sensor is in stand-by mode.


Return values
LTR329_ERR_NONENo error
LTR329_ERR_I2CError on I2C communication
LTR329_ERR_IDBad ID value

◆ LTR329_set_standby_mode()

error_t LTR329_set_standby_mode ( void  )

Put sensor in stand-by mode.


Return values
LTR329_ERR_NONENo error
LTR329_ERR_I2CError on I2C communication

◆ LTR329_set_active_mode()

error_t LTR329_set_active_mode ( ltr329_gain_e  gain)

Put sensor in active mode & configure sensor gain.


Parameters
[in]gainLight measurement gain
Return values
LTR329_ERR_NONENo error
LTR329_ERR_I2CError on I2C communication
LTR329_ERR_GAINGain has an invalid value

◆ LTR329_measure()

error_t LTR329_measure ( u16 light_ch0,
u16 light_ch1 
)

Get a light measurement.
Values must be divided by the configured gain to convert it in lux.


Parameters
[out]light_ch0Light level on channel 0 (visible)
[out]light_ch1Light level on channel 1 (infrared)
Return values
LTR329_ERR_NONENo error
LTR329_ERR_I2CError on I2C communication
LTR329_ERR_MEASURE_TIMEOUTError, measurement is too long