Loading...
Searching...
No Matches
vcnl40x0.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
23#ifndef VCNL40X0_H
24#define VCNL40X0_H
25
26#include "saul.h"
27#include "periph/i2c.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
36enum {
45};
46
50enum {
59};
60
66enum {
75};
76
80enum {
84};
85
89typedef struct {
91 uint8_t i2c_addr;
92 uint8_t led_current;
94 uint8_t ambient_rate;
95 uint8_t ambient_avg;
97
104
116
125
134
143
144#ifdef __cplusplus
145}
146#endif
147
148#endif /* VCNL40X0_H */
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:151
int vcnl40x0_init(vcnl40x0_t *dev, const vcnl40x0_params_t *params)
Initialize the given VCNL40X0 device.
uint16_t vcnl40x0_read_proximity(const vcnl40x0_t *dev)
Read proximity value from the vcnl40X0 device.
uint16_t vcnl40x0_read_ambient_light(const vcnl40x0_t *dev)
Read ambient light value from the vcnl40X0 device.
uint16_t vcnl40x0_read_illuminance(const vcnl40x0_t *dev)
Read illuminance value from the vcnl40X0 device.
@ VCNL40X0_PROXIMITY_RATE_31
31.25 measurements/s
Definition vcnl40x0.h:41
@ VCNL40X0_PROXIMITY_RATE_2
1.95 measurements/s (default)
Definition vcnl40x0.h:37
@ VCNL40X0_PROXIMITY_RATE_8
7.8125 measurements/s
Definition vcnl40x0.h:39
@ VCNL40X0_PROXIMITY_RATE_62
62.5 measurements/s
Definition vcnl40x0.h:42
@ VCNL40X0_PROXIMITY_RATE_4
3.90625 measurements/s
Definition vcnl40x0.h:38
@ VCNL40X0_PROXIMITY_RATE_16
16.625 measurements/s
Definition vcnl40x0.h:40
@ VCNL40X0_PROXIMITY_RATE_250
250 measurements/s
Definition vcnl40x0.h:44
@ VCNL40X0_PROXIMITY_RATE_125
125 measurements/s
Definition vcnl40x0.h:43
@ VCNL40X0_ERR_NODEV
Error wrong device.
Definition vcnl40x0.h:83
@ VCNL40X0_ERR_I2C
Error initializing the I2C bus.
Definition vcnl40x0.h:82
@ VCNL40X0_OK
Everything was fine.
Definition vcnl40x0.h:81
@ VCNL40X0_AMBIENT_AVERAGE_64
Decimal value 64.
Definition vcnl40x0.h:73
@ VCNL40X0_AMBIENT_AVERAGE_1
Decimal value 1.
Definition vcnl40x0.h:67
@ VCNL40X0_AMBIENT_AVERAGE_128
Decimal value 128.
Definition vcnl40x0.h:74
@ VCNL40X0_AMBIENT_AVERAGE_2
Decimal value 2.
Definition vcnl40x0.h:68
@ VCNL40X0_AMBIENT_AVERAGE_16
Decimal value 16.
Definition vcnl40x0.h:71
@ VCNL40X0_AMBIENT_AVERAGE_8
Decimal value 8.
Definition vcnl40x0.h:70
@ VCNL40X0_AMBIENT_AVERAGE_32
Decimal value 32 (default)
Definition vcnl40x0.h:72
@ VCNL40X0_AMBIENT_AVERAGE_4
Decimal value 4.
Definition vcnl40x0.h:69
@ VCNL40X0_AMBIENT_RATE_2
2 sample/s (default)
Definition vcnl40x0.h:52
@ VCNL40X0_AMBIENT_RATE_6
6 sample/s
Definition vcnl40x0.h:56
@ VCNL40X0_AMBIENT_RATE_3
3 sample/s
Definition vcnl40x0.h:53
@ VCNL40X0_AMBIENT_RATE_8
8 sample/s
Definition vcnl40x0.h:57
@ VCNL40X0_AMBIENT_RATE_10
10 sample/s
Definition vcnl40x0.h:58
@ VCNL40X0_AMBIENT_RATE_4
4 sample/s
Definition vcnl40x0.h:54
@ VCNL40X0_AMBIENT_RATE_5
5 sample/s
Definition vcnl40x0.h:55
@ VCNL40X0_AMBIENT_RATE_1
1 sample/s
Definition vcnl40x0.h:51
Low-level I2C peripheral driver interface definition.
Device initialization parameters.
Definition vcnl40x0.h:89
uint8_t ambient_rate
Ambient light rate.
Definition vcnl40x0.h:94
uint8_t i2c_addr
Address on I2C bus.
Definition vcnl40x0.h:91
uint8_t led_current
LED current.
Definition vcnl40x0.h:92
uint8_t ambient_avg
Ambient light conversion average.
Definition vcnl40x0.h:95
uint8_t proximity_rate
Proximity rate.
Definition vcnl40x0.h:93
i2c_t i2c_dev
I2C device which is used.
Definition vcnl40x0.h:90
Device descriptor for the VCNL40X0 sensor.
Definition vcnl40x0.h:101
vcnl40x0_params_t params
Device parameters.
Definition vcnl40x0.h:102
Functionality for reading [S]ensor [A]ctuator [U]ber [L]ayer sensors as SenML.