Sens'it SDK  v2.0.0
Macros | Enumerations | Functions
ltr329.h File Reference

Light sensor. More...

Go to the source code of this file.

Macros

#define LTR329_ALS_CONTR   0x80
 
#define LTR329_ALS_MEAS_RATE   0x85
 
#define LTR329_PART_ID   0x86
 
#define LTR329_MANUFAC_ID   0x87
 
#define LTR329_ALS_DATA_CH1_0   0x88
 
#define LTR329_ALS_DATA_CH1_1   0x89
 
#define LTR329_ALS_DATA_CH0_0   0x8A
 
#define LTR329_ALS_DATA_CH0_1   0x8B
 
#define LTR329_ALS_STATUS   0x8C
 
#define LTR329_ERR_NONE   0x00
 
#define LTR329_ERR_I2C   0x40
 
#define LTR329_ERR_ID   0x41
 
#define LTR329_ERR_GAIN   0x42
 
#define LTR329_ERR_MEASURE_TIMEOUT   0x43
 

Enumerations

enum  ltr329_gain_e {
  LTR329_GAIN_1X = 0b000, LTR329_GAIN_2X = 0b001, LTR329_GAIN_4X = 0b010, LTR329_GAIN_8X = 0b011,
  LTR329_GAIN_INVALID0 = 0b100, LTR329_GAIN_INVALID1 = 0b101, LTR329_GAIN_48X = 0b110, LTR329_GAIN_96X = 0b111,
  LTR329_GAIN_LAST
}
 Setting for light sensor gain. 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.


Author
Sens'it Team

This file provide sample code to use Light sensor (ref: LTR329ALS).
If you want to use other functionalities of the sensor, please refer to the datasheet: http://optoelectronics.liteon.com/upload/download/DS86-2014-0006/LTR-329ALS-01_DS_V1.pdf

Enumeration Type Documentation

◆ ltr329_gain_e

Setting for light sensor gain.


Enumerator
LTR329_GAIN_1X 

Gain x1 -> range: 1 lux to 64k lux

LTR329_GAIN_2X 

Gain x2 -> range: 0.5 lux to 32k lux

LTR329_GAIN_4X 

Gain x4 -> range: 0.25 lux to 16k lux

LTR329_GAIN_8X 

Gain x8 -> range: 0.125 lux to 8k lux

LTR329_GAIN_INVALID0 

Invalid gain value

LTR329_GAIN_INVALID1 

Invalid gain value

LTR329_GAIN_48X 

Gain x48 -> range: 0.02 lux to 1.3k lux

LTR329_GAIN_96X 

Gain x96 -> range: 0.01 lux to 600 lux