sht2x_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016,2017,2018 Kees Bakker, SODAQ
3  * Copyright (C) 2017 George Psimenos
4  * Copyright (C) 2018 Steffen Robertz
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
23 #ifndef SHT2X_PARAMS_H
24 #define SHT2X_PARAMS_H
25 
26 #include "sht2x.h"
27 #include "saul_reg.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
37 #ifndef SHT2X_PARAM_I2C_DEV
38 #define SHT2X_PARAM_I2C_DEV (I2C_DEV(0))
39 #endif
40 #ifndef SHT2X_PARAM_I2C_ADDR
41 #define SHT2X_PARAM_I2C_ADDR (0x40)
42 #endif
43 #ifndef SHT2X_PARAM_RESOLUTION
44 #define SHT2X_PARAM_RESOLUTION (SHT2X_RES_12_14BIT)
45 #endif
46 #ifndef SHT2X_PARAM_MEASURE_MODE
47 #define SHT2X_PARAM_MEASURE_MODE (SHT2X_MEASURE_MODE_HOLD)
48 #endif
49 #ifndef SHT2X_PARAM_CRC_MODE
50 #define SHT2X_PARAM_CRC_MODE (1)
51 #endif
52 
53 #define SHT2X_PARAMS_DEFAULT {.i2c_dev = SHT2X_PARAM_I2C_DEV, \
54  .i2c_addr = SHT2X_PARAM_I2C_ADDR, \
55  .resolution = SHT2X_PARAM_RESOLUTION, \
56  .measure_mode = SHT2X_PARAM_MEASURE_MODE, \
57  .is_crc_enabled = SHT2X_PARAM_CRC_MODE, \
58  }
59 
60 #ifndef SHT2X_SAUL_INFO
61 #define SHT2X_SAUL_INFO { .name = "sht2x" }
62 #endif
63 
68 static const sht2x_params_t sht2x_params[] =
69 {
70 #ifdef SHT2X_PARAMS_BOARD
71  SHT2X_PARAMS_BOARD,
72 #else
73  SHT2X_PARAMS_DEFAULT,
74 #endif
75 };
76 
80 #define SHT2X_NUMOF ARRAY_SIZE(sht2x_params)
81 
90 {
91  SHT2X_SAUL_INFO
92 };
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* SHT2X_PARAMS_H */
99 
sht2x_params_t
Device initialization parameters.
Definition: sht2x.h:89
SHT2X_NUMOF
#define SHT2X_NUMOF
Get the number of configured SHT2X devices.
Definition: sht2x_params.h:80
saul_reg_info_t
Additional data to collect for each entry.
Definition: saul_reg.h:49
sht2x_saul_reg_info
static const saul_reg_info_t sht2x_saul_reg_info[SHT2X_NUMOF]
Configuration details of SAUL registry entries.
Definition: sht2x_params.h:89
sht2x_params
static const sht2x_params_t sht2x_params[]
Configure SHT2X.
Definition: sht2x_params.h:68
saul_reg.h
SAUL registry interface definition.
sht2x.h
Device driver implementation for the SHT2x temperature and humidity sensor.