abp2_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 CNRS, France
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
22 #include "board.h"
23 #include "saul_reg.h"
24 #include "abp2.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
35 #ifdef MODULE_ABP2_SPI /* default configuration for SPI version */
36 
37 #ifndef ABP2_PARAM_SPI
38 #define ABP2_PARAM_SPI (SPI_DEV(0))
39 #endif
40 #ifndef ABP2_PARAM_CLK
41 #define ABP2_PARAM_CLK (SPI_CLK_400KHZ)
42 #endif
43 #ifndef ABP2_PARAM_CS
44 #define ABP2_PARAM_CS (GPIO_PIN(0, 0))
45 #endif
46 #ifndef ABP2_PARAM_BUSCFG
47 #define ABP2_PARAM_BUSCFG .spi = ABP2_PARAM_SPI, \
48  .cs = ABP2_PARAM_CS, \
49  .clk = ABP2_PARAM_CLK
50 #endif
51 
52 #elif defined(MODULE_ABP2_I2C) /* default configuration for I2C version */
53 
54 #ifndef ABP2_PARAM_I2C
55 #define ABP2_PARAM_I2C I2C_DEV(0)
56 #endif
57 #ifndef ABP2_PARAM_BUSCFG
58 #define ABP2_PARAM_BUSCFG .i2c = ABP2_PARAM_I2C
59 #endif
60 #endif /* end of interface-specific configuration */
61 
62 /* By default, pick a sensor with a 0..160mbar range. */
63 #ifndef ABP2_PARAM_RNGMIN
65 #define ABP2_PARAM_RNGMIN (0)
66 #endif
67 #ifndef ABP2_PARAM_RNGMAX
69 #define ABP2_PARAM_RNGMAX (160000)
70 #endif
71 
72 #ifndef ABP2_PARAMS
74 #define ABP2_PARAMS { \
75  ABP2_PARAM_BUSCFG, \
76  .rangeMin = ABP2_PARAM_RNGMIN, \
77  .rangeMax = ABP2_PARAM_RNGMAX \
78  }
79 #endif
80 #ifndef ABP2_SAUL_INFO
82 #define ABP2_SAUL_INFO \
83  { { .name = "Pressure sensor (abp2)" }, \
84  { .name = "Temperature sensor (abp2)" } \
85  }
86 #endif
100 static const abp2_params_t abp2_params[] =
101 {
103 };
104 
108 static const saul_reg_info_t abp2_saul_info[][2] =
109 {
111 };
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
Honeywell ABP2 series pressure and temperature sensor driver.
#define ABP2_PARAMS
Default sensor parameters.
Definition: abp2_params.h:74
static const saul_reg_info_t abp2_saul_info[][2]
Additional meta information to keep in the SAUL registry.
Definition: abp2_params.h:108
#define ABP2_SAUL_INFO
Sensor driver name in the SAUL framework.
Definition: abp2_params.h:82
SAUL registry interface definition.
Parameters for ABP2 sensors.
Definition: abp2.h:132
Additional data to collect for each entry.
Definition: saul_reg.h:48