c13dof  2.0.0.0
c13dof.h
Go to the documentation of this file.
1 /*
2  * MikroSDK - MikroE Software Development Kit
3  * Copyright (c) 2019, MikroElektronika - www.mikroe.com
4 // * All rights reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 
33 // ----------------------------------------------------------------------------
34 
35 #ifndef C13DOF_H
36 #define C13DOF_H
37 
38 #include "mikrosdk_version.h"
39 
40 #ifdef __GNUC__
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
43 #else
44 #include "delays.h"
45 #endif
46 #endif
47 
48 #include "drv_digital_out.h"
49 #include "drv_digital_in.h"
50 #include "drv_i2c_master.h"
51 
52 
53 // -------------------------------------------------------------- PUBLIC MACROS
63 #define C13DOF_MAP_MIKROBUS( cfg, mikrobus ) \
64  cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
65  cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
66 
72 #define C13DOF_RETVAL uint8_t
73 
74 #define C13DOF_OK 0x00
75 #define C13DOF_INIT_ERROR 0xFF
76 
78 #define C13DOF_POLL_PERIOD_MS 10
79 
84 #define C13DOF_BME680_DEVICE_SLAVE_ADDR_0 0x76
85 #define C13DOF_BME680_DEVICE_SLAVE_ADDR_1 0x77
86 #define C13DOF_BME680_CHIP_ID 0x61
87 #define C13DOF_BME680_COEFF_SIZE 41
88 #define C13DOF_BME680_COEFF_ADDR1_LEN 25
89 #define C13DOF_BME680_COEFF_ADDR2_LEN 16
90 #define C13DOF_BME680_FIELD_LENGTH 15
91 #define C13DOF_BME680_FIELD_ADDR_OFFSET 17
92 #define C13DOF_BME680_SOFT_RESET_CMD 0xB6
93 #define C13DOF_BME680_DEVICE_OK 0
94 #define C13DOF_BME680_DEVICE_ERROR 1
95 #define C13DOF_BME680_E_NULL_PTR -1
96 #define C13DOF_BME680_E_COM_FAIL -2
97 #define C13DOF_BME680_E_DEV_NOT_FOUND -3
98 #define C13DOF_BME680_E_INVALID_LENGTH -4
99 #define C13DOF_BME680_W_DEFINE_PWR_MODE 1
100 #define C13DOF_BME680_W_NO_NEW_DATA 2
101 #define C13DOF_BME680_I_MIN_CORRECTION 1
102 #define C13DOF_BME680_I_MAX_CORRECTION 2
103 #define C13DOF_BME680_ADDR_RES_HEAT_VAL_ADDR 0x00
104 #define C13DOF_BME680_ADDR_RES_HEAT_RANGE_ADDR 0x02
105 #define C13DOF_BME680_ADDR_RANGE_SW_ERR_ADDR 0x04
106 #define C13DOF_BME680_ADDR_SENS_CONF_START 0x5A
107 #define C13DOF_BME680_ADDR_GAS_CONF_START 0x64
108 #define C13DOF_BME680_FIELD0_ADDR 0x1D
109 #define C13DOF_BME680_RES_HEAT0_ADDR 0x5A
110 #define C13DOF_BME680_GAS_WAIT0_ADDR 0x64
111 #define C13DOF_BME680_CONF_HEAT_CTRL_ADDR 0x70
112 #define C13DOF_BME680_CONF_ODR_RUN_GAS_NBC_ADDR 0x71
113 #define C13DOF_BME680_CONF_OS_H_ADDR 0x72
114 #define C13DOF_BME680_MEM_PAGE_ADDR 0xf3
115 #define C13DOF_BME680_CONF_T_P_MODE_ADDR 0x74
116 #define C13DOF_BME680_CONF_ODR_FILT_ADDR 0x75
117 #define C13DOF_BME680_COEFF_ADDR1 0x89
118 #define C13DOF_BME680_COEFF_ADDR2 0xe1
119 #define C13DOF_BME680_CHIP_ID_ADDR 0xD0
120 #define C13DOF_BME680_SOFT_RESET_ADDR 0xE0
121 #define C13DOF_BME680_ENABLE_HEATER 0x00
122 #define C13DOF_BME680_DISABLE_HEATER 0x08
123 #define C13DOF_BME680_DISABLE_GAS_MEAS 0x00
124 #define C13DOF_BME680_ENABLE_GAS_MEAS 0x01
125 #define C13DOF_BME680_OS_NONE 0
126 #define C13DOF_BME680_OS_1X 1
127 #define C13DOF_BME680_OS_2X 2
128 #define C13DOF_BME680_OS_4X 3
129 #define C13DOF_BME680_OS_8X 4
130 #define C13DOF_BME680_OS_16X 5
131 #define C13DOF_BME680_FILTER_SIZE_0 0
132 #define C13DOF_BME680_FILTER_SIZE_1 1
133 #define C13DOF_BME680_FILTER_SIZE_3 2
134 #define C13DOF_BME680_FILTER_SIZE_7 3
135 #define C13DOF_BME680_FILTER_SIZE_15 4
136 #define C13DOF_BME680_FILTER_SIZE_31 5
137 #define C13DOF_BME680_FILTER_SIZE_63 6
138 #define C13DOF_BME680_FILTER_SIZE_127 7
139 #define C13DOF_BME680_SLEEP_MODE 0
140 #define C13DOF_BME680_FORCED_MODE 1
141 #define C13DOF_BME680_RESET_PERIOD 10
142 #define C13DOF_BME680_MEM_PAGE0 0x10
143 #define C13DOF_BME680_MEM_PAGE1 0x00
144 #define C13DOF_BME680_HUM_REG_SHIFT_VAL 4
145 #define C13DOF_BME680_RUN_GAS_DISABLE 0
146 #define C13DOF_BME680_RUN_GAS_ENABLE 1
147 #define C13DOF_BME680_TMP_BUFFER_LENGTH 40
148 #define C13DOF_BME680_REG_BUFFER_LENGTH 6
149 #define C13DOF_BME680_FIELD_DATA_LENGTH 3
150 #define C13DOF_BME680_GAS_REG_BUF_LENGTH 20
151 #define C13DOF_BME680_OST_SEL 1
152 #define C13DOF_BME680_OSP_SEL 2
153 #define C13DOF_BME680_OSH_SEL 4
154 #define C13DOF_BME680_GAS_MEAS_SEL 8
155 #define C13DOF_BME680_FILTER_SEL 16
156 #define C13DOF_BME680_HCNTRL_SEL 32
157 #define C13DOF_BME680_RUN_GAS_SEL 64
158 #define C13DOF_BME680_NBCONV_SEL 128
159 #define C13DOF_BME680_GAS_SENSOR_SEL ( C13DOF_BME680_GAS_MEAS_SEL | \
160  C13DOF_BME680_RUN_GAS_SEL | \
161  C13DOF_BME680_NBCONV_SEL )
162 #define C13DOF_BME680_NBCONV_MIN 0
163 #define C13DOF_BME680_NBCONV_MAX 10
164 #define C13DOF_BME680_GAS_MEAS_MSK 0x30
165 #define C13DOF_BME680_NBCONV_MSK 0X0F
166 #define C13DOF_BME680_FILTER_MSK 0X1C
167 #define C13DOF_BME680_OST_MSK 0XE0
168 #define C13DOF_BME680_OSP_MSK 0X1C
169 #define C13DOF_BME680_OSH_MSK 0X07
170 #define C13DOF_BME680_HCTRL_MSK 0x08
171 #define C13DOF_BME680_RUN_GAS_MSK 0x10
172 #define C13DOF_BME680_MODE_MSK 0x03
173 #define C13DOF_BME680_RHRANGE_MSK 0x30
174 #define C13DOF_BME680_RSERROR_MSK 0xf0
175 #define C13DOF_BME680_NEW_DATA_MSK 0x80
176 #define C13DOF_BME680_GAS_INDEX_MSK 0x0f
177 #define C13DOF_BME680_GAS_RANGE_MSK 0x0f
178 #define C13DOF_BME680_GASM_VALID_MSK 0x20
179 #define C13DOF_BME680_HEAT_STAB_MSK 0x10
180 #define C13DOF_BME680_MEM_PAGE_MSK 0x10
181 #define C13DOF_BME680_SPI_RD_MSK 0x80
182 #define C13DOF_BME680_SPI_WR_MSK 0x7f
183 #define C13DOF_BME680_BIT_H1_DATA_MSK 0x0F
184 #define C13DOF_BME680_GAS_MEAS_POS 4
185 #define C13DOF_BME680_FILTER_POS 2
186 #define C13DOF_BME680_OST_POS 5
187 #define C13DOF_BME680_OSP_POS 2
188 #define C13DOF_BME680_RUN_GAS_POS 4
189 #define C13DOF_BME680_T2_LSB_REG 1
190 #define C13DOF_BME680_T2_MSB_REG 2
191 #define C13DOF_BME680_T3_REG 3
192 #define C13DOF_BME680_P1_LSB_REG 5
193 #define C13DOF_BME680_P1_MSB_REG 6
194 #define C13DOF_BME680_P2_LSB_REG 7
195 #define C13DOF_BME680_P2_MSB_REG 8
196 #define C13DOF_BME680_P3_REG 9
197 #define C13DOF_BME680_P4_LSB_REG 11
198 #define C13DOF_BME680_P4_MSB_REG 12
199 #define C13DOF_BME680_P5_LSB_REG 13
200 #define C13DOF_BME680_P5_MSB_REG 14
201 #define C13DOF_BME680_P7_REG 15
202 #define C13DOF_BME680_P6_REG 16
203 #define C13DOF_BME680_P8_LSB_REG 19
204 #define C13DOF_BME680_P8_MSB_REG 20
205 #define C13DOF_BME680_P9_LSB_REG 21
206 #define C13DOF_BME680_P9_MSB_REG 22
207 #define C13DOF_BME680_P10_REG 23
208 #define C13DOF_BME680_H2_MSB_REG 25
209 #define C13DOF_BME680_H2_LSB_REG 26
210 #define C13DOF_BME680_H1_LSB_REG 26
211 #define C13DOF_BME680_H1_MSB_REG 27
212 #define C13DOF_BME680_H3_REG 28
213 #define C13DOF_BME680_H4_REG 29
214 #define C13DOF_BME680_H5_REG 30
215 #define C13DOF_BME680_H6_REG 31
216 #define C13DOF_BME680_H7_REG 32
217 #define C13DOF_BME680_T1_LSB_REG 33
218 #define C13DOF_BME680_T1_MSB_REG 34
219 #define C13DOF_BME680_GH2_LSB_REG 35
220 #define C13DOF_BME680_GH2_MSB_REG 36
221 #define C13DOF_BME680_GH1_REG 37
222 #define C13DOF_BME680_GH3_REG 38
223 #define C13DOF_BME680_REG_FILTER_INDEX 5
224 #define C13DOF_BME680_REG_TEMP_INDEX 4
225 #define C13DOF_BME680_REG_PRES_INDEX 4
226 #define C13DOF_BME680_REG_HUM_INDEX 2
227 #define C13DOF_BME680_REG_NBCONV_INDEX 1
228 #define C13DOF_BME680_REG_RUN_GAS_INDEX 1
229 #define C13DOF_BME680_REG_HCTRL_INDEX 0
230 #define C13DOF_BME680_MAX_OVERFLOW_VAL 0x40000000
231 #define C13DOF_BME680_DATA_TEMPERATURE 0x01
232 #define C13DOF_BME680_DATA_PRESSURE 0x02
233 #define C13DOF_BME680_DATA_HUMIDITY 0x03
234 #define C13DOF_BME680_OK 0x01
235 #define C13DOF_BME680_ERROR 0x00
236 
242 #define C13DOF_BMM150_DEVICE_SLAVE_ADDR 0x10
243 #define C13DOF_BMM150_DUMMY 0x00
244 #define C13DOF_BMM150_ID_REG 0x40
245 #define C13DOF_BMM150_RESERVED1_REG 0x41
246 #define C13DOF_BMM150_DATAX_LSB_REG 0x42
247 #define C13DOF_BMM150_DATAX_MSB_REG 0x43
248 #define C13DOF_BMM150_DATAY_LSB_REG 0x44
249 #define C13DOF_BMM150_DATAY_MSB_REG 0x45
250 #define C13DOF_BMM150_DATAZ_LSB_REG 0x46
251 #define C13DOF_BMM150_DATAZ_MSB_REG 0x47
252 #define C13DOF_BMM150_RHALL_LSB_REG 0x48
253 #define C13DOF_BMM150_RHALL_MSB_REG 0x49
254 #define C13DOF_BMM150_INTERRUPT_STATUS_REG 0x4A
255 #define C13DOF_BMM150_POWER_AND_RESET_CON_REG 0x4B
256 #define C13DOF_BMM150_DATARATE_AND_OPMODE_CON_REG 0x4C
257 #define C13DOF_BMM150_INTERR_AND_AXIS_EN_REG 0x4D
258 #define C13DOF_BMM150_INTERR_AND_CHANNEL_EN_REG 0x4E
259 #define C13DOF_BMM150_LOW_THRESHOLD_REG 0x4F
260 #define C13DOF_BMM150_HIGH_THRESHOLD_REG 0x50
261 #define C13DOF_BMM150_REPETITION_XY_CON_REG 0x51
262 #define C13DOF_BMM150_REPETITION_Z_CON_REG 0x52
263 #define C13DOF_BMM150_RESERVED2_REG 0x53
264 #define C13DOF_BMM150_RESERVED3_REG 0x54
265 #define C13DOF_BMM150_RESERVED4_REG 0x55
266 #define C13DOF_BMM150_RESERVED5_REG 0x56
267 #define C13DOF_BMM150_RESERVED6_REG 0x57
268 #define C13DOF_BMM150_RESERVED7_REG 0x58
269 #define C13DOF_BMM150_RESERVED8_REG 0x59
270 #define C13DOF_BMM150_RESERVED9_REG 0x5A
271 #define C13DOF_BMM150_RESERVED10_REG 0x5B
272 #define C13DOF_BMM150_RESERVED11_REG 0x5C
273 #define C13DOF_BMM150_RESERVED12_REG 0x5D
274 #define C13DOF_BMM150_RESERVED13_REG 0x5E
275 #define C13DOF_BMM150_RESERVED14_REG 0x5F
276 #define C13DOF_BMM150_RESERVED15_REG 0x60
277 #define C13DOF_BMM150_RESERVED16_REG 0x61
278 #define C13DOF_BMM150_RESERVED17_REG 0x62
279 #define C13DOF_BMM150_RESERVED18_REG 0x63
280 #define C13DOF_BMM150_RESERVED19_REG 0x64
281 #define C13DOF_BMM150_RESERVED20_REG 0x65
282 #define C13DOF_BMM150_RESERVED21_REG 0x66
283 #define C13DOF_BMM150_RESERVED22_REG 0x67
284 #define C13DOF_BMM150_RESERVED23_REG 0x68
285 #define C13DOF_BMM150_RESERVED24_REG 0x69
286 #define C13DOF_BMM150_RESERVED25_REG 0x6A
287 #define C13DOF_BMM150_RESERVED26_REG 0x6B
288 #define C13DOF_BMM150_RESERVED27_REG 0x6C
289 #define C13DOF_BMM150_RESERVED28_REG 0x6D
290 #define C13DOF_BMM150_RESERVED29_REG 0x6E
291 #define C13DOF_BMM150_RESERVED30_REG 0x6F
292 #define C13DOF_BMM150_RESERVED31_REG 0x70
293 #define C13DOF_BMM150_RESERVED32_REG 0x71
294 #define C13DOF_BMM150_OK 0x00
295 #define C13DOF_BMM150_ADDR_ERR 0x01
296 #define C13DOF_BMM150_INTERRUPT_OCCURED 0x02
297 #define C13DOF_BMM150_NBYTES_ERR 0x03
298 #define C13DOF_BMM150_DATA_READY 0x01
299 #define C13DOF_BMM150_DATA_NOT_READY 0x00
300 #define C13DOF_BMM150_SUSPEND_MODE_SPI4_EN 0x00
301 #define C13DOF_BMM150_SLEEP_MODE 0x01
302 #define C13DOF_BMM150_SOFT_RESET_EN 0x82
303 #define C13DOF_BMM150_SPI3_EN 0x04
304 #define C13DOF_BMM150_NORMAL_OPMODE_DR_10HZ 0x00
305 #define C13DOF_BMM150_FORCED_OPMODE 0x02
306 #define C13DOF_BMM150_SLEEP_OPMODE 0x06
307 #define C13DOF_BMM150_DR_2HZ 0x08
308 #define C13DOF_BMM150_DR_6HZ 0x10
309 #define C13DOF_BMM150_DR_8HZ 0x18
310 #define C13DOF_BMM150_DR_15HZ 0x20
311 #define C13DOF_BMM150_DR_20HZ 0x28
312 #define C13DOF_BMM150_DR_25HZ 0x30
313 #define C13DOF_BMM150_DR_30HZ 0x38
314 #define C13DOF_BMM150_INTERR_DISABLED_THRESHOLDS_ENABLED 0x00
315 #define C13DOF_BMM150_LOWTHRESHOLD_X_DISABLED 0x01
316 #define C13DOF_BMM150_LOWTHRESHOLD_Y_DISABLED 0x02
317 #define C13DOF_BMM150_LOWTHRESHOLD_Z_DISABLED 0x04
318 #define C13DOF_BMM150_HIGHTHRESHOLD_X_DISABLED 0x08
319 #define C13DOF_BMM150_HIGHTHRESHOLD_Y_DISABLED 0x10
320 #define C13DOF_BMM150_HIGHTHRESHOLD_Z_DISABLED 0x20
321 #define C13DOF_BMM150_OVERFLOW_PIN_IND_EN 0x40
322 #define C13DOF_BMM150_DATAOVERRUN_IND_EN 0x80
323 #define C13DOF_BMM150_CHANNELS_ENABLED_INTERR_DATAREADY_ACTIVE_LOW 0x00
324 #define C13DOF_BMM150_INTERR_PIN_ACTIVE_HIGH 0x01
325 #define C13DOF_BMM150_INTERR_LATCHED 0x02
326 #define C13DOF_BMM150_DATAREADY_ACTIVE_HIGH 0x04
327 #define C13DOF_BMM150_CHANNEL_X_DISABLED 0x08
328 #define C13DOF_BMM150_CHANNEL_Y_DISABLED 0x10
329 #define C13DOF_BMM150_CHANNEL_Z_DISABLED 0x20
330 #define C13DOF_BMM150_INTERR_PIN_EN 0x40
331 #define C13DOF_BMM150_DATAREADY_PIN_EN 0x80
332 
338 #define C13DOF_BMI088_ACCEL_SLAVE_ADDR 0x18
339 #define C13DOF_BMI088_GYRO_SLAVE_ADDR 0x68
340 #define C13DOF_BMI088_ACCEL_CHIP_ID_REG 0x00
341 #define C13DOF_BMI088_ACCEL_ERR_REG 0x02
342 #define C13DOF_BMI088_ACCEL_STATUS_REG 0x03
343 #define C13DOF_BMI088_ACCEL_X_LSB_REG 0x12
344 #define C13DOF_BMI088_ACCEL_X_MSB_REG 0x13
345 #define C13DOF_BMI088_ACCEL_Y_LSB_REG 0x14
346 #define C13DOF_BMI088_ACCEL_Y_MSB_REG 0x15
347 #define C13DOF_BMI088_ACCEL_Z_LSB_REG 0x16
348 #define C13DOF_BMI088_ACCEL_Z_MSB_REG 0x17
349 #define C13DOF_BMI088_ACCEL_SENSORTIME_0_REG 0x18
350 #define C13DOF_BMI088_ACCEL_SENSORTIME_1_REG 0x19
351 #define C13DOF_BMI088_ACCEL_SENSORTIME_2_REG 0x1A
352 #define C13DOF_BMI088_ACCEL_INT_STAT_0_REG 0x1C
353 #define C13DOF_BMI088_ACCEL_INT_STAT_1_REG 0x1D
354 #define C13DOF_BMI088_ACCEL_GP_0_REG 0x1E
355 #define C13DOF_BMI088_TEMP_MSB_REG 0x22
356 #define C13DOF_BMI088_TEMP_LSB_REG 0x23
357 #define C13DOF_BMI088_ACCEL_GP_4_REG 0x27
358 #define C13DOF_BMI088_ACCEL_INTERNAL_STAT_REG 0x2A
359 #define C13DOF_BMI088_ACCEL_CONF_REG 0x40
360 #define C13DOF_BMI088_ACCEL_RANGE_REG 0x41
361 #define C13DOF_BMI088_ACCEL_INT1_IO_CONF_REG 0x53
362 #define C13DOF_BMI088_ACCEL_INT2_IO_CONF_REG 0x54
363 #define C13DOF_BMI088_ACCEL_INT_LATCH_CONF_REG 0x55
364 #define C13DOF_BMI088_ACCEL_INT1_MAP_REG 0x56
365 #define C13DOF_BMI088_ACCEL_INT2_MAP_REG 0x57
366 #define C13DOF_BMI088_ACCEL_INT1_INT2_MAP_DATA_REG 0x58
367 #define C13DOF_BMI088_ACCEL_INIT_CTRL_REG 0x59
368 #define C13DOF_BMI088_ACCEL_SELF_TEST_REG 0x6D
369 #define C13DOF_BMI088_ACCEL_PWR_CONF_REG 0x7C
370 #define C13DOF_BMI088_ACCEL_PWR_CTRL_REG 0x7D
371 #define C13DOF_BMI088_ACCEL_SOFTRESET_REG 0x7E
372 #define C13DOF_BMI088_ACCEL_CHIP_ID 0x1E
373 #define C13DOF_BMI088_ACCEL_I2C_ADDR_PRIMARY 0x18
374 #define C13DOF_BMI088_ACCEL_I2C_ADDR_SECONDARY 0x19
375 #define C13DOF_BMI088_ACCEL_RESERVED_5B_REG 0x5B
376 #define C13DOF_BMI088_ACCEL_RESERVED_5C_REG 0x5C
377 #define C13DOF_BMI088_ACCEL_FEATURE_CFG_REG 0x5E
378 #define C13DOF_BMI088_ACCEL_DATA_READY_INT 0x80
379 #define C13DOF_BMI088_ACCEL_BW_OSR4 0x00
380 #define C13DOF_BMI088_ACCEL_BW_OSR2 0x01
381 #define C13DOF_BMI088_ACCEL_BW_NORMAL 0x02
382 #define C13DOF_BMI088_ACCEL_ODR_12_5_HZ 0x05
383 #define C13DOF_BMI088_ACCEL_ODR_25_HZ 0x06
384 #define C13DOF_BMI088_ACCEL_ODR_50_HZ 0x07
385 #define C13DOF_BMI088_ACCEL_ODR_100_HZ 0x08
386 #define C13DOF_BMI088_ACCEL_ODR_200_HZ 0x09
387 #define C13DOF_BMI088_ACCEL_ODR_400_HZ 0x0A
388 #define C13DOF_BMI088_ACCEL_ODR_800_HZ 0x0B
389 #define C13DOF_BMI088_ACCEL_ODR_1600_HZ 0x0C
390 #define C13DOF_BMI088_ACCEL_SWITCH_OFF_SELF_TEST 0x00
391 #define C13DOF_BMI088_ACCEL_POSITIVE_SELF_TEST 0x0D
392 #define C13DOF_BMI088_ACCEL_NEGATIVE_SELF_TEST 0x09
393 #define C13DOF_BMI088_ACCEL_PM_ACTIVE 0x00
394 #define C13DOF_BMI088_ACCEL_PM_SUSPEND 0x03
395 #define C13DOF_BMI088_ACCEL_POWER_DISABLE 0x00
396 #define C13DOF_BMI088_ACCEL_POWER_ENABLE 0x04
397 #define C13DOF_BMI088_ACCEL_INTA_DISABLE 0x00
398 #define C13DOF_BMI088_ACCEL_INTA_ENABLE 0x01
399 #define C13DOF_BMI088_ACCEL_INTB_DISABLE 0x00
400 #define C13DOF_BMI088_ACCEL_INTB_ENABLE 0x02
401 #define C13DOF_BMI088_ACCEL_SOFTRESET_DELAY_MS 1
402 #define C13DOF_BMI088_FATAL_ERR_MASK 0x01
403 #define C13DOF_BMI088_ERR_CODE_MASK 0x1C
404 #define C13DOF_BMI088_CMD_ERR_POS 1
405 #define C13DOF_BMI088_ERR_CODE_POS 2
406 #define C13DOF_BMI088_ACCEL_STATUS_MASK 0x80
407 #define C13DOF_BMI088_ACCEL_STATUS_POS 7
408 #define C13DOF_BMI088_ACCEL_ODR_MASK 0x0F
409 #define C13DOF_BMI088_ACCEL_BW_MASK 0x70
410 #define C13DOF_BMI088_ACCEL_RANGE_MASK 0x03
411 #define C13DOF_BMI088_ACCEL_BW_POS 4
412 #define C13DOF_BMI088_ACCEL_INT_EDGE_MASK 0x01
413 #define C13DOF_BMI088_ACCEL_INT_LVL_MASK 0x02
414 #define C13DOF_BMI088_ACCEL_INT_OD_MASK 0x04
415 #define C13DOF_BMI088_ACCEL_INT_IO_MASK 0x08
416 #define C13DOF_BMI088_ACCEL_INT_IN_MASK 0x10
417 #define C13DOF_BMI088_ACCEL_INT_EDGE_POS 0
418 #define C13DOF_BMI088_ACCEL_INT_LVL_POS 1
419 #define C13DOF_BMI088_ACCEL_INT_OD_POS 2
420 #define C13DOF_BMI088_ACCEL_INT_IO_POS 3
421 #define C13DOF_BMI088_ACCEL_INT_IN_POS 4
422 #define C13DOF_BMI088_ACCEL_MAP_INTA_MASK 0x01
423 #define C13DOF_BMI088_ACCEL_MAP_INTA_POS 0x00
424 #define C13DOF_BMI088_ACCEL_INT1_DRDY_MASK 0x04
425 #define C13DOF_BMI088_ACCEL_INT2_DRDY_MASK 0x40
426 #define C13DOF_BMI088_ACCEL_INT1_DRDY_POS 2
427 #define C13DOF_BMI088_ACCEL_INT2_DRDY_POS 6
428 #define C13DOF_BMI088_ASIC_INITIALIZED 0x01
429 #define C13DOF_BMI088_GYRO_CHIP_ID_REG 0x00
430 #define C13DOF_BMI088_GYRO_X_LSB_REG 0x02
431 #define C13DOF_BMI088_GYRO_X_MSB_REG 0x03
432 #define C13DOF_BMI088_GYRO_Y_LSB_REG 0x04
433 #define C13DOF_BMI088_GYRO_Y_MSB_REG 0x05
434 #define C13DOF_BMI088_GYRO_Z_LSB_REG 0x06
435 #define C13DOF_BMI088_GYRO_Z_MSB_REG 0x07
436 #define C13DOF_BMI088_GYRO_INT_STAT_1_REG 0x0A
437 #define C13DOF_BMI088_GYRO_RANGE_REG 0x0F
438 #define C13DOF_BMI088_GYRO_BANDWIDTH_REG 0x10
439 #define C13DOF_BMI088_GYRO_LPM1_REG 0x11
440 #define C13DOF_BMI088_GYRO_SOFTRESET_REG 0x14
441 #define C13DOF_BMI088_GYRO_INT_CTRL_REG 0x15
442 #define C13DOF_BMI088_GYRO_INT3_INT4_IO_CONF_REG 0x16
443 #define C13DOF_BMI088_GYRO_INT3_INT4_IO_MAP_REG 0x18
444 #define C13DOF_BMI088_GYRO_SELF_TEST_REG 0x3C
445 #define C13DOF_BMI088_GYRO_CHIP_ID 0x0F
446 #define C13DOF_BMI088_GYRO_I2C_ADDR_PRIMARY 0x68
447 #define C13DOF_BMI088_GYRO_I2C_ADDR_SECONDARY 0x69
448 #define C13DOF_BMI088_GYRO_RANGE_2000_DPS 0x00
449 #define C13DOF_BMI088_GYRO_RANGE_1000_DPS 0x01
450 #define C13DOF_BMI088_GYRO_RANGE_500_DPS 0x02
451 #define C13DOF_BMI088_GYRO_RANGE_250_DPS 0x03
452 #define C13DOF_BMI088_GYRO_RANGE_125_DPS 0x04
453 #define C13DOF_BMI088_GYRO_BW_532_ODR_2000_HZ 0x00
454 #define C13DOF_BMI088_GYRO_BW_230_ODR_2000_HZ 0x01
455 #define C13DOF_BMI088_GYRO_BW_116_ODR_1000_HZ 0x02
456 #define C13DOF_BMI088_GYRO_BW_47_ODR_400_HZ 0x03
457 #define C13DOF_BMI088_GYRO_BW_23_ODR_200_HZ 0x04
458 #define C13DOF_BMI088_GYRO_BW_12_ODR_100_HZ 0x05
459 #define C13DOF_BMI088_GYRO_BW_64_ODR_200_HZ 0x06
460 #define C13DOF_BMI088_GYRO_BW_32_ODR_100_HZ 0x07
461 #define C13DOF_BMI088_GYRO_ODR_RESET_VAL 0x80
462 #define C13DOF_BMI088_GYRO_PM_NORMAL 0x00
463 #define C13DOF_BMI088_GYRO_PM_DEEP_SUSPEND 0x20
464 #define C13DOF_BMI088_GYRO_PM_SUSPEND 0x80
465 #define C13DOF_BMI088_GYRO_DRDY_INT_DISABLE_VAL 0x00
466 #define C13DOF_BMI088_GYRO_DRDY_INT_ENABLE_VAL 0x80
467 #define C13DOF_BMI088_GYRO_MAP_DRDY_TO_INT3 0x01
468 #define C13DOF_BMI088_GYRO_MAP_DRDY_TO_INT4 0x80
469 #define C13DOF_BMI088_GYRO_MAP_DRDY_TO_BOTH_INT3_INT4 0x81
470 #define C13DOF_BMI088_GYRO_SOFTRESET_DELAY 30
471 #define C13DOF_BMI088_GYRO_POWER_MODE_CONFIG_DELAY 30
472 #define C13DOF_BMI088_GYRO_RANGE_MASK 0x07
473 #define C13DOF_BMI088_GYRO_BW_MASK 0x0F
474 #define C13DOF_BMI088_GYRO_POWER_MASK 0xA0
475 #define C13DOF_BMI088_GYRO_POWER_POS 5
476 #define C13DOF_BMI088_GYRO_DATA_EN_MASK 0x80
477 #define C13DOF_BMI088_GYRO_DATA_EN_POS 7
478 #define C13DOF_BMI088_GYRO_INT3_LVL_MASK 0x01
479 #define C13DOF_BMI088_GYRO_INT3_OD_MASK 0x02
480 #define C13DOF_BMI088_GYRO_INT4_LVL_MASK 0x04
481 #define C13DOF_BMI088_GYRO_INT4_OD_MASK 0x08
482 #define C13DOF_BMI088_GYRO_INT3_OD_POS 1
483 #define C13DOF_BMI088_GYRO_INT4_LVL_POS 2
484 #define C13DOF_BMI088_GYRO_INT4_OD_POS 3
485 #define C13DOF_BMI088_GYRO_INT_EN_MASK 0x80
486 #define C13DOF_BMI088_GYRO_INT_EN_POS 7
487 #define C13DOF_BMI088_GYRO_INT3_MAP_MASK 0x01
488 #define C13DOF_BMI088_GYRO_INT4_MAP_MASK 0x80
489 #define C13DOF_BMI088_GYRO_INT3_MAP_POS 0
490 #define C13DOF_BMI088_GYRO_INT4_MAP_POS 7
491 #define C13DOF_BMI088_OK 0x00
492 #define C13DOF_BMI088_ERROR 0x01
493 #define T_C13DOF_P const uint8_t*
494 #define C13DOF_BME680_RETVAL_T uint8_t
495 #define C13DOF_BMM150_RETVAL_T uint8_t
496 #define C13DOF_BMI088_RETVAL_T uint8_t
497  // End group macro
500 // --------------------------------------------------------------- PUBLIC TYPES
510 typedef struct
511 {
512  uint8_t status;
513  uint8_t gas_index;
514  uint8_t meas_index;
515  int16_t temperature;
516  float pressure;
517  uint32_t humidity;
518  uint32_t gas_resistance;
519 
521 
522 typedef struct
523 {
524 
525  uint16_t par_h1;
526  uint16_t par_h2;
527  int8_t par_h3;
528  int8_t par_h4;
529  int8_t par_h5;
530  uint8_t par_h6;
531  int8_t par_h7;
532 
533  int8_t par_gh1;
534  int16_t par_gh2;
535  int8_t par_gh3;
536 
537  uint16_t par_t1;
538  int16_t par_t2;
539  int8_t par_t3;
540 
541  uint16_t par_p1;
542  int16_t par_p2;
543  int8_t par_p3;
544  int16_t par_p4;
545  int16_t par_p5;
546  int8_t par_p6;
547  int8_t par_p7;
548  int16_t par_p8;
549  int16_t par_p9;
550  uint8_t par_p10;
551 
552  int32_t t_fine;
553 
554  uint8_t res_heat_range;
555  int8_t res_heat_val;
556  int8_t range_sw_err;
557 
559 
560 typedef struct
561 {
562  uint8_t os_hum;
563 
564  uint8_t os_temp;
565 
566  uint8_t os_pres;
567 
568  uint8_t filter;
569 
571 
572 
573 typedef struct
574 {
575  uint8_t nb_conv;
576 
577  uint8_t heatr_ctrl;
578 
579  uint8_t run_gas;
580 
581  uint16_t heatr_temp;
582 
583  uint16_t heatr_dur;
584 
586 
587 typedef struct
588 {
589  // Modules
590 
591  i2c_master_t i2c;
592 
593  // ctx variable
594 
599 
604 
607 
608 } c13dof_t;
609 
613 typedef struct
614 {
615  // Communication gpio pins
616 
617  pin_name_t scl;
618  pin_name_t sda;
619 
620  // static variable
621 
622  uint32_t i2c_speed;
627 
628 } c13dof_cfg_t;
629  // End types group
631 
632 // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
633 
639 #ifdef __cplusplus
640 extern "C"{
641 #endif
642 
652 
662 
671 
685 void c13dof_bme680_write_byte ( c13dof_t *ctx, uint8_t reg_address, uint8_t write_data );
686 
701 uint8_t c13dof_bme680_read_byte ( c13dof_t *ctx, uint8_t reg_address );
702 
717 
734 
745 
760 
761 
780 float c13dof_bme680_get_ambient_data ( c13dof_t *ctx, uint8_t data_in );
781 
795 
809 
823 
837 
851 C13DOF_BMM150_RETVAL_T c13dof_bmm150_write_byte ( c13dof_t *ctx, uint8_t reg_address, uint8_t write_data );
852 
867 uint8_t c13dof_bmm150_read_byte ( c13dof_t *ctx, uint8_t reg_address );
868 
888 C13DOF_BMM150_RETVAL_T c13dof_bmm150_read_bytes ( c13dof_t *ctx, uint8_t *data_out, uint8_t reg_address, uint8_t n_bytes );
889 
904 
922 void c13dof_bmm150_read_geo_mag_data ( c13dof_t *ctx, int16_t *mag_x, int16_t *mag_y, int16_t *mag_z, uint16_t *res_hall );
923 
934 
946 
960 void c13dof_bmi088_gyro_write_byte ( c13dof_t *ctx, uint8_t reg_address, uint8_t write_data );
961 
977 void c13dof_bmi088_gyro_write_bytes ( c13dof_t *ctx, uint8_t reg_address, uint8_t *write_data, uint8_t n_bytes );
978 
993 uint8_t c13dof_bmi088_gyro_read_byte ( c13dof_t *ctx, uint8_t reg_address );
994 
1014 C13DOF_BMI088_RETVAL_T c13dof_bmi088_gyro_read_bytes ( c13dof_t *ctx, uint8_t *data_out, uint8_t reg_address, uint8_t n_bytes );
1015 
1030 
1048 
1067 
1078 
1095 int16_t c13dof_bmi088_get_gyro_axis ( c13dof_t *ctx, uint8_t adr_reg_LSB, uint8_t adr_reg_MSB );
1096 
1113 void c13dof_bmi088_read_gyro ( c13dof_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z );
1114 
1128 void c13dof_bmi088_accel_write_byte ( c13dof_t *ctx, uint8_t reg_address, uint8_t write_data );
1129 
1145 void c13dof_bmi088_accel_write_bytes ( c13dof_t *ctx, uint8_t reg_address, uint8_t *write_data, uint8_t n_bytes );
1146 
1161 uint8_t c13dof_bmi088_accel_read_byte ( c13dof_t *ctx, uint8_t reg_address );
1162 
1182 C13DOF_BMI088_RETVAL_T c13dof_bmi088_accel_read_bytes ( c13dof_t *ctx, uint8_t *data_out, uint8_t reg_address, uint8_t n_bytes );
1183 
1198 
1211 // uint8_t c13dof_bmi088_get_accel_error ( c13dof_t *ctx );
1212 
1228 
1241 void c13dof_bmi088_set_accel_config ( c13dof_t *ctx, uint8_t accel_config );
1242 
1256 
1271 
1294 void c13dof_bmi088_set_accel_mode ( c13dof_t *ctx, uint8_t active_mode );
1295 
1314 
1333 
1349 int16_t c13dof_bmi088_get_accel_axis ( c13dof_t *ctx, uint8_t adr_reg_LSB, uint8_t adr_reg_MSB );
1350 
1367 void c13dof_bmi088_read_accel ( c13dof_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z );
1368 
1379 
1380 #ifdef __cplusplus
1381 }
1382 #endif
1383 #endif // _C13DOF_H_
1384  // End public_function group
1387 
1388 // ------------------------------------------------------------------------- END
c13dof_t::d_data
T_C13DOF_BME680_FIELD_DATA d_data
Definition: c13dof.h:600
T_C13DOF_BME680_CALIB_DATA::par_gh2
int16_t par_gh2
Definition: c13dof.h:534
c13dof_t::bme680_slave_address
uint8_t bme680_slave_address
Definition: c13dof.h:595
c13dof_t::bmm150_slave_address
uint8_t bmm150_slave_address
Definition: c13dof.h:596
c13dof_t::gas_sett
T_C13DOF_BME680_GAS_SETTINGS gas_sett
Definition: c13dof.h:603
T_C13DOF_BME680_CALIB_DATA::par_p8
int16_t par_p8
Definition: c13dof.h:548
T_C13DOF_BME680_FIELD_DATA::gas_index
uint8_t gas_index
Definition: c13dof.h:513
c13dof_t::bmi088Accel_slave_address
uint8_t bmi088Accel_slave_address
Definition: c13dof.h:598
c13dof_default_cfg
void c13dof_default_cfg(c13dof_t *ctx)
Click Default Configuration function.
c13dof_init
C13DOF_RETVAL c13dof_init(c13dof_t *ctx, c13dof_cfg_t *cfg)
Initialization function.
C13DOF_BME680_RETVAL_T
#define C13DOF_BME680_RETVAL_T
Definition: c13dof.h:494
T_C13DOF_BME680_CALIB_DATA::par_gh1
int8_t par_gh1
Definition: c13dof.h:533
c13dof_bmm150_read_bytes
C13DOF_BMM150_RETVAL_T c13dof_bmm150_read_bytes(c13dof_t *ctx, uint8_t *data_out, uint8_t reg_address, uint8_t n_bytes)
Generic BMM150 sequential data read function.
T_C13DOF_BME680_GAS_SETTINGS::heatr_temp
uint16_t heatr_temp
Definition: c13dof.h:581
T_C13DOF_BME680_FIELD_DATA::humidity
uint32_t humidity
Definition: c13dof.h:517
T_C13DOF_BME680_CALIB_DATA::par_h6
uint8_t par_h6
Definition: c13dof.h:530
gyro_x
int16_t gyro_x
Definition: main.c:48
c13dof_bmi088_set_accel_mode
void c13dof_bmi088_set_accel_mode(c13dof_t *ctx, uint8_t active_mode)
Set BMI088 Accel mode function.
T_C13DOF_BME680_GAS_SETTINGS::run_gas
uint8_t run_gas
Definition: c13dof.h:579
c13dof_cfg_t::scl
pin_name_t scl
Definition: c13dof.h:617
T_C13DOF_BME680_CALIB_DATA::par_h4
int8_t par_h4
Definition: c13dof.h:528
c13dof_t
Definition: c13dof.h:588
T_C13DOF_BME680_CALIB_DATA::res_heat_val
int8_t res_heat_val
Definition: c13dof.h:555
T_C13DOF_BME680_CALIB_DATA::par_gh3
int8_t par_gh3
Definition: c13dof.h:535
c13dof_bmi088_soft_reset_giro
void c13dof_bmi088_soft_reset_giro(c13dof_t *ctx)
Software BMI088 Gyro reset function.
c13dof_bmi088_set_gyro_bandwidth
C13DOF_BMI088_RETVAL_T c13dof_bmi088_set_gyro_bandwidth(c13dof_t *ctx, uint8_t gyro_bandwidth)
Set BMI088 Gyro bandwidth function.
c13dof_bme680_get_gas_resistance
uint32_t c13dof_bme680_get_gas_resistance(c13dof_t *ctx)
Gets BME680 gas resistance data function.
T_C13DOF_BME680_CALIB_DATA::par_p9
int16_t par_p9
Definition: c13dof.h:549
T_C13DOF_BME680_TPH_SETTINGS::os_pres
uint8_t os_pres
Definition: c13dof.h:566
c13dof_bmi088_gyro_read_bytes
C13DOF_BMI088_RETVAL_T c13dof_bmi088_gyro_read_bytes(c13dof_t *ctx, uint8_t *data_out, uint8_t reg_address, uint8_t n_bytes)
Generic BMI088 Gyro sequential data read function.
T_C13DOF_BME680_CALIB_DATA::par_p2
int16_t par_p2
Definition: c13dof.h:542
c13dof_t::calib
T_C13DOF_BME680_CALIB_DATA calib
Definition: c13dof.h:601
T_C13DOF_BME680_CALIB_DATA::par_p3
int8_t par_p3
Definition: c13dof.h:543
c13dof_t::device_power_mode
uint8_t device_power_mode
Definition: c13dof.h:606
C13DOF_BMM150_RETVAL_T
#define C13DOF_BMM150_RETVAL_T
Definition: c13dof.h:495
c13dof_cfg_t::bmi088Accel_slave_address
uint8_t bmi088Accel_slave_address
Definition: c13dof.h:626
T_C13DOF_BME680_FIELD_DATA::status
uint8_t status
Definition: c13dof.h:512
c13dof_bmi088_accel_write_byte
void c13dof_bmi088_accel_write_byte(c13dof_t *ctx, uint8_t reg_address, uint8_t write_data)
Generic BMI088 Accel write data function.
T_C13DOF_BME680_TPH_SETTINGS::os_hum
uint8_t os_hum
Definition: c13dof.h:562
T_C13DOF_BME680_CALIB_DATA
Definition: c13dof.h:523
c13dof_bmi088_set_accel_range
C13DOF_BMI088_RETVAL_T c13dof_bmi088_set_accel_range(c13dof_t *ctx, uint8_t accel_range)
Set BMI088 Accel range function.
mag_y
int16_t mag_y
Definition: main.c:52
T_C13DOF_BME680_FIELD_DATA::pressure
float pressure
Definition: c13dof.h:516
c13dof_bmi088_gyro_read_byte
uint8_t c13dof_bmi088_gyro_read_byte(c13dof_t *ctx, uint8_t reg_address)
Generic BMI088 Gyro read data function.
c13dof_bmm150_soft_reset
void c13dof_bmm150_soft_reset(c13dof_t *ctx)
Software BMM150 reset function.
c13dof_t::i2c
i2c_master_t i2c
Definition: c13dof.h:591
c13dof_cfg_t::bme680_slave_address
uint8_t bme680_slave_address
Definition: c13dof.h:623
c13dof_bme680_get_temperature
float c13dof_bme680_get_temperature(c13dof_t *ctx)
Gets BME680 temperature in degrees Celsius function.
T_C13DOF_BME680_CALIB_DATA::par_h1
uint16_t par_h1
Definition: c13dof.h:525
T_C13DOF_BME680_CALIB_DATA::par_h2
uint16_t par_h2
Definition: c13dof.h:526
T_C13DOF_BME680_GAS_SETTINGS
Definition: c13dof.h:574
c13dof_bmi088_enable_accel
C13DOF_BMI088_RETVAL_T c13dof_bmi088_enable_accel(c13dof_t *ctx)
Enable BMI088 Accel function.
c13dof_bme680_get_calibration_data
void c13dof_bme680_get_calibration_data(c13dof_t *ctx)
Get BME680 factory calibration parameters function.
c13dof_t::device_mem_page
uint8_t device_mem_page
Definition: c13dof.h:605
T_C13DOF_BME680_TPH_SETTINGS::os_temp
uint8_t os_temp
Definition: c13dof.h:564
c13dof_bmi088_accel_read_bytes
C13DOF_BMI088_RETVAL_T c13dof_bmi088_accel_read_bytes(c13dof_t *ctx, uint8_t *data_out, uint8_t reg_address, uint8_t n_bytes)
Generic BMI088 Accel sequential data read function.
c13dof_bmi088_soft_reset_accel
void c13dof_bmi088_soft_reset_accel(c13dof_t *ctx)
Set BMI088 Accel soft reset function.
C13DOF_RETVAL
#define C13DOF_RETVAL
Definition: c13dof.h:72
c13dof_t::bmi088Gyro_slave_address
uint8_t bmi088Gyro_slave_address
Definition: c13dof.h:597
c13dof_cfg_setup
void c13dof_cfg_setup(c13dof_cfg_t *cfg)
Config Object Initialization function.
c13dof_bme680_read_byte
uint8_t c13dof_bme680_read_byte(c13dof_t *ctx, uint8_t reg_address)
Generic BME680 read byte of data function.
c13dof_bmm150_power_on_reset
void c13dof_bmm150_power_on_reset(c13dof_t *ctx)
BMM150 power ON reset function.
c13dof_bme680_check_id
C13DOF_BME680_RETVAL_T c13dof_bme680_check_id(c13dof_t *ctx)
Check BME680 device ID function.
T_C13DOF_BME680_CALIB_DATA::par_p4
int16_t par_p4
Definition: c13dof.h:544
c13dof_bmm150_read_geo_mag_data
void c13dof_bmm150_read_geo_mag_data(c13dof_t *ctx, int16_t *mag_x, int16_t *mag_y, int16_t *mag_z, uint16_t *res_hall)
Get BMM150 Geomagnetic sensors data function.
T_C13DOF_BME680_CALIB_DATA::par_h3
int8_t par_h3
Definition: c13dof.h:527
accel_z
int16_t accel_z
Definition: main.c:47
c13dof_bmi088_set_accel_config
void c13dof_bmi088_set_accel_config(c13dof_t *ctx, uint8_t accel_config)
Set BMI088 Accel configuration function.
accel_x
int16_t accel_x
Definition: main.c:45
c13dof_bmm150_read_byte
uint8_t c13dof_bmm150_read_byte(c13dof_t *ctx, uint8_t reg_address)
Generic BMM150 read byte of data function.
c13dof_bmm150_write_byte
C13DOF_BMM150_RETVAL_T c13dof_bmm150_write_byte(c13dof_t *ctx, uint8_t reg_address, uint8_t write_data)
Generic BMM150 write the byte of data function.
T_C13DOF_BME680_GAS_SETTINGS::nb_conv
uint8_t nb_conv
Definition: c13dof.h:575
T_C13DOF_BME680_CALIB_DATA::par_t3
int8_t par_t3
Definition: c13dof.h:539
T_C13DOF_BME680_GAS_SETTINGS::heatr_ctrl
uint8_t heatr_ctrl
Definition: c13dof.h:577
mag_x
int16_t mag_x
Definition: main.c:51
c13dof_bme680_get_pressure
float c13dof_bme680_get_pressure(c13dof_t *ctx)
Gets BME680 pressure in degrees Celsius function.
c13dof_bme680_get_device_id
uint8_t c13dof_bme680_get_device_id(c13dof_t *ctx)
Get BME680 device ID function.
c13dof_bmi088_read_gyro
void c13dof_bmi088_read_gyro(c13dof_t *ctx, int16_t *gyro_x, int16_t *gyro_y, int16_t *gyro_z)
Get BMI088 Gyro X-axis, Y-axis and Z-axis function.
T_C13DOF_BME680_TPH_SETTINGS
Definition: c13dof.h:561
T_C13DOF_BME680_CALIB_DATA::par_h7
int8_t par_h7
Definition: c13dof.h:531
c13dof_bmi088_get_accel_axis
int16_t c13dof_bmi088_get_accel_axis(c13dof_t *ctx, uint8_t adr_reg_LSB, uint8_t adr_reg_MSB)
Get BMI088 Accel axis data function.
c13dof_cfg_t::i2c_speed
uint32_t i2c_speed
Definition: c13dof.h:622
T_C13DOF_BME680_CALIB_DATA::par_p5
int16_t par_p5
Definition: c13dof.h:545
c13dof_bme680_soft_reset
void c13dof_bme680_soft_reset(c13dof_t *ctx)
Software BME680 reset function.
c13dof_cfg_t
Click configuration structure definition.
Definition: c13dof.h:614
c13dof_cfg_t::bmm150_slave_address
uint8_t bmm150_slave_address
Definition: c13dof.h:624
c13dof_bmi088_default_config
void c13dof_bmi088_default_config(c13dof_t *ctx)
Set BMI088 Accel & Gyro default configuration fuction.
c13dof_bmi088_check_accel_data_ready
uint8_t c13dof_bmi088_check_accel_data_ready(c13dof_t *ctx)
Get BMI088 Accel error function.
T_C13DOF_BME680_CALIB_DATA::par_p10
uint8_t par_p10
Definition: c13dof.h:550
c13dof_bmi088_disable_accel
C13DOF_BMI088_RETVAL_T c13dof_bmi088_disable_accel(c13dof_t *ctx)
Disable BMI088 Accel function.
C13DOF_BMI088_RETVAL_T
#define C13DOF_BMI088_RETVAL_T
Definition: c13dof.h:496
T_C13DOF_BME680_CALIB_DATA::par_p7
int8_t par_p7
Definition: c13dof.h:547
T_C13DOF_BME680_CALIB_DATA::par_p6
int8_t par_p6
Definition: c13dof.h:546
gyro_z
int16_t gyro_z
Definition: main.c:50
c13dof_cfg_t::sda
pin_name_t sda
Definition: c13dof.h:618
T_C13DOF_BME680_TPH_SETTINGS::filter
uint8_t filter
Definition: c13dof.h:568
mag_z
int16_t mag_z
Definition: main.c:53
c13dof_bmi088_gyro_write_byte
void c13dof_bmi088_gyro_write_byte(c13dof_t *ctx, uint8_t reg_address, uint8_t write_data)
Generic BMI088 Gyro write data function.
c13dof_bme680_get_ambient_data
float c13dof_bme680_get_ambient_data(c13dof_t *ctx, uint8_t data_in)
Get BME680 ambient data function.
c13dof_bmi088_get_gyro_axis
int16_t c13dof_bmi088_get_gyro_axis(c13dof_t *ctx, uint8_t adr_reg_LSB, uint8_t adr_reg_MSB)
Get BMI088 Gyro axis data function.
c13dof_cfg_t::bmi088Gyro_slave_address
uint8_t bmi088Gyro_slave_address
Definition: c13dof.h:625
c13dof_bmi088_read_accel
void c13dof_bmi088_read_accel(c13dof_t *ctx, int16_t *accel_x, int16_t *accel_y, int16_t *accel_z)
Get BMI088 Accel X-axis, Y-axis and Z-axis function.
gyro_y
int16_t gyro_y
Definition: main.c:49
T_C13DOF_BME680_CALIB_DATA::par_h5
int8_t par_h5
Definition: c13dof.h:529
c13dof_bmi088_get_gyro_id
uint8_t c13dof_bmi088_get_gyro_id(c13dof_t *ctx)
Get BMI088 Gyro ID function.
T_C13DOF_BME680_GAS_SETTINGS::heatr_dur
uint16_t heatr_dur
Definition: c13dof.h:583
c13dof_bmi088_gyro_write_bytes
void c13dof_bmi088_gyro_write_bytes(c13dof_t *ctx, uint8_t reg_address, uint8_t *write_data, uint8_t n_bytes)
Generic sequential BMI088 Gyro write data function.
T_C13DOF_BME680_CALIB_DATA::res_heat_range
uint8_t res_heat_range
Definition: c13dof.h:554
T_C13DOF_BME680_FIELD_DATA
Click ctx object definition.
Definition: c13dof.h:511
T_C13DOF_BME680_FIELD_DATA::temperature
int16_t temperature
Definition: c13dof.h:515
c13dof_bmi088_set_gyro_range
C13DOF_BMI088_RETVAL_T c13dof_bmi088_set_gyro_range(c13dof_t *ctx, uint8_t gyro_range)
Set BMI088 Gyro range function.
c13dof_bmi088_accel_read_byte
uint8_t c13dof_bmi088_accel_read_byte(c13dof_t *ctx, uint8_t reg_address)
Generic BMI088 Accel read data function.
T_C13DOF_BME680_CALIB_DATA::par_t1
uint16_t par_t1
Definition: c13dof.h:537
c13dof_bme680_get_humidity
float c13dof_bme680_get_humidity(c13dof_t *ctx)
Gets BME680 humidity in percentage [ % ] function.
T_C13DOF_BME680_FIELD_DATA::meas_index
uint8_t meas_index
Definition: c13dof.h:514
T_C13DOF_BME680_FIELD_DATA::gas_resistance
uint32_t gas_resistance
Definition: c13dof.h:518
c13dof_t::tph_sett
T_C13DOF_BME680_TPH_SETTINGS tph_sett
Definition: c13dof.h:602
c13dof_bmi088_get_accel_id
uint8_t c13dof_bmi088_get_accel_id(c13dof_t *ctx)
Get BMI088 Accel ID function.
c13dof_bme680_write_byte
void c13dof_bme680_write_byte(c13dof_t *ctx, uint8_t reg_address, uint8_t write_data)
Generic BME680 write the byte of data function.
c13dof_bmi088_accel_write_bytes
void c13dof_bmi088_accel_write_bytes(c13dof_t *ctx, uint8_t reg_address, uint8_t *write_data, uint8_t n_bytes)
Generic sequential BMI088 Accel write data function.
T_C13DOF_BME680_CALIB_DATA::t_fine
int32_t t_fine
Definition: c13dof.h:552
T_C13DOF_BME680_CALIB_DATA::par_p1
uint16_t par_p1
Definition: c13dof.h:541
accel_y
int16_t accel_y
Definition: main.c:46
T_C13DOF_BME680_CALIB_DATA::par_t2
int16_t par_t2
Definition: c13dof.h:538
c13dof_bmm150_check_ready
C13DOF_BMM150_RETVAL_T c13dof_bmm150_check_ready(c13dof_t *ctx)
Check BMM150 data ready status function.
T_C13DOF_BME680_CALIB_DATA::range_sw_err
int8_t range_sw_err
Definition: c13dof.h:556