Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
vcnl40x0_internals.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2017 Inria
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
20
#ifndef VCNL40X0_INTERNALS_H
21
#define VCNL40X0_INTERNALS_H
22
23
#ifdef __cplusplus
24
extern
"C"
{
25
#endif
26
30
#define VCNL40X0_ADDR (0x13)
31
35
#define VCNL40X0_PRODUCT_ID (0x20)
36
41
#define VCNL40X0_REG_COMMAND (0x80)
42
#define VCNL40X0_REG_PRODUCT_ID (0x81)
43
#define VCNL40X0_REG_PROXIMITY_RATE (0x82)
44
#define VCNL40X0_REG_PROXIMITY_CURRENT (0x83)
45
#define VCNL40X0_REG_AMBIENT_PARAMETER (0x84)
46
#define VCNL40X0_REG_AMBIENT_VALUE (0x85)
47
#define VCNL40X0_REG_PROXIMITY_VALUE (0x87)
48
#define VCNL40X0_REG_INTERRUPT_CONTROL (0x89)
49
#define VCNL40X0_REG_INTERRUPT_LOW_THRES (0x8a)
50
#define VCNL40X0_REG_HIGH_THRES (0x8c)
51
#define VCNL40X0_REG_INTERRUPT_STATUS (0x8e)
52
#define VCNL40X0_REG_PROX_TIMING (0xf9)
53
#define VCNL40X0_REG_AMBIENT_IR_LIGHT_LEVEL (0x90)
/* should not be used */
54
60
#define VCNL40X0_COMMAND_ALL_DISABLE (0x00)
61
#define VCNL40X0_COMMAND_SELFTIMED_MODE_ENABLE (0x01)
62
#define VCNL40X0_COMMAND_PROX_ENABLE (0x02)
63
#define VCNL40X0_COMMAND_AMBI_ENABLE (0x04)
64
#define VCNL40X0_COMMAND_PROX_ON_DEMAND (0x08)
65
#define VCNL40X0_COMMAND_AMBI_ON_DEMAND (0x10)
66
#define VCNL40X0_COMMAND_MASK_PROX_DATA_READY (0x20)
67
#define VCNL40X0_COMMAND_MASK_AMBI_DATA_READY (0x40)
68
#define VCNL40X0_COMMAND_MASK_LOCK (0x80)
69
75
#define VCNL40X0_PRODUCT_MASK_REVISION_ID (0x0f)
76
#define VCNL40X0_PRODUCT_MASK_PRODUCT_ID (0xf0)
77
83
#define VCNL40X0_PROXIMITY_MASK_MEASUREMENT_RATE (0x07)
84
#define VCNL40X0_PROXIMITY_MASK_LED_CURRENT (0x3f)
85
#define VCNL40X0_PROXIMITY_MASK_FUSE_PROG_ID (0xc0)
86
92
#define VCNL40X0_AMBIENT_MASK_PARA_AVERAGE (0x07)
93
#define VCNL40X0_AMBIENT_PARA_AUTO_OFFSET_ENABLE (0x08)
94
#define VCNL40X0_AMBIENT_MASK_PARA_AUTO_OFFSET (0x08)
95
#define VCNL40X0_AMBIENT_MASK_PARA_MEAS_RATE (0x70)
96
#define VCNL40X0_AMBIENT_PARA_CONT_CONV_ENABLE (0x80)
97
#define VCNL40X0_AMBIENT_MASK_PARA_CONT_CONV (0x80)
98
104
#define VCNL40X0_INTERRUPT_THRES_SEL_PROX (0x00)
105
#define VCNL40X0_INTERRUPT_THRES_SEL_ALS (0x01)
106
#define VCNL40X0_INTERRUPT_THRES_ENABLE (0x02)
107
#define VCNL40X0_INTERRUPT_ALS_READY_ENABLE (0x04)
108
#define VCNL40X0_INTERRUPT_PROX_READY_ENABLE (0x08)
109
#define VCNL40X0_INTERRUPT_COUNT_EXCEED_1 (0x00)
110
#define VCNL40X0_INTERRUPT_COUNT_EXCEED_2 (0x20)
111
#define VCNL40X0_INTERRUPT_COUNT_EXCEED_4 (0x40)
112
#define VCNL40X0_INTERRUPT_COUNT_EXCEED_8 (0x60)
113
#define VCNL40X0_INTERRUPT_COUNT_EXCEED_16 (0x80)
114
#define VCNL40X0_INTERRUPT_COUNT_EXCEED_32 (0xa0)
115
#define VCNL40X0_INTERRUPT_COUNT_EXCEED_64 (0xc0)
116
#define VCNL40X0_INTERRUPT_COUNT_EXCEED_128 (0xe0)
117
#define VCNL40X0_INTERRUPT_MASK_COUNT_EXCEED (0xe0)
118
124
#define VCNL40X0_INTERRUPT_STATUS_THRES_HI (0x01)
125
#define VCNL40X0_INTERRUPT_STATUS_THRES_LO (0x02)
126
#define VCNL40X0_INTERRUPT_STATUS_ALS_READY (0x04)
127
#define VCNL40X0_INTERRUPT_STATUS_PROX_READY (0x08)
128
#define VCNL40X0_INTERRUPT_MASK_STATUS_THRES_HI (0x01)
129
#define VCNL40X0_INTERRUPT_MASK_THRES_LO (0x02)
130
#define VCNL40X0_INTERRUPT_MASK_ALS_READY (0x04)
131
#define VCNL40X0_INTERRUPT_MASK_PROX_READY (0x08)
132
134
#ifdef __cplusplus
135
}
136
#endif
137
138
#endif
/* VCNL40X0_INTERNALS_H */
139
Generated on Tue Nov 24 2020 19:46:51 by
1.8.17