bmx280_params.h
2.1 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
/*
* Copyright (C) 2016 Kees Bakker, SODAQ
* 2017 Inria
*
* 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_bmx280
*
* @{
* @file
* @brief Default configuration for BMX280
*
* @author Kees Bakker <kees@sodaq.com>
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/
#ifndef BMX280_PARAMS_H
#define BMX280_PARAMS_H
#include "bmx280.h"
#include "saul_reg.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Set default configuration parameters for the BMX280
* @{
*/
#ifndef BMX280_PARAM_I2C_DEV
#define BMX280_PARAM_I2C_DEV I2C_DEV(0)
#endif
#ifndef BMX280_PARAM_I2C_ADDR
#define BMX280_PARAM_I2C_ADDR (0x77)
#endif
/* Defaults for Weather Monitoring */
#define BMX280_PARAMS_DEFAULT \
{ \
.i2c_dev = BMX280_PARAM_I2C_DEV, \
.i2c_addr = BMX280_PARAM_I2C_ADDR, \
.t_sb = BMX280_SB_0_5, \
.filter = BMX280_FILTER_OFF, \
.run_mode = BMX280_MODE_FORCED, \
.temp_oversample = BMX280_OSRS_X1, \
.press_oversample = BMX280_OSRS_X1, \
.humid_oversample = BMX280_OSRS_X1, \
}
/**@}*/
/**
* @brief Configure BMX280
*/
static const bmx280_params_t bmx280_params[] =
{
#ifdef BMX280_PARAMS_BOARD
BMX280_PARAMS_BOARD,
#else
BMX280_PARAMS_DEFAULT
#endif
};
/**
* @brief The number of configured sensors
*/
#define BMX280_NUMOF (sizeof(bmx280_params) / sizeof(bmx280_params[0]))
/**
* @brief Configuration details of SAUL registry entries
*
* This two dimensional array contains static details of the sensors
* for each device. Please be awar that the indexes are used in
* auto_init_bmx280, so make sure the indexes match.
*/
static const saul_reg_info_t bmx280_saul_reg_info[BMX280_NUMOF] =
{
#if defined(MODULE_BME280)
{ .name = "bme280" }
#else
{ .name = "bmp280" }
#endif
};
#ifdef __cplusplus
}
#endif
#endif /* BMX280_PARAMS_H */
/** @} */