ruuvi.drivers.c ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
Loading...
Searching...
No Matches
ruuvi_driver_enabled_modules.h
Go to the documentation of this file.
1
17#ifndef RUUVI_DRIVER_ENABLED_MODULES_H
18#define RUUVI_DRIVER_ENABLED_MODULES_H
19
21#define RUUVI_DRIVERS_SEMVER "3.11.0"
22
23#ifdef CEEDLING
24# define ENABLE_DEFAULT 1
25#elif defined(DOXYGEN)
26# define ENABLE_DEFAULT 1
27#elif defined(RUUVI_RUN_TESTS)
28# define ENABLE_DEFAULT 1
29#else
30# define ENABLE_DEFAULT 0
31#endif
32
33#ifdef APPLICATION_DRIVER_CONFIGURED
34#include "app_config.h"
35#endif
36
37#ifdef RUUVI_NRF5_SDK15_ENABLED
38#include "nrf5_sdk15_app_config.h"
39#endif
40
41#ifdef RUUVI_FRUITY_ENABLED
42#include "fruity_config.h"
43#endif
44
45#ifndef RI_ATOMIC_ENABLED
46# define RI_ATOMIC_ENABLED ENABLE_DEFAULT
47#endif
48
49#ifndef RD_LOG_BUFFER_SIZE
51# define RD_LOG_BUFFER_SIZE (128U)
52#endif
53
54#ifndef RT_ADC_ENABLED
56# define RT_ADC_ENABLED ENABLE_DEFAULT
57#endif
58
59#ifndef RI_COMM_ENABLED
61# define RI_COMM_ENABLED ENABLE_DEFAULT
62#endif
63
64#ifndef RI_AES_ENABLED
66# define RI_AES_ENABLED ENABLE_DEFAULT
67#endif
68
69#ifndef RI_RADIO_ENABLED
71# define RI_RADIO_ENABLED ENABLE_DEFAULT
72#endif
73
74
75#ifndef RT_ADV_ENABLED
77# define RT_ADV_ENABLED ENABLE_DEFAULT
78#endif
79
80#define RI_ADV_ENABLED RT_ADV_ENABLED
81
82#if RT_ADV_ENABLED && !(RI_COMM_ENABLED)
83# error "Advertisement task requires communication interface."
84#endif
85
86#if RT_ADV_ENABLED && !(RI_RADIO_ENABLED)
87# error "Advertisement task requires radio interface."
88#endif
89
90#ifndef RT_BUTTON_ENABLED
92# define RT_BUTTON_ENABLED ENABLE_DEFAULT
93#endif
94
95#ifndef RT_COMMUNICATION_ENABLED
96# define RT_COMMUNICATION_ENABLED ENABLE_DEFAULT
97#endif
98
99#ifndef RT_FLASH_ENABLED
101# define RT_FLASH_ENABLED ENABLE_DEFAULT
102#endif
103
104#ifndef RT_GATT_ENABLED
106# define RT_GATT_ENABLED ENABLE_DEFAULT
107#endif
108
109#if RT_GATT_ENABLED
110# define RI_GATT_ENABLED (1U)
111#endif
112
113#if RT_GATT_ENABLED && ((!RT_ADV_ENABLED) || !(RI_COMM_ENABLED))
114# error "GATT task requires Advertisement task and communication interface."
115#endif
116
117#if RT_GATT_ENABLED && ((!RT_ADV_ENABLED) || !(RI_RADIO_ENABLED))
118# error "GATT task requires Advertisement task and radio interface."
119#endif
120
121#ifndef RT_GPIO_ENABLED
123# define RT_GPIO_ENABLED ENABLE_DEFAULT
124#endif
125
126#if RT_GPIO_ENABLED
127# ifndef RT_GPIO_INT_TABLE_SIZE
128# if (!ENABLE_DEFAULT)
129# warning "Conserving space for 48 GPIOs, are you sure?"
130# endif
135# define RT_GPIO_INT_TABLE_SIZE 48
136# endif
137#endif
138
139#ifndef RI_I2C_ENABLED
140# define RI_I2C_ENABLED ENABLE_DEFAULT
141#endif
142
143#ifndef RT_LED_ENABLED
145# define RT_LED_ENABLED ENABLE_DEFAULT
146#endif
147
148#if RT_LED_ENABLED
149# if (!RT_GPIO_ENABLED)
150# error "LED task requires GPIO task"
151# endif
152# ifndef RT_MAX_LED_CFG
153# if (!ENABLE_DEFAULT)
154# warning "Conserving space for 48 LEDs, are you sure?"
155# endif
160# define RT_MAX_LED_CFG 48
161# endif
162#endif
163
164#ifndef RT_NFC_ENABLED
165# define RT_NFC_ENABLED ENABLE_DEFAULT
166#endif
167
168#if RT_NFC_ENABLED
169# ifndef RI_NFC_ENABLED
170# define RI_NFC_ENABLED 1
171# endif
172#endif
173
174#ifndef RI_RTC_ENABLED
175# define RI_RTC_ENABLED ENABLE_DEFAULT
176#endif
177
178#ifndef RI_SCHEDULER_ENABLED
179# define RI_SCHEDULER_ENABLED ENABLE_DEFAULT
180#endif
181
182#if RI_SCHEDULER_ENABLED
183# ifndef RI_SCHEDULER_LENGTH
184# define RI_SCHEDULER_LENGTH (10U)
185# endif
186# ifndef RI_SCHEDULER_SIZE
187# define RI_SCHEDULER_SIZE (32U)
188# endif
189#endif
190
191#ifndef RI_SPI_ENABLED
192# define RI_SPI_ENABLED ENABLE_DEFAULT
193#endif
194
195#if RI_TIMER_ENABLED
196# ifndef RI_TIMER_MAX_INSTANCES
197# define RI_TIMER_MAX_INSTANCES (10U)
198# endif
199#endif
200
201#ifndef RI_UART_ENABLED
202# define RI_UART_ENABLED ENABLE_DEFAULT
203#endif
204
205#ifndef RI_YIELD_ENABLED
206#define RI_YIELD_ENABLED ENABLE_DEFAULT
207#endif
208
209#ifndef RI_WATCHDOG_ENABLED
210#define RI_WATCHDOG_ENABLED ENABLE_DEFAULT
211#endif
212
214#ifndef RT_SENSOR_ENABLED
215# define RT_SENSOR_ENABLED ENABLE_DEFAULT
216#endif
217
218#ifndef RI_BME280_ENABLED
219# define RI_BME280_ENABLED ENABLE_DEFAULT
220# ifndef RI_BME280_SPI_ENABLED
221# define RI_BME280_SPI_ENABLED ENABLE_DEFAULT
222# endif
223# ifndef RI_BME280_I2C_ENABLED
224# define RI_BME280_I2C_ENABLED ENABLE_DEFAULT
225# endif
226#endif
227
228#ifndef RI_DPS310_ENABLED
229# define RI_DPS310_ENABLED ENABLE_DEFAULT
230# ifndef RI_DPS310_SPI_ENABLED
231# define RI_DPS310_SPI_ENABLED ENABLE_DEFAULT
232# endif
233# ifndef RI_DPS310_I2C_ENABLED
234# define RI_DPS310_I2C_ENABLED ENABLE_DEFAULT
235# endif
236#endif
237
238#ifndef RI_LIS2DH12_ENABLED
239# define RI_LIS2DH12_ENABLED ENABLE_DEFAULT
240#endif
241
242#ifndef RI_TMP117_ENABLED
243# define RI_TMP117_ENABLED ENABLE_DEFAULT
244#endif
245
246#ifndef RI_SHTCX_ENABLED
247# define RI_SHTCX_ENABLED ENABLE_DEFAULT
248#endif
249
250#ifndef RI_ADC_PHOTO_ENABLED
251# define RI_ADC_PHOTO_ENABLED ENABLE_DEFAULT
252#endif
253
254#ifndef RUUVI_NRF5_SDK15_NRF52832_ENVIRONMENTAL_ENABLED
255# define RUUVI_NRF5_SDK15_NRF52832_ENVIRONMENTAL_ENABLED ENABLE_DEFAULT
256#endif
257
258// TODO: Refactor configuration constants elsewhere
259# define RI_ADC_PHOTO_CHANNEL 2
260# define RI_ADC_PHOTO_DIVIDER 1.00f
261
262#ifndef RI_ADC_NTC_ENABLED
263# define RI_ADC_NTC_ENABLED ENABLE_DEFAULT
264#endif
265// TODO: Refactor configuration constants elsewhere
266// NTC is installed as VDD - fixed resistor - ADC - NTC - GND.
267#define RI_ADC_NTC_CHANNEL 1
268#define RI_ADC_NTC_DIVIDER 1.00f
269#define RI_ADC_NTC_BALANCE 10000.00f
270#define RI_ADC_NTC_DEFAULT_RES 10000.00f
271#define RI_ADC_NTC_DEFAULT_TEMP 25.00f
272#define RI_ADC_NTC_DEFAULT_BETA 3974.0f
273
274
275#endif