adcxx1c_params.h
2.27 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
/*
* Copyright (C) 2017 OTA keys S.A.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup drivers_adcxx1x
* @{
*
* @file
* @brief Default configuration for ADCXX1C devices
*
* @author Vincent Dupont <vincent@otakeys.com>
*/
#ifndef ADCXX1C_PARAMS_H
#define ADCXX1C_PARAMS_H
#include "board.h"
#include "saul_reg.h"
#include "adcxx1c.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Set default configuration parameters for the ADCXX1C driver
* @{
*/
#ifndef ADCXX1C_PARAM_I2C
#define ADCXX1C_PARAM_I2C (I2C_DEV(0))
#endif
#ifndef ADCXX1C_PARAM_ADDR
#define ADCXX1C_PARAM_ADDR (ADCXX1C_I2C_ADDRESS)
#endif
#ifndef ADCXX1C_PARAM_BITS
#define ADCXX1C_PARAM_BITS (ADCXX1C_RES_DEFAULT)
#endif
#ifndef ADCXX1C_PARAM_CYCLE
#define ADCXX1C_PARAM_CYCLE (ADCXX1C_CYCLE_DISABLED)
#endif
#ifndef ADCXX1C_PARAM_ALERT_PIN
#define ADCXX1C_PARAM_ALERT_PIN (GPIO_UNDEF)
#endif
#ifndef ADCXX1C_PARAM_LOW_LIMIT
#define ADCXX1C_PARAM_LOW_LIMIT (0)
#endif
#ifndef ADCXX1C_PARAM_HIGH_LIMIT
#define ADCXX1C_PARAM_HIGH_LIMIT (0)
#endif
#ifndef ADCXX1C_PARAM_HYSTERESIS
#define ADCXX1C_PARAM_HYSTERESIS (0)
#endif
#define ADCXX1C_PARAMS_DEFAULT { .i2c = ADCXX1C_PARAM_I2C, \
.addr = ADCXX1C_PARAM_ADDR, \
.bits = ADCXX1C_PARAM_BITS, \
.cycle = ADCXX1C_PARAM_CYCLE, \
.alert_pin = ADCXX1C_PARAM_ALERT_PIN, \
.low_limit = ADCXX1C_PARAM_LOW_LIMIT, \
.high_limit = ADCXX1C_PARAM_HIGH_LIMIT, \
.hysteresis = ADCXX1C_PARAM_HYSTERESIS }
/** @} */
/**
* @brief ADCXX1C configuration
*/
static const adcxx1c_params_t adcxx1c_params[] =
{
#ifdef ADCXX1C_PARAMS_BOARD
ADCXX1C_PARAMS_BOARD,
#else
ADCXX1C_PARAMS_DEFAULT,
#endif
};
/**
* @brief Additional meta information to keep in the SAUL registry
*/
static const saul_reg_info_t adcxx1c_saul_info[] =
{
{
.name = "adcxx1c",
},
};
#ifdef __cplusplus
}
#endif
#endif /* ADCXX1C_PARAMS_H */
/** @} */