Loading...
Searching...
No Matches
bme680_params.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Mesotic SAS
3 * SPDX-FileCopyrightText: 2020 Gunar Schorcht
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
19
20#include "board.h"
21#include "bme680.h"
22#include "saul_reg.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
32
33#if MODULE_PERIPH_I2C || DOXYGEN
34#ifndef BME680_PARAM_I2C_DEV
35#define BME680_PARAM_I2C_DEV (I2C_DEV(0))
36#endif
37
38#ifndef BME680_PARAM_I2C_ADDR
39#define BME680_PARAM_I2C_ADDR (BME680_I2C_ADDR_2)
40#endif
41#endif /* MODULE_PERIPH_I2C */
42
43#if MODULE_PERIPH_SPI || DOXYGEN
44#ifndef BME680_PARAM_SPI_DEV
45#define BME680_PARAM_SPI_DEV (SPI_DEV(0))
46#endif
47
48#ifndef BME680_PARAM_SPI_NSS_PIN
49#define BME680_PARAM_SPI_NSS_PIN GPIO_PIN(0, 5)
50#endif
51#endif /* MODULE_PERIPH_SPI */
52
56#define BME680_PARAMS_I2C \
57{ \
58 .ifsel = BME680_I2C_INTF, \
59 .temp_os = BME680_OS_8X, \
60 .hum_os = BME680_OS_2X, \
61 .pres_os = BME680_OS_4X, \
62 .filter = BME680_FILTER_SIZE_3, \
63 .gas_measure = BME680_ENABLE_GAS_MEAS, \
64 .heater_dur = 320, \
65 .heater_temp = 150, \
66 .settings = BME680_OST_SEL | \
67 BME680_OSP_SEL | \
68 BME680_OSH_SEL | \
69 BME680_FILTER_SEL | \
70 BME680_GAS_SENSOR_SEL, \
71 .intf.i2c.dev = BME680_PARAM_I2C_DEV, \
72 .intf.i2c.addr = BME680_PARAM_I2C_ADDR, \
73}
74
78#define BME680_PARAMS_SPI \
79{ \
80 .ifsel = BME680_SPI_INTF, \
81 .temp_os = BME680_OS_8X, \
82 .hum_os = BME680_OS_2X, \
83 .pres_os = BME680_OS_4X, \
84 .filter = BME680_FILTER_SIZE_3, \
85 .gas_measure = BME680_ENABLE_GAS_MEAS, \
86 .heater_dur = 320, \
87 .heater_temp = 150, \
88 .settings = BME680_OST_SEL | \
89 BME680_OSP_SEL | \
90 BME680_OSH_SEL | \
91 BME680_FILTER_SEL | \
92 BME680_GAS_SENSOR_SEL, \
93 .intf.spi.dev = BME680_PARAM_SPI_DEV, \
94 .intf.spi.nss_pin = BME680_PARAM_SPI_NSS_PIN, \
95}
96
100#ifndef BME680_SAUL_INFO
101#if MODULE_BME680_I2C && MODULE_BME680_SPI
102#define BME680_SAUL_INFO { .name = "bme680:0" }, \
103 { .name = "bme680:1" },
104#else /* MODULE_BME680_I2C && MODULE_BME680_SPI */
105#define BME680_SAUL_INFO { .name = "bme680" }
106#endif /* MODULE_BME680_I2C && MODULE_BME680_SPI */
107#endif /* BME680_SAUL_INFO */
109
114{
115#if MODULE_BME680_I2C || DOXYGEN
117#endif
118#if MODULE_BME680_SPI || DOXYGEN
120#endif
121};
122
127{
129};
130
134#define BME680_NUMOF ARRAY_SIZE(bme680_params)
135
136#ifdef __cplusplus
137}
138#endif
139
Interface definition for the Bosch BME680 sensor.
#define BME680_SAUL_INFO
Default SAUL meta information.
#define BME680_PARAMS_I2C
Defaults I2C parameters if none provided.
#define BME680_PARAMS_SPI
Defaults SPI parameters if none provided.
static const saul_reg_info_t bme680_saul_info[]
Additional meta information to keep in the SAUL registry.
static const bme680_params_t bme680_params[]
Configure params for BME680.
SAUL registry interface definition.
BME680 device initialization parameters.
Definition bme680.h:215
Additional data to collect for each entry.
Definition saul_reg.h:48