vcnl40x0_params.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 
19 #ifndef VCNL40X0_PARAMS_H
20 #define VCNL40X0_PARAMS_H
21 
22 #include "board.h"
23 #include "vcnl40x0.h"
24 #include "vcnl40x0_internals.h"
25 #include "saul_reg.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #ifndef VCNL40X0_PARAM_I2C_DEV
36 #define VCNL40X0_PARAM_I2C_DEV I2C_DEV(0)
37 #endif
38 #ifndef VCNL40X0_PARAM_I2C_ADDR
39 #define VCNL40X0_PARAM_I2C_ADDR (VCNL40X0_ADDR)
40 #endif
41 #ifndef VCNL40X0_PARAM_LED_CURRENT
42 #define VCNL40X0_PARAM_LED_CURRENT (2U)
43 #endif
44 #ifndef VCNL40X0_PARAM_PROXIMITY_RATE
45 #define VCNL40X0_PARAM_PROXIMITY_RATE (VCNL40X0_PROXIMITY_RATE_2)
46 #endif
47 #ifndef VCNL40X0_PARAM_AMBIENT_AVG
48 #define VCNL40X0_PARAM_AMBIENT_AVG (VCNL40X0_AMBIENT_AVERAGE_32)
49 #endif
50 #ifndef VCNL40X0_PARAM_AMBIENT_RATE
51 #define VCNL40X0_PARAM_AMBIENT_RATE (VCNL40X0_AMBIENT_RATE_2)
52 #endif
53 
54 #define VCNL40X0_PARAMS { .i2c_dev = VCNL40X0_PARAM_I2C_DEV, \
55  .i2c_addr = VCNL40X0_PARAM_I2C_ADDR, \
56  .led_current = VCNL40X0_PARAM_LED_CURRENT, \
57  .proximity_rate = VCNL40X0_PARAM_PROXIMITY_RATE, \
58  .ambient_avg = VCNL40X0_PARAM_AMBIENT_AVG, \
59  .ambient_rate = VCNL40X0_PARAM_AMBIENT_RATE }
60 
66 {
67  VCNL40X0_PARAMS,
68 };
69 
74 {
75  { .name = "vcnl40x0" }
76 };
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* VCNL40X0_PARAMS_H */
83 
vcnl40x0_params_t
Device initialization parameters.
Definition: vcnl40x0.h:89
saul_reg_info_t
Additional data to collect for each entry.
Definition: saul_reg.h:49
vcnl40x0.h
Device driver interface for the VCNL40X0 sensors family.
vcnl40x0_params
static const vcnl40x0_params_t vcnl40x0_params[]
Configure VCNL40X0.
Definition: vcnl40x0_params.h:65
vcnl40x0_internals.h
Internal addresses, registers, constants for the VCNL40X0 devices.
saul_reg_info_t::name
const char * name
string identifier for a device
Definition: saul_reg.h:50
vcnl40x0_saul_reg_info
static const saul_reg_info_t vcnl40x0_saul_reg_info[]
Configure SAUL registry entries.
Definition: vcnl40x0_params.h:73
saul_reg.h
SAUL registry interface definition.