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 
9 #pragma once
10 
19 #ifdef __cplusplus
20 extern "C"
21 {
22 #endif
23 
28 #if MODULE_APDS9960
29 #define APDS99XX_REG_BASE (0x80)
30 #else
31 #define APDS99XX_REG_BASE (0xa0)
32 #endif
33 
34 #define APDS99XX_REG_ENABLE (APDS99XX_REG_BASE + 0x00)
35 #define APDS99XX_REG_ATIME (APDS99XX_REG_BASE + 0x01)
36 #if MODULE_APDS9900 || MODULE_APDS9901 || MODULE_APDS9930
37 #define APDS99XX_REG_PTIME (APDS99XX_REG_BASE + 0x02)
38 #endif
39 #define APDS99XX_REG_WTIME (APDS99XX_REG_BASE + 0x03)
40 #define APDS99XX_REG_AILTL (APDS99XX_REG_BASE + 0x04)
41 #define APDS99XX_REG_AILTH (APDS99XX_REG_BASE + 0x05)
42 #define APDS99XX_REG_AIHTL (APDS99XX_REG_BASE + 0x06)
43 #define APDS99XX_REG_AIHTH (APDS99XX_REG_BASE + 0x07)
44 #if !MODULE_APDS9960
45 #define APDS99XX_REG_PILTL (APDS99XX_REG_BASE + 0x08)
46 #endif
47 #define APDS99XX_REG_PILTH (APDS99XX_REG_BASE + 0x09)
48 #if !MODULE_APDS9960
49 #define APDS99XX_REG_PIHTL (APDS99XX_REG_BASE + 0x0a)
50 #endif
51 #define APDS99XX_REG_PIHTH (APDS99XX_REG_BASE + 0x0b)
52 #define APDS99XX_REG_PERS (APDS99XX_REG_BASE + 0x0c)
53 #define APDS99XX_REG_CONFIG (APDS99XX_REG_BASE + 0x0d)
54 #define APDS99XX_REG_PPCOUNT (APDS99XX_REG_BASE + 0x0e)
55 #define APDS99XX_REG_CONTROL (APDS99XX_REG_BASE + 0x0f)
56 #define APDS99XX_REG_ID (APDS99XX_REG_BASE + 0x12)
57 #define APDS99XX_REG_STATUS (APDS99XX_REG_BASE + 0x13)
59 #define APDS99XX_REG_CDATAL (APDS99XX_REG_BASE + 0x14)
60 #define APDS99XX_REG_CDATAH (APDS99XX_REG_BASE + 0x15)
62 #if MODULE_APDS9900 || MODULE_APDS9901 || MODULE_APDS9930
63 #define APDS99XX_REG_IRDATAL (APDS99XX_REG_BASE + 0x16)
64 #define APDS99XX_REG_IRDATAH (APDS99XX_REG_BASE + 0x17)
65 #define APDS99XX_REG_PDATAL (APDS99XX_REG_BASE + 0x18)
66 #define APDS99XX_REG_PDATAH (APDS99XX_REG_BASE + 0x19)
67 #endif
68 #if MODULE_APDS9950 || MODULE_APDS9960
69 #define APDS99XX_REG_RDATAL (APDS99XX_REG_BASE + 0x16)
70 #define APDS99XX_REG_RDATAH (APDS99XX_REG_BASE + 0x17)
71 #define APDS99XX_REG_GDATAL (APDS99XX_REG_BASE + 0x18)
72 #define APDS99XX_REG_GDATAH (APDS99XX_REG_BASE + 0x19)
73 #define APDS99XX_REG_BDATAL (APDS99XX_REG_BASE + 0x1a)
74 #define APDS99XX_REG_BDATAH (APDS99XX_REG_BASE + 0x1b)
75 #endif
76 #if MODULE_APDS9950
77 #define APDS99XX_REG_PDATAL (APDS99XX_REG_BASE + 0x1c)
78 #define APDS99XX_REG_PDATAH (APDS99XX_REG_BASE + 0x1d)
79 #endif
80 #if MODULE_APDS9960
81 #define APDS99XX_REG_PDATA (APDS99XX_REG_BASE + 0x1c)
82 #endif
83 
84 #define APDS99XX_REG_CLI_CMD (0xe7)
92 /* Enable states and interrupts register (APDS99XX_REG_ENABLE) */
93 #define APDS99XX_REG_GEN (0x40)
94 #define APDS99XX_REG_PIEN (0x20)
95 #define APDS99XX_REG_AIEN (0x10)
96 #define APDS99XX_REG_WEN (0x08)
97 #define APDS99XX_REG_PEN (0x04)
98 #define APDS99XX_REG_AEN (0x02)
99 #define APDS99XX_REG_PON (0x01)
101 /* Device status register (APDS99XX_REG_STATUS) */
102 #define APDS99XX_REG_CPSAT (0x80)
103 #define APDS99XX_REG_PGSAT (0x40)
104 #define APDS99XX_REG_PINT (0x20)
105 #define APDS99XX_REG_AINT (0x10)
106 #define APDS99XX_REG_GINT (0x04)
107 #define APDS99XX_REG_PVALID (0x02)
108 #define APDS99XX_REG_AVALID (0x01)
111 #define APDS99XX_REG_PDRIVE (0xc0)
112 #if !MODULE_APDS9960
113 #define APDS99XX_REG_PDIODE (0x30)
114 #endif
115 #define APDS99XX_REG_PGAIN (0x0c)
116 #define APDS99XX_REG_AGAIN (0x03)
119 #define APDS99XX_REG_WLONG (0x02)
122 #define APDS99XX_REG_PPERS (0xf0)
123 #define APDS99XX_REG_APERS (0x0f)
125 #if MODULE_APDS9960
127 #define APDS99XX_REG_PPLEN (0xc0)
128 #define APDS99XX_REG_PPULSE (0x3f)
129 #endif
130 
132 #ifdef __cplusplus
133 }
134 #endif
135