Loading...
Searching...
No Matches
vl6180x_regs.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021 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#define VL6180X_REG_MODEL_ID (0x00)
26#define VL6180X_REG_MODEL_REV_MAJOR (0x01)
27#define VL6180X_REG_MODEL_REV_MINOR (0x02)
28#define VL6180X_REG_MODULE_REV_MAJOR (0x03)
29#define VL6180X_REG_MODULE_REV_MINOR (0x04)
30
31#define VL6180X_REG_GPIO0_MODE (0x10)
32#define VL6180X_REG_GPIO1_MODE (0x11)
33#define VL6180X_REG_HISTORY_CTRL (0x12)
34#define VL6180X_REG_INT_CONFIG (0x14)
35#define VL6180X_REG_INT_CLR (0x15)
36#define VL6180X_REG_FRESH_RST (0x16)
37
38#define VL6180X_REG_RNG_START (0x18)
39#define VL6180X_REG_RNG_THRESH_HI (0x19)
40#define VL6180X_REG_RNG_THRESH_LO (0x1a)
41#define VL6180X_REG_RNG_PERIOD (0x1b)
42#define VL6180X_REG_RNG_MAX_TIME (0x1c)
43#define VL6180X_REG_RNG_VALUE (0x62)
44
45#define VL6180X_REG_ALS_START (0x38)
46#define VL6180X_REG_ALS_THRESH_HI (0x3a)
47#define VL6180X_REG_ALS_THRESH_LO (0x3c)
48#define VL6180X_REG_ALS_PERIOD (0x3e)
49#define VL6180X_REG_ALS_GAIN (0x3f)
50#define VL6180X_REG_ALS_INT_TIME (0x40)
51#define VL6180X_REG_ALS_VALUE (0x50)
52
53#define VL6180X_REG_RNG_STATUS (0x4d)
54#define VL6180X_REG_ALS_STATUS (0x4e)
55#define VL6180X_REG_INT_STATUS (0x4f)
56
57#define VL6180X_REG_I2C_ADDR (0x212)
58#define VL6180X_REG_INTERLEAVED_MODE (0x2a3)
60
65
66/* VL6180X_REG_RNG_START */
67#define VL6180X_RNG_MODE_CONT (0x02)
68#define VL6180X_RNG_START_STOP (0x01)
69
70/* VL6180X_REG_ALS_START */
71#define VL6180X_ALS_MODE_CONT (0x02)
72#define VL6180X_ALS_START_STOP (0x01)
73
74/* VL6180X_REG_RNG_STATUS */
75#define VL6180X_RNG_ERR_CODE (0xf0)
76#define VL6180X_RNG_ERR_CODE_S (4)
77#define VL6180X_RNG_DEVICE_RDY (0x01)
78
79/* VL6180X_REG_ALS_STATUS */
80#define VL6180X_ALS_ERR_CODE (0xf0)
81#define VL6180X_ALS_ERR_CODE_S (4)
82#define VL6180X_ALS_DEVICE_RDY (0x01)
83
84/* VL6180X_REG_ALS_GAIN */
85#define VL6180X_ALS_GAIN_LIGHT (0x07)
86
87/* VL6180X_REG_INT_CONFIG and VL6180X_REG_INT_STATUS */
88#define VL6180X_INT_RNG (0x07)
89#define VL6180X_INT_RNG_S (0)
90#define VL6180X_INT_ALS (0x38)
91#define VL6180X_INT_ALS_S (3)
92#define VL6180X_ERR_INT (0xc0)
93#define VL6180X_ERR_INT_S (6)
94
95#define VL6180X_INT_RNG_LOW (0x01)
96#define VL6180X_INT_RNG_HIGH (0x02)
97#define VL6180X_INT_RNG_OUT (0x03)
98#define VL6180X_INT_RNG_DRDY (0x04)
99#define VL6180X_INT_ALS_LOW (0x08)
100#define VL6180X_INT_ALS_HIGH (0x10)
101#define VL6180X_INT_ALS_OUT (0x18)
102#define VL6180X_INT_ALS_DRDY (0x20)
103#define VL6180X_INT_ERR_LASER (0x40)
104#define VL6180X_INT_ERR_PLL (0x80)
105
106/* VL6180X_REG_INT_CLR */
107#define VL6180X_CLR_ERR_INT (0x04)
108#define VL6180X_CLR_ALS_INT (0x02)
109#define VL6180X_CLR_RNG_INT (0x01)
110#define VL6180X_CLR_ALL_INT (0x07)
111
112/* VL6180X_REG_GPIO0_MODE */
113#define VL6180X_GPIO0_SHUT (0x40)
114#define VL6180X_GPIO0_SHUT_ON (0x40)
115#define VL6180X_GPIO0_SHUT_OFF (0x00)
116#define VL6180X_GPIO0_POL (0x20)
117#define VL6180X_GPIO0_POL_LOW (0x00)
118#define VL6180X_GPIO0_POL_HIGH (0x20)
119#define VL6180X_GPIO0_FUNC (0x1e)
120#define VL6180X_GPIO0_FUNC_OFF (0x00)
121#define VL6180X_GPIO0_FUNC_ON (0x10)
122
123/* VL6180X_REG_GPIO1_MODE */
124#define VL6180X_GPIO1_POL (0x20)
125#define VL6180X_GPIO1_POL_LOW (0x00)
126#define VL6180X_GPIO1_POL_HIGH (0x20)
127#define VL6180X_GPIO1_FUNC (0x1e)
128#define VL6180X_GPIO1_FUNC_OFF (0x00)
129#define VL6180X_GPIO1_FUNC_ON (0x10)
130
132
140#define VL6180X_MODEL_ID (0xb4)
142
143#ifdef __cplusplus
144}
145#endif
146