TSL2568, TSL2569
LIGHT-TO-DIGITAL CONVERTER
TAOS091D  DECEMBER 2008
24
r
r
Copyright E 2008, TAOS Inc.
The LUMENOLOGY r Company
www.taosinc.com
// lux equation approximation without floating point calculations
//////////////////////////////////////////////////////////////////////////////
// Routine: unsigned int CalculateLux(unsigned int ch0, unsigned int ch0, int iType)
//
// Description: Calculate the approximate illuminance (lux) given the raw
//
channel values of the TSL2568. The equation if implemented
//
as a piecewise linear approximation.
//
// Arguments: unsigned int iGain  gain, where 0:1X, 1:16X
//
unsigned int tInt  integration time, where 0:13.7mS, 1:100mS, 2:402mS,
//
3:Manual
//
unsigned int ch0  raw channel value from channel 0 of TSL2568
//
unsigned int ch1  raw channel value from channel 1 of TSL2568
//
unsigned int iType  package type (0:T, 1:CS)
//
// Return:
unsigned int  the approximate illuminance (lux)
//
//////////////////////////////////////////////////////////////////////////////
unsigned int CalculateLux(unsigned int iGain, unsigned int tInt, unsigned int ch0,
unsigned int ch1, int iType)
{
//
// first, scale the channel values depending on the gain and integration time
// 16X, 402mS is nominal.
// scale if integration time is NOT 402 msec
unsigned long chScale;
unsigned long channel1;
unsigned long channel0;
switch (tInt)
{
case 0:
// 13.7 msec
chScale = CHSCALE_TINT0;
break;
case 1:
// 101 msec
chScale = CHSCALE_TINT1;
break;
default:
// assume no scaling
chScale = (1 << CH_SCALE);
break;
}
// scale if gain is NOT 16X
if (!iGain) chScale = chScale << 4;
// scale 1X to 16X
// scale the channel values
channel0 = (ch0 * chScale) >> CH_SCALE;
channel1 = (ch1 * chScale) >> CH_SCALE;
//
// find the ratio of the channel values (Channel1/Channel0)
// protect against divide by zero
unsigned long ratio1 = 0;
if (channel0 != 0) ratio1 = (channel1 << (RATIO_SCALE+1)) / channel0;
// round the ratio value
unsigned long ratio = (ratio1 + 1) >> 1;
// is ratio <= eachBreak ?
unsigned int b, m;
相关PDF资料
TSL257SM-LF IC LIGHT-VOLTAGE SMD SIDELOOKER
TSL260R-LF IC IR LIGHT-VOLT CONV SIDELOOKER
TSL260RSM-LF IC IR LIGHT-VOLT CONV SMD SIDELK
TSL3301CL IC LINEAR SENSOR ARRAY 8CHIPLED
TXM-418-LR_ TRANSMITTER 418MHZ LR SERIES
TXM-900-HP3-SPS TRANSMTR RF 902-928MHZ 8P/100S
VJ3505M011SXMSRA0 ANTENNA 470-860MHZ UHF SMD
VJ5301M868MXBSR RF ANTENNA
相关代理商/技术参数
TSL256Y WAF 制造商:Texas Instruments 功能描述:
TSL257 制造商:TAOS 制造商全称:TEXAS ADVANCED OPTOELECTRONIC SOLUTIONS 功能描述:HIGH-SENSITIVITY LIGHT-TO-VOLTAGE CONVERTER
TSL2571 制造商:TAOS 制造商全称:TEXAS ADVANCED OPTOELECTRONIC SOLUTIONS 功能描述:LIGHT-TO-DIGITAL CONVERTER
TSL2571 EVM 功能描述:光学传感器开发工具 Evaluation Module TSL2571x RoHS:否 制造商:ams 工具用于评估: 接口类型: 最大工作温度:
TSL25711 制造商:TAOS 制造商全称:TEXAS ADVANCED OPTOELECTRONIC SOLUTIONS 功能描述:LIGHT-TO-DIGITAL CONVERTER
TSL25711FN 功能描述:光学数位转换器 Light to Digital I2C I/F RoHS:否 制造商:ams 数据总线宽度: 峰值波长:470 nm 最大工作频率: 工作电源电压: 工作电流: 最大工作温度:+ 85 C 最小工作温度:- 40 C 封装 / 箱体:Chipscale-6 封装:Reel
TSL25711FN-CUT TAPE 制造商:AMS 功能描述:TSL25771 Series 850 nm Light to Digital Converter w/ Proximity Sensing - 3 Pin
TSL25713 制造商:TAOS 制造商全称:TEXAS ADVANCED OPTOELECTRONIC SOLUTIONS 功能描述:LIGHT-TO-DIGITAL CONVERTER