apds99xx_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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 
19 #include "board.h"
20 #include "apds99xx.h"
21 #include "saul_reg.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
31 #ifndef APDS99XX_PARAM_DEV
33 #define APDS99XX_PARAM_DEV I2C_DEV(0)
34 #endif
35 
36 #ifndef APDS99XX_PARAM_ALS_STEPS
38 #define APDS99XX_PARAM_ALS_STEPS (64)
39 #endif
40 #ifndef APDS99XX_PARAM_ALS_GAIN
42 #define APDS99XX_PARAM_ALS_GAIN (APDS99XX_ALS_GAIN_1)
43 #endif
44 
45 #ifndef APDS99XX_PARAM_PRX_PULSES
47 #define APDS99XX_PARAM_PRX_PULSES (8)
48 #endif
49 #ifndef APDS99XX_PARAM_PRX_DRIVE
51 #define APDS99XX_PARAM_PRX_DRIVE (APDS99XX_PRX_DRIVE_100)
52 #endif
53 #ifndef APDS99XX_PARAM_PRX_GAIN
55 #define APDS99XX_PARAM_PRX_GAIN (APDS99XX_PRX_GAIN_1)
56 #endif
57 #ifndef APDS99XX_PARAM_WAIT_STEPS
59 #define APDS99XX_PARAM_WAIT_STEPS (0)
60 #endif
61 #ifndef APDS99XX_PARAM_WAIT_LONG
63 #define APDS99XX_PARAM_WAIT_LONG (false)
64 #endif
65 
66 #ifndef APDS99XX_PARAM_INT_PIN
68 #define APDS99XX_PARAM_INT_PIN (GPIO_PIN(0, 0))
69 #endif
70 
71 #ifndef APDS99XX_PARAMS
72 #define APDS99XX_PARAMS { \
73  .dev = APDS99XX_PARAM_DEV, \
74  .als_steps = APDS99XX_PARAM_ALS_STEPS, \
75  .als_gain = APDS99XX_PARAM_ALS_GAIN, \
76  .prx_pulses = APDS99XX_PARAM_PRX_PULSES, \
77  .prx_gain = APDS99XX_PARAM_PRX_GAIN, \
78  .prx_drive = APDS99XX_PARAM_PRX_DRIVE, \
79  .wait_steps = APDS99XX_PARAM_WAIT_STEPS, \
80  .wait_long = APDS99XX_PARAM_WAIT_LONG, \
81  .int_pin = APDS99XX_PARAM_INT_PIN, \
82  }
83 #endif
84 
85 #ifndef APDS99XX_SAUL_INFO
86 #define APDS99XX_SAUL_INFO { .name = "apds99xx" }
87 #endif
94 {
95  APDS99XX_PARAMS
96 };
97 
102 {
103  APDS99XX_SAUL_INFO
104 };
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
static const apds99xx_params_t apds99xx_params[]
Allocate some memory to store the actual configuration.
static const saul_reg_info_t apds99xx_saul_info[]
Additional meta information to keep in the SAUL registry.
SAUL registry interface definition.
APDS99XX device initialization parameters.
Definition: apds99xx.h:325
Additional data to collect for each entry.
Definition: saul_reg.h:48