Loading...
Searching...
No Matches
bmx280_params.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Kees Bakker, SODAQ
3 * SPDX-FileCopyrightText: 2017 Inria
4 * SPDX-FileCopyrightText: 2018 Freie Universität Berlin
5 * SPDX-License-Identifier: LGPL-2.1-only
6 */
7
8#pragma once
9
21
22#include "board.h"
23#include "bmx280.h"
24#include "kernel_defines.h"
25#include "saul_reg.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
35#ifdef BMX280_USE_SPI
36/* SPI configuration */
37#ifndef BMX280_PARAM_SPI
38#define BMX280_PARAM_SPI SPI_DEV(0)
39#endif
40#ifndef BMX280_PARAM_CLK
41#define BMX280_PARAM_CLK SPI_CLK_5MHZ
42#endif
43#ifndef BMX280_PARAM_CS
44#define BMX280_PARAM_CS GPIO_PIN(0, 0)
45#endif
46#else
47/* I2C configuration */
48#ifndef BMX280_PARAM_I2C_DEV
49#define BMX280_PARAM_I2C_DEV I2C_DEV(0)
50#endif
51#ifndef BMX280_PARAM_I2C_ADDR
52#define BMX280_PARAM_I2C_ADDR (0x77)
53#endif
54#endif
55
56#define BMX280_PARAM_MISC \
57 .t_sb = BMX280_SB_0_5, \
58 .filter = BMX280_FILTER_OFF, \
59 .run_mode = BMX280_MODE_FORCED, \
60 .temp_oversample = BMX280_OSRS_X1, \
61 .press_oversample = BMX280_OSRS_X1, \
62 .humid_oversample = BMX280_OSRS_X1, \
63
64/* Defaults for Weather Monitoring */
65#ifndef BMX280_PARAMS
66#ifdef BMX280_USE_SPI
67#define BMX280_PARAMS \
68 { \
69 .spi = BMX280_PARAM_SPI, \
70 .clk = BMX280_PARAM_CLK, \
71 .cs = BMX280_PARAM_CS, \
72 BMX280_PARAM_MISC \
73 }
74#else
75#define BMX280_PARAMS \
76 { \
77 .i2c_dev = BMX280_PARAM_I2C_DEV, \
78 .i2c_addr = BMX280_PARAM_I2C_ADDR, \
79 BMX280_PARAM_MISC \
80 }
81#endif
82#endif
84
89{
90 BMX280_PARAMS
91};
92
96#define BMX280_NUMOF ARRAY_SIZE(bmx280_params)
97
106{
107#if defined(MODULE_BME280_SPI) || defined(MODULE_BME280_I2C)
108 { .name = "bme280" }
109#else
110 { .name = "bmp280" }
111#endif
112};
113
114#ifdef __cplusplus
115}
116#endif
117
Device driver interface for the BMP280 and BME280 sensors.
static const saul_reg_info_t bmx280_saul_reg_info[BMX280_NUMOF]
Configuration details of SAUL registry entries.
static const bmx280_params_t bmx280_params[]
Configure BMX280.
#define BMX280_NUMOF
The number of configured sensors.
Common macros and compiler attributes/pragmas configuration.
SAUL registry interface definition.
Parameters for the BMX280 sensor.
Definition bmx280.h:182
Additional data to collect for each entry.
Definition saul_reg.h:48