-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy pathapds99xx_params.h
More file actions
107 lines (93 loc) · 2.71 KB
/
Copy pathapds99xx_params.h
File metadata and controls
107 lines (93 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
* SPDX-FileCopyrightText: 2018 Gunar Schorcht
* SPDX-License-Identifier: LGPL-2.1-only
*/
#pragma once
/**
* @ingroup drivers_apds99xx
* @brief Default configuration for Broadcom APDS99XX proximity and ambient light sensor
* @author Gunar Schorcht <gunar@schorcht.net>
* @file
* @{
*/
#include "board.h"
#include "apds99xx.h"
#include "saul_reg.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Set default configuration parameters
* @{
*/
#ifndef APDS99XX_PARAM_DEV
/** device is I2C_DEV(0) */
#define APDS99XX_PARAM_DEV I2C_DEV(0)
#endif
#ifndef APDS99XX_PARAM_ALS_STEPS
/** ALS measurement: enabled with integration time of 64 steps */
#define APDS99XX_PARAM_ALS_STEPS (64)
#endif
#ifndef APDS99XX_PARAM_ALS_GAIN
/** ALS gain: 1 x gain */
#define APDS99XX_PARAM_ALS_GAIN (APDS99XX_ALS_GAIN_1)
#endif
#ifndef APDS99XX_PARAM_PRX_PULSES
/** PRX LED pulse count: 8 pulses as recommended in datasheet */
#define APDS99XX_PARAM_PRX_PULSES (8)
#endif
#ifndef APDS99XX_PARAM_PRX_DRIVE
/** PRX LED drive strength: 100 mA as recommended in datasheet */
#define APDS99XX_PARAM_PRX_DRIVE (APDS99XX_PRX_DRIVE_100)
#endif
#ifndef APDS99XX_PARAM_PRX_GAIN
/** PRX gain: 1 x gain */
#define APDS99XX_PARAM_PRX_GAIN (APDS99XX_PRX_GAIN_1)
#endif
#ifndef APDS99XX_PARAM_WAIT_STEPS
/** Waiting time: disabled */
#define APDS99XX_PARAM_WAIT_STEPS (0)
#endif
#ifndef APDS99XX_PARAM_WAIT_LONG
/** Wait long: false */
#define APDS99XX_PARAM_WAIT_LONG (false)
#endif
#ifndef APDS99XX_PARAM_INT_PIN
/** Interrupt pin */
#define APDS99XX_PARAM_INT_PIN (GPIO_PIN(0, 0))
#endif
#ifndef APDS99XX_PARAMS
#define APDS99XX_PARAMS { \
.dev = APDS99XX_PARAM_DEV, \
.als_steps = APDS99XX_PARAM_ALS_STEPS, \
.als_gain = APDS99XX_PARAM_ALS_GAIN, \
.prx_pulses = APDS99XX_PARAM_PRX_PULSES, \
.prx_gain = APDS99XX_PARAM_PRX_GAIN, \
.prx_drive = APDS99XX_PARAM_PRX_DRIVE, \
.wait_steps = APDS99XX_PARAM_WAIT_STEPS, \
.wait_long = APDS99XX_PARAM_WAIT_LONG, \
.int_pin = APDS99XX_PARAM_INT_PIN, \
}
#endif
#ifndef APDS99XX_SAUL_INFO
#define APDS99XX_SAUL_INFO { .name = "apds99xx" }
#endif
/**@}*/
/**
* @brief Allocate some memory to store the actual configuration
*/
static const apds99xx_params_t apds99xx_params[] =
{
APDS99XX_PARAMS
};
/**
* @brief Additional meta information to keep in the SAUL registry
*/
static const saul_reg_info_t apds99xx_saul_info[] =
{
APDS99XX_SAUL_INFO
};
#ifdef __cplusplus
}
#endif
/** @} */