/********************************************************************************
|
* Copyright: (C) 2019 LingYun IoT System Studio
|
* All rights reserved.
|
*
|
* Filename: tsl2561.h
|
* Description: This head file is the Lux sensor TSL2561 API functions on RaspberryPi
|
*
|
* Version: 1.0.0(04/07/19)
|
* Author: Guo Wenxue <guowenxue@gmail.com>
|
* ChangeLog: 1, Release initial version on "04/07/19 17:42:35"
|
*
|
********************************************************************************/
|
|
#ifndef _TSL2561_H_
|
#define _TSL2561_H_
|
|
#define TSL2561_I2C_ADDR 0x39
|
|
#define CONTROL_REG 0x80
|
#define REG_COUNT 4
|
|
#define POWER_UP 0x03
|
#define POWER_DOWN 0x00
|
|
/* Register Address */
|
enum
|
{
|
/* Channel_0 = DATA0HIGH<<8 + DATA0LOW */
|
DATA0LOW = 0x8C,
|
DATA0HIGH,
|
|
/* Channel_1 = DATA1HIGH<<8 + DATA1LOW */
|
DATA1LOW,
|
DATA1HIGH,
|
};
|
|
extern int tsl2561_init(void);
|
extern void tsl2561_term(void);
|
extern float tsl2561_get_lux(void);
|
|
#endif /* ----- #ifndef _TSL2561_H_ ----- */
|