Loading...
Searching...
No Matches
apds99xx_regs.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Gunar Schorcht
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
15
16#ifdef __cplusplus
17extern "C"
18{
19#endif
20
25#if MODULE_APDS9960
26#define APDS99XX_REG_BASE (0x80)
27#else
28#define APDS99XX_REG_BASE (0xa0)
29#endif
30
31#define APDS99XX_REG_ENABLE (APDS99XX_REG_BASE + 0x00)
32#define APDS99XX_REG_ATIME (APDS99XX_REG_BASE + 0x01)
33#if MODULE_APDS9900 || MODULE_APDS9901 || MODULE_APDS9930
34#define APDS99XX_REG_PTIME (APDS99XX_REG_BASE + 0x02)
35#endif
36#define APDS99XX_REG_WTIME (APDS99XX_REG_BASE + 0x03)
37#define APDS99XX_REG_AILTL (APDS99XX_REG_BASE + 0x04)
38#define APDS99XX_REG_AILTH (APDS99XX_REG_BASE + 0x05)
39#define APDS99XX_REG_AIHTL (APDS99XX_REG_BASE + 0x06)
40#define APDS99XX_REG_AIHTH (APDS99XX_REG_BASE + 0x07)
41#if !MODULE_APDS9960
42#define APDS99XX_REG_PILTL (APDS99XX_REG_BASE + 0x08)
43#endif
44#define APDS99XX_REG_PILTH (APDS99XX_REG_BASE + 0x09)
45#if !MODULE_APDS9960
46#define APDS99XX_REG_PIHTL (APDS99XX_REG_BASE + 0x0a)
47#endif
48#define APDS99XX_REG_PIHTH (APDS99XX_REG_BASE + 0x0b)
49#define APDS99XX_REG_PERS (APDS99XX_REG_BASE + 0x0c)
50#define APDS99XX_REG_CONFIG (APDS99XX_REG_BASE + 0x0d)
51#define APDS99XX_REG_PPCOUNT (APDS99XX_REG_BASE + 0x0e)
52#define APDS99XX_REG_CONTROL (APDS99XX_REG_BASE + 0x0f)
53#define APDS99XX_REG_ID (APDS99XX_REG_BASE + 0x12)
54#define APDS99XX_REG_STATUS (APDS99XX_REG_BASE + 0x13)
55
56#define APDS99XX_REG_CDATAL (APDS99XX_REG_BASE + 0x14)
57#define APDS99XX_REG_CDATAH (APDS99XX_REG_BASE + 0x15)
58
59#if MODULE_APDS9900 || MODULE_APDS9901 || MODULE_APDS9930
60#define APDS99XX_REG_IRDATAL (APDS99XX_REG_BASE + 0x16)
61#define APDS99XX_REG_IRDATAH (APDS99XX_REG_BASE + 0x17)
62#define APDS99XX_REG_PDATAL (APDS99XX_REG_BASE + 0x18)
63#define APDS99XX_REG_PDATAH (APDS99XX_REG_BASE + 0x19)
64#endif
65#if MODULE_APDS9950 || MODULE_APDS9960
66#define APDS99XX_REG_RDATAL (APDS99XX_REG_BASE + 0x16)
67#define APDS99XX_REG_RDATAH (APDS99XX_REG_BASE + 0x17)
68#define APDS99XX_REG_GDATAL (APDS99XX_REG_BASE + 0x18)
69#define APDS99XX_REG_GDATAH (APDS99XX_REG_BASE + 0x19)
70#define APDS99XX_REG_BDATAL (APDS99XX_REG_BASE + 0x1a)
71#define APDS99XX_REG_BDATAH (APDS99XX_REG_BASE + 0x1b)
72#endif
73#if MODULE_APDS9950
74#define APDS99XX_REG_PDATAL (APDS99XX_REG_BASE + 0x1c)
75#define APDS99XX_REG_PDATAH (APDS99XX_REG_BASE + 0x1d)
76#endif
77#if MODULE_APDS9960
78#define APDS99XX_REG_PDATA (APDS99XX_REG_BASE + 0x1c)
79#endif
80
81#define APDS99XX_REG_CLI_CMD (0xe7)
83
88
89/* Enable states and interrupts register (APDS99XX_REG_ENABLE) */
90#define APDS99XX_REG_GEN (0x40)
91#define APDS99XX_REG_PIEN (0x20)
92#define APDS99XX_REG_AIEN (0x10)
93#define APDS99XX_REG_WEN (0x08)
94#define APDS99XX_REG_PEN (0x04)
95#define APDS99XX_REG_AEN (0x02)
96#define APDS99XX_REG_PON (0x01)
97
98/* Device status register (APDS99XX_REG_STATUS) */
99#define APDS99XX_REG_CPSAT (0x80)
100#define APDS99XX_REG_PGSAT (0x40)
101#define APDS99XX_REG_PINT (0x20)
102#define APDS99XX_REG_AINT (0x10)
103#define APDS99XX_REG_GINT (0x04)
104#define APDS99XX_REG_PVALID (0x02)
105#define APDS99XX_REG_AVALID (0x01)
106
108#define APDS99XX_REG_PDRIVE (0xc0)
109#if !MODULE_APDS9960
110#define APDS99XX_REG_PDIODE (0x30)
111#endif
112#define APDS99XX_REG_PGAIN (0x0c)
113#define APDS99XX_REG_AGAIN (0x03)
114
116#define APDS99XX_REG_WLONG (0x02)
117
119#define APDS99XX_REG_PPERS (0xf0)
120#define APDS99XX_REG_APERS (0x0f)
121
122#if MODULE_APDS9960
124#define APDS99XX_REG_PPLEN (0xc0)
125#define APDS99XX_REG_PPULSE (0x3f)
126#endif
127
129#ifdef __cplusplus
130}
131#endif
132