RaspberrPi project source code
Guo Wenxue
6 days ago f7889e2ceddbc3e15ea4b5377d831f4432169f76
commit | author | age
e30a4c 1 /********************************************************************************
GW 2  *      Copyright:  (C) 2019 LingYun IoT System Studio
3  *                  All rights reserved.
4  *
5  *       Filename:  tsl2561.h
6  *    Description:  This head file is the Lux sensor TSL2561 API functions on RaspberryPi
7  *
8  *        Version:  1.0.0(04/07/19)
9  *         Author:  Guo Wenxue <guowenxue@gmail.com>
10  *      ChangeLog:  1, Release initial version on "04/07/19 17:42:35"
11  *
12  ********************************************************************************/
13
14 #ifndef  _TSL2561_H_
15 #define  _TSL2561_H_
16
17 #define TSL2561_I2C_ADDR                0x39
18
19 #define CONTROL_REG                     0x80
20 #define REG_COUNT                       4
21
22 #define POWER_UP                        0x03
23 #define POWER_DOWN                      0x00
24
25 /* Register Address  */
26 enum
27 {
28     /* Channel_0 = DATA0HIGH<<8 + DATA0LOW */
29     DATA0LOW = 0x8C,
30     DATA0HIGH,
31
32     /* Channel_1 = DATA1HIGH<<8 + DATA1LOW */
33     DATA1LOW,
34     DATA1HIGH,
35 };
36
37 extern int tsl2561_init(void);
38 extern void tsl2561_term(void);
39 extern float tsl2561_get_lux(void);
40
41 #endif   /* ----- #ifndef _TSL2561_H_  ----- */
42