RaspberrPi project source code
Guo Wenxue
2024-12-29 e30a4c8103e221201e5bfc1e3f9b19e7a86f68d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/********************************************************************************
 *      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_  ----- */