Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
apds99xx_regs.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2018 Gunar Schorcht
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v2.1. See the file LICENSE in the top level
6
* directory for more details.
7
*/
8
17
#ifndef APDS99XX_REGS_H
18
#define APDS99XX_REGS_H
19
20
#ifdef __cplusplus
21
extern
"C"
22
{
23
#endif
24
29
#if MODULE_APDS9960
30
#define APDS99XX_REG_BASE (0x80)
31
#else
32
#define APDS99XX_REG_BASE (0xa0)
33
#endif
34
35
#define APDS99XX_REG_ENABLE (APDS99XX_REG_BASE + 0x00)
36
#define APDS99XX_REG_ATIME (APDS99XX_REG_BASE + 0x01)
37
#if MODULE_APDS9900 || MODULE_APDS9901 || MODULE_APDS9930
38
#define APDS99XX_REG_PTIME (APDS99XX_REG_BASE + 0x02)
39
#endif
40
#define APDS99XX_REG_WTIME (APDS99XX_REG_BASE + 0x03)
41
#define APDS99XX_REG_AILTL (APDS99XX_REG_BASE + 0x04)
42
#define APDS99XX_REG_AILTH (APDS99XX_REG_BASE + 0x05)
43
#define APDS99XX_REG_AIHTL (APDS99XX_REG_BASE + 0x06)
44
#define APDS99XX_REG_AIHTH (APDS99XX_REG_BASE + 0x07)
45
#if !MODULE_APDS9960
46
#define APDS99XX_REG_PILTL (APDS99XX_REG_BASE + 0x08)
47
#endif
48
#define APDS99XX_REG_PILTH (APDS99XX_REG_BASE + 0x09)
49
#if !MODULE_APDS9960
50
#define APDS99XX_REG_PIHTL (APDS99XX_REG_BASE + 0x0a)
51
#endif
52
#define APDS99XX_REG_PIHTH (APDS99XX_REG_BASE + 0x0b)
53
#define APDS99XX_REG_PERS (APDS99XX_REG_BASE + 0x0c)
54
#define APDS99XX_REG_CONFIG (APDS99XX_REG_BASE + 0x0d)
55
#define APDS99XX_REG_PPCOUNT (APDS99XX_REG_BASE + 0x0e)
56
#define APDS99XX_REG_CONTROL (APDS99XX_REG_BASE + 0x0f)
57
#define APDS99XX_REG_ID (APDS99XX_REG_BASE + 0x12)
58
#define APDS99XX_REG_STATUS (APDS99XX_REG_BASE + 0x13)
60
#define APDS99XX_REG_CDATAL (APDS99XX_REG_BASE + 0x14)
61
#define APDS99XX_REG_CDATAH (APDS99XX_REG_BASE + 0x15)
63
#if MODULE_APDS9900 || MODULE_APDS9901 || MODULE_APDS9930
64
#define APDS99XX_REG_IRDATAL (APDS99XX_REG_BASE + 0x16)
65
#define APDS99XX_REG_IRDATAH (APDS99XX_REG_BASE + 0x17)
66
#define APDS99XX_REG_PDATAL (APDS99XX_REG_BASE + 0x18)
67
#define APDS99XX_REG_PDATAH (APDS99XX_REG_BASE + 0x19)
68
#endif
69
#if MODULE_APDS9950 || MODULE_APDS9960
70
#define APDS99XX_REG_RDATAL (APDS99XX_REG_BASE + 0x16)
71
#define APDS99XX_REG_RDATAH (APDS99XX_REG_BASE + 0x17)
72
#define APDS99XX_REG_GDATAL (APDS99XX_REG_BASE + 0x18)
73
#define APDS99XX_REG_GDATAH (APDS99XX_REG_BASE + 0x19)
74
#define APDS99XX_REG_BDATAL (APDS99XX_REG_BASE + 0x1a)
75
#define APDS99XX_REG_BDATAH (APDS99XX_REG_BASE + 0x1b)
76
#endif
77
#if MODULE_APDS9950
78
#define APDS99XX_REG_PDATAL (APDS99XX_REG_BASE + 0x1c)
79
#define APDS99XX_REG_PDATAH (APDS99XX_REG_BASE + 0x1d)
80
#endif
81
#if MODULE_APDS9960
82
#define APDS99XX_REG_PDATA (APDS99XX_REG_BASE + 0x1c)
83
#endif
84
85
#define APDS99XX_REG_CLI_CMD (0xe7)
93
/* Enable states and interrupts register (APDS99XX_REG_ENABLE) */
94
#define APDS99XX_REG_GEN (0x40)
95
#define APDS99XX_REG_PIEN (0x20)
96
#define APDS99XX_REG_AIEN (0x10)
97
#define APDS99XX_REG_WEN (0x08)
98
#define APDS99XX_REG_PEN (0x04)
99
#define APDS99XX_REG_AEN (0x02)
100
#define APDS99XX_REG_PON (0x01)
102
/* Device status register (APDS99XX_REG_STATUS) */
103
#define APDS99XX_REG_CPSAT (0x80)
104
#define APDS99XX_REG_PGSAT (0x40)
105
#define APDS99XX_REG_PINT (0x20)
106
#define APDS99XX_REG_AINT (0x10)
107
#define APDS99XX_REG_GINT (0x04)
108
#define APDS99XX_REG_PVALID (0x02)
109
#define APDS99XX_REG_AVALID (0x01)
112
#define APDS99XX_REG_PDRIVE (0xc0)
113
#if !MODULE_APDS9960
114
#define APDS99XX_REG_PDIODE (0x30)
115
#endif
116
#define APDS99XX_REG_PGAIN (0x0c)
117
#define APDS99XX_REG_AGAIN (0x03)
120
#define APDS99XX_REG_WLONG (0x02)
123
#define APDS99XX_REG_PPERS (0xf0)
124
#define APDS99XX_REG_APERS (0x0f)
126
#if MODULE_APDS9960
128
#define APDS99XX_REG_PPLEN (0xc0)
129
#define APDS99XX_REG_PPULSE (0x3f)
130
#endif
131
133
#ifdef __cplusplus
134
}
135
#endif
136
137
#endif
/* APDS99XX_REGS_H */
Generated on Sat Dec 21 2024 20:58:02 by
1.9.8