Loading...
Searching...
No Matches
abp2_params.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 CNRS, France
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include "board.h"
20#include "saul_reg.h"
21#include "abp2.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
31
32#ifdef MODULE_ABP2_SPI /* default configuration for SPI version */
33
34#ifndef ABP2_PARAM_SPI
35#define ABP2_PARAM_SPI (SPI_DEV(0))
36#endif
37#ifndef ABP2_PARAM_CLK
38#define ABP2_PARAM_CLK (SPI_CLK_400KHZ)
39#endif
40#ifndef ABP2_PARAM_CS
41#define ABP2_PARAM_CS (GPIO_PIN(0, 0))
42#endif
43#ifndef ABP2_PARAM_BUSCFG
44#define ABP2_PARAM_BUSCFG .spi = ABP2_PARAM_SPI, \
45 .cs = ABP2_PARAM_CS, \
46 .clk = ABP2_PARAM_CLK
47#endif
48
49#elif defined(MODULE_ABP2_I2C) /* default configuration for I2C version */
50
51#ifndef ABP2_PARAM_I2C
52#define ABP2_PARAM_I2C I2C_DEV(0)
53#endif
54#ifndef ABP2_PARAM_BUSCFG
55#define ABP2_PARAM_BUSCFG .i2c = ABP2_PARAM_I2C
56#endif
57#endif /* end of interface-specific configuration */
58
59/* By default, pick a sensor with a 0..160mbar range. */
60#ifndef ABP2_PARAM_RNGMIN
62#define ABP2_PARAM_RNGMIN (0)
63#endif
64#ifndef ABP2_PARAM_RNGMAX
66#define ABP2_PARAM_RNGMAX (160000)
67#endif
68
69#ifndef ABP2_PARAMS
71#define ABP2_PARAMS { \
72 ABP2_PARAM_BUSCFG, \
73 .rangeMin = ABP2_PARAM_RNGMIN, \
74 .rangeMax = ABP2_PARAM_RNGMAX \
75 }
76#endif
77#ifndef ABP2_SAUL_INFO
79#define ABP2_SAUL_INFO \
80 { { .name = "Pressure sensor (abp2)" }, \
81 { .name = "Temperature sensor (abp2)" } \
82 }
83#endif
85
97static const abp2_params_t abp2_params[] =
98{
100};
101
106{
108};
109
110#ifdef __cplusplus
111}
112#endif
113
Honeywell ABP2 series pressure and temperature sensor driver.
#define ABP2_PARAMS
Default sensor parameters.
Definition abp2_params.h:71
static const saul_reg_info_t abp2_saul_info[][2]
Additional meta information to keep in the SAUL registry.
#define ABP2_SAUL_INFO
Sensor driver name in the SAUL framework.
Definition abp2_params.h:79
struct abp2_params abp2_params_t
Parameters for ABP2 sensors.
SAUL registry interface definition.
Parameters for ABP2 sensors.
Definition abp2.h:132
Additional data to collect for each entry.
Definition saul_reg.h:48