Loading...
Searching...
No Matches
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
30extern "C" {
31#endif
32
33#if !DOXYGEN
34/* Mapping of Kconfig defines to the respective driver enumeration values */
35
36#if CONFIG_SHT2X_RES_12_14BIT
37#define CONFIG_SHT2X_RESOLUTION (SHT2X_RES_12_14BIT)
38#elif CONFIG_SHT2X_RES_11_11BIT
39#define CONFIG_SHT2X_RESOLUTION (SHT2X_RES_11_11BIT)
40#elif CONFIG_SHT2X_RES_10_13BIT
41#define CONFIG_SHT2X_RESOLUTION (SHT2X_RES_10_13BIT)
42#elif CONFIG_SHT2X_RES_8_12BIT
43#define CONFIG_SHT2X_RESOLUTION (SHT2X_RES_8_12BIT)
44#else
45#define CONFIG_SHT2X_RESOLUTION (SHT2X_RES_12_14BIT)
46#endif
47
48#if CONFIG_SHT2X_MEASURE_MODE_HOLD
49#define CONFIG_SHT2X_MEASURE_MODE (SHT2X_MEASURE_MODE_HOLD)
50#elif CONFIG_SHT2X_MEASURE_MODE_NO_HOLD
51#define CONFIG_SHT2X_MEASURE_MODE (SHT2X_MEASURE_MODE_NO_HOLD)
52#else
53#define CONFIG_SHT2X_MEASURE_MODE (SHT2X_MEASURE_MODE_NO_HOLD)
54#endif
55
56#ifndef CONFIG_SHT2X_CRC_MODE
57#define CONFIG_SHT2X_CRC_MODE (1)
58#endif
59
60#endif /* !DOXYGEN */
61
66#ifndef SHT2X_PARAM_I2C_DEV
68#define SHT2X_PARAM_I2C_DEV (I2C_DEV(0))
69#endif
70
71#ifndef SHT2X_PARAM_I2C_ADDR
73#define SHT2X_PARAM_I2C_ADDR (0x40)
74#endif
81#ifndef SHT2X_PARAM_RESOLUTION
83#define SHT2X_PARAM_RESOLUTION (CONFIG_SHT2X_RESOLUTION)
84#endif
85
86#ifndef SHT2X_PARAM_MEASURE_MODE
88#define SHT2X_PARAM_MEASURE_MODE (CONFIG_SHT2X_MEASURE_MODE)
89#endif
90
91#ifndef SHT2X_PARAM_CRC_MODE
93#define SHT2X_PARAM_CRC_MODE (CONFIG_SHT2X_CRC_MODE)
94#endif
95
97#define SHT2X_PARAMS_DEFAULT {.i2c_dev = SHT2X_PARAM_I2C_DEV, \
98 .i2c_addr = SHT2X_PARAM_I2C_ADDR, \
99 .resolution = SHT2X_PARAM_RESOLUTION, \
100 .measure_mode = SHT2X_PARAM_MEASURE_MODE, \
101 .is_crc_enabled = SHT2X_PARAM_CRC_MODE, \
102 }
103
104#ifndef SHT2X_SAUL_INFO
106#define SHT2X_SAUL_INFO { .name = "sht2x" }
107#endif
114{
115#ifdef SHT2X_PARAMS_BOARD
116 SHT2X_PARAMS_BOARD,
117#else
119#endif
120};
121
125#define SHT2X_NUMOF ARRAY_SIZE(sht2x_params)
126
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif /* SHT2X_PARAMS_H */
SAUL registry interface definition.
Device driver implementation for the SHT2x humidity and temperature humidity sensor.
#define SHT2X_PARAMS_DEFAULT
Default SHT2x parameter set.
static const sht2x_params_t sht2x_params[]
Configure SHT2X.
#define SHT2X_SAUL_INFO
Default SAUL device info.
#define SHT2X_NUMOF
Get the number of configured SHT2X devices.
static const saul_reg_info_t sht2x_saul_reg_info[SHT2X_NUMOF]
Configuration details of SAUL registry entries.
Additional data to collect for each entry.
Definition saul_reg.h:49
Device initialization parameters.
Definition sht2x.h:89