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