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